cell_spec¶
Standard-cell specifications for timing characterization.
A standard-cell library (:class:StdCellLibrary) bundles everything the timing
flow needs for one PDK: the liberty timing files, the Yosys techmap files, and
the standard cells the synthesizer maps onto, grouped by the logical function
they fill (:class:CellFunction). Each cell is a :class:CellSpec – its name
plus the ports a cell-mapping tool needs, with room to grow more metadata.
The library is parsed (and validated) from one pdk::<variant> section of the
project’s Fabric/std_cell_library.yaml via :meth:StdCellLibrary.load, so a
PDK is characterized – or repointed – by editing that file instead of changing
code. Liberty/techmap paths may be absolute, relative to the project directory,
or reference ${VAR} placeholders (e.g. ${PDK_ROOT}, ${PDK}) that the
caller resolves from the active settings. Add a section to characterize another
PDK, and add a member to :class:CellFunction (with a matching cells key) to
teach it a new cell type.
Attributes¶
Project-relative path to the per-PDK standard-cell library file. |
Classes¶
The logical role a standard cell fills during timing characterization. |
|
A standard cell and the ports a cell-mapping tool needs to use it. |
|
A PDK's standard-cell library for timing characterization. |
|
The on-disk standard-cell library config: |
Module Contents¶
CellFunction¶
- class CellFunction[source]¶
Bases:
StrEnumThe logical role a standard cell fills during timing characterization.
The members are the keys of a library’s
cellsmapping and the argument to :meth:StdCellLibrary.get; they are the extension point for new cell types.Initialize self. See help(type(self)) for accurate signature.
CellSpec¶
- class CellSpec(/, **data)[source]¶
Bases:
BaseModelA standard cell and the ports a cell-mapping tool needs to use it.
cellis the standard-cell name;input_portsandoutput_portslist its ports (a buffer has one of each, a tie cell only an output, and cells with several inputs/outputs list them all). Add further fields – drive strength, area, … – as more cell metadata is needed.Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.selfis explicitly positional-only to allowselfas a field name.Properties¶
StdCellLibrary¶
- class StdCellLibrary(/, **data)[source]¶
Bases:
BaseModelA PDK’s standard-cell library for timing characterization.
Bundles the liberty timing files and Yosys techmap files with the cells the synthesizer maps onto, grouped by function. A function may map to several cells (e.g. multiple buffers); use :meth:
getto fetch them. Liberty and techmap entries accept${VAR}placeholders and relative paths, resolved against the validation context supplied by :meth:load.Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.selfis explicitly positional-only to allowselfas a field name.Methods¶
- get(function) list[CellSpec][source]¶
Return the cells declared for
function.- Parameters:
function (CellFunction) – The logical role to look up.
- Returns:
The cells declared for
functionin declaration order, empty when the library declares none.
- classmethod load(project_dir, pdk, variables=None) Self[source]¶
Load the standard-cell library for
pdkfrom the project file.- Parameters:
project_dir (Path) – Project directory containing
Fabric/std_cell_library.yaml.pdk (str) – Active PDK variant name, matched against a
pdk::<name>section.variables (dict[str, str] | None) – Placeholder values for
${VAR}references in liberty/techmap paths (e.g.{"PDK_ROOT": ..., "PDK": ...}); None for no placeholders.
- Returns:
The standard-cell library for the PDK.
- Raises:
FileNotFoundError – If the standard-cell library file does not exist.
ValueError – If the file has no section for
pdkor the section is malformed.