piel.integration.amaranth_openlane#

This file enhances some functions that translate an amaranth function to an openlane flow implementation.

Functions#

layout_truth_table_through_openlane(truth_table, ...)

Translates a truth table to an OpenLane flow implementation.

layout_amaranth_truth_table_through_openlane(...[, ...])

Implements an Amaranth truth table module through the OpenLane flow.

Module Contents#

layout_truth_table_through_openlane(truth_table: piel.types.TruthTable, parent_directory: piel.types.PathTypes, target_directory_name: str | None = None, openlane_version: Literal['v1', 'v2'] = 'v2', **kwargs)[source]#

Translates a truth table to an OpenLane flow implementation.

This function takes a truth table and converts it into an OpenLane flow, using the specified OpenLane version. It first constructs an Amaranth module from the truth table, and then passes this module to the layout_amaranth_truth_table_through_openlane function for further processing.

Parameters:
  • truth_table (TruthTable) – The truth table to be converted. It includes input connection, output connection, and the table logic.

  • parent_directory (PathTypes) – The directory where the OpenLane project will be created.

  • target_directory_name (Optional[str]) – Name of the target directory. If not specified, a default name will be used.

  • openlane_version (Literal["v1", "v2"]) – Specifies the OpenLane version to use. Defaults to “v2”.

  • **kwargs – Additional keyword arguments passed to the Amaranth module construction.

Returns:

None

layout_amaranth_truth_table_through_openlane(amaranth_module: piel.types.DigitalLogicModule, truth_table: piel.types.TruthTable, parent_directory: piel.types.PathTypes, target_directory_name: str | None = None, openlane_version: Literal['v1', 'v2'] = 'v2', openlane_configuration: dict | None = None, **kwargs)[source]#

Implements an Amaranth truth table module through the OpenLane flow.

This function implements an amaranth truth-table module through the openlane flow. There are several ways to implement a module. Fundamentally, this requires the verilog files to be generated from the openlane-module in a particular directory. For the particular directory provided, this function will generate the verilog files in the corresponding directory. It can also generate the openlane configuration files for this particular location.

This function does a few things:

  1. Starts off from a amaranth module class.

  2. Determines the output directory in which to generate the files, and creates one accordingly if it does not exist.

  3. Generates the verilog files from the amaranth module class.

  4. Generates the openlane configuration files for this particular location.

  5. Implements the openlane flow for this particular location to generate a chip.

Parameters:
  • amaranth_module (am.Module) – The Amaranth module representing the truth table logic.

  • truth_table (TruthTable) – The truth table files structure containing the logic for the module.

  • parent_directory (PathTypes) – The directory where the project will be created or found.

  • target_directory_name (Optional[str]) – The name for the target directory. Defaults to the name of the Amaranth module’s class.

  • openlane_version (Literal["v1", "v2"]) – The version of OpenLane to use. Defaults to “v2”.

  • **kwargs – Additional keyword arguments for OpenLane configuration.

Returns:

None