chipflow.platform
Platform definitions for ChipFlow.
This module provides platform implementations for silicon, simulation, and software targets, along with their associated build steps.
Submodules
Classes
Represents an abstract library I/O port that can be passed to a buffer. |
|
Step to Prepare and submit the design for an ASIC. |
|
Base class for ChipFlow build steps. |
|
Base step to build the software. |
|
Build the design for a board. |
|
An |
|
Setting for IO Ports (see also base class |
|
Models various options for trip points for inputs. |
|
Options for an IO pad/pin. |
|
Description of an interface object. |
|
Description of an interface object. |
|
Description of an interface object. |
|
Description of an interface object. |
|
Description of an interface object. |
|
Description of an interface object. |
|
Description of an interface object. |
|
This holds the information needed for building software and providing the built outcome |
|
Models the potential drive modes of an SkyWater 130 IO cell [sky130_fd_io__gpiov2](https://skywater-pdk.readthedocs.io/en/main/contents/libraries/sky130_fd_io/docs/user_guide.html) |
|
Base class for ChipFlow build steps. |
Functions
|
This creates an |
|
This creates an |
|
This creates an |
Configure environment for Amaranth/WASM tools. |
|
|
Return the top level components for the design, as configured in |
|
Extract software build information from a component's interfaces. |
Package Contents
- class chipflow.platform.SiliconPlatformPort(name, port_desc)
Bases:
amaranth.lib.io.PortLike,Generic[Pin]Represents an abstract library I/O port that can be passed to a buffer.
The port types supported by most platforms are
SingleEndedPortandDifferentialPort. Platforms may define additional port types where appropriate.Note
amaranth.hdl.IOPortis not an instance ofamaranth.lib.io.PortLike.- Parameters:
name (str)
port_desc (chipflow.packaging.PortDesc)
- property direction
Direction of the port.
- Return type:
Direction
- class chipflow.platform.SiliconStep(config)
Step to Prepare and submit the design for an ASIC.
- prepare()
Elaborate the design and convert it to RTLIL.
Returns the path to the RTLIL file.
- submit(rtlil_path, args)
Submit the design to the ChipFlow cloud builder.
- Options:
–dry-run: Don’t actually submit –wait: Wait until build has completed. Use ‘-v’ to increase level of verbosity –log-file <file>: Log full debug output to file
- class chipflow.platform.SimStep(config)
Bases:
chipflow.platform.base.StepBaseBase class for ChipFlow build steps.
- build_cli_parser(parser)
Build the cli parser for this step
- run_cli(args)
Called when this step’s is used from chipflow command
- build(*args)
Builds the simulation model for the design
- run(*args)
Run the simulation. Will ensure that the simulation and the software are both built.
- check(*args)
Run the simulation and check events against reference (tests/events_reference.json). Will ensure that the simulation and the software are both built.
- class chipflow.platform.SoftwareStep(config)
Bases:
chipflow.platform.base.StepBaseBase step to build the software.
- build_cli_parser(parser)
Build the cli parser for this step
- run_cli(args)
Called when this step’s is used from chipflow command
- build(*args)
Build the software for your design
- class chipflow.platform.BoardStep(config, platform)
Bases:
chipflow.platform.base.StepBaseBuild the design for a board.
- build_cli_parser(parser)
Build the cli parser for this step
- run_cli(args)
Called when this step’s is used from chipflow command
- build(*args)
Build for the given platform
- class chipflow.platform.IOSignature(**kwargs)
Bases:
amaranth.lib.wiring.SignatureAn
Amaranth Signatureused to decorate wires that would usually be brought out onto a port on the package. This class is generally not directly used. Instead, you would typically utilize the more specificInputIOSignature,OutputIOSignature, orBidirIOSignaturefor defining pin interfaces.- Parameters:
kwargs (typing_extensions.Unpack[IOModel])
- property direction: amaranth.lib.io.Direction
The direction of the IO port
- Return type:
- property invert: collections.abc.Iterable[bool]
A tuple as wide as the IO port, with a bool for the polarity inversion for each wire
- Return type:
- property options: IOModelOptions
Options set on the io port at construction
- Return type:
- class chipflow.platform.IOModel
Bases:
IOModelOptionsSetting for IO Ports (see also base class
IOModelOptions).- Attributes:
direction:
io.Direction.Input,io.Direction.Outputorio.Direction.Bidir. width: Width of port, default is 1.
- class chipflow.platform.IOTripPoint
Bases:
enum.StrEnumModels various options for trip points for inputs. Depending on process and cell library, these may be statically or dynamically configurable.
You will get an error if the option is not available with the chosen process and cell library
- class chipflow.platform.IOModelOptions
Bases:
typing_extensions.TypedDictOptions for an IO pad/pin.
- Attributes:
- invert: Polarity inversion. If the value is a simple
bool, it specifies inversion for the entire port. If the value is an iterable of
bool, the iterable must have the same length as the width ofio, and the inversion is specified for individual wires.- individual_oe: Controls whether each output wire is associated with an
individual Output Enable bit or if a single OE bit will be used for entire port. The default value is False (indicating that a single OE bit controls the entire port).
- power_domain: The name of the I/O power domain. NB there is only one of
these, so IO with multiple power domains must be split up.
- clock_domain: The name of the I/O’s clock domain (see
amaranth.hdl.ClockDomain). NB there is only one of these, so IO with multiple clocks must be split up.
buffer_in: Should the IO pad have an input buffer? buffer_out: Should the IO pad have an output buffer? sky130_drive_mode: Drive mode for output buffer on sky130. trip_point: Trip Point configuration for input buffer. init: The value for the initial values of the port. init_oe: The value for the initial values of the output enable(s) of the port.
- invert: Polarity inversion. If the value is a simple
- chipflow.platform.OutputIOSignature(width, **kwargs)
This creates an
Amaranth Signaturewhich is then used to decorate package output signals intended for connection to the physical pads of the integrated circuit package.- Parameters:
width (int) – specifies the number of individual output wires within this port, each of which will correspond to a separate physical pad on the integrated circuit package.
kwargs (typing_extensions.Unpack[IOModelOptions])
- chipflow.platform.InputIOSignature(width, **kwargs)
This creates an
Amaranth Signaturewhich is then used to decorate package input signals intended for connection to the physical pads of the integrated circuit package.- Parameters:
width (int) – specifies the number of individual input wires within this port, each of which will correspond to a separate physical pad on the integrated circuit package.
kwargs (typing_extensions.Unpack[IOModelOptions])
- chipflow.platform.BidirIOSignature(width, **kwargs)
This creates an
Amaranth Signaturewhich is then used to decorate package bi-directional signals intended for connection to the physical pads of the integrated circuit package.- Parameters:
width (int) – specifies the number of individual input/output wires within this port. Each pair of input/output wires will correspond to a separate physical pad on the integrated circuit package.
kwargs (typing_extensions.Unpack[IOModelOptions])
- class chipflow.platform.JTAGSignature(**kwargs)
Bases:
amaranth.lib.wiring.SignatureDescription of an interface object.
An interface object is a Python object that has a
signatureattribute containing aSignatureobject, as well as an attribute for every member of its signature. Signatures and interface objects are tightly linked: an interface object can be created out of a signature, and the signature is used whenconnect()ing two interface objects together. See the introduction to interfaces for a more detailed explanation of why this is useful.Signaturecan be used as a base class to define customized signatures and interface objects.Warning
Signatureobjects are immutable. Classes inheriting fromSignaturemust ensure this remains the case when additional functionality is added.- Parameters:
kwargs (typing_extensions.Unpack[chipflow.platform.io.iosignature.IOModelOptions])
- class chipflow.platform.SPISignature(**kwargs)
Bases:
amaranth.lib.wiring.SignatureDescription of an interface object.
An interface object is a Python object that has a
signatureattribute containing aSignatureobject, as well as an attribute for every member of its signature. Signatures and interface objects are tightly linked: an interface object can be created out of a signature, and the signature is used whenconnect()ing two interface objects together. See the introduction to interfaces for a more detailed explanation of why this is useful.Signaturecan be used as a base class to define customized signatures and interface objects.Warning
Signatureobjects are immutable. Classes inheriting fromSignaturemust ensure this remains the case when additional functionality is added.- Parameters:
kwargs (typing_extensions.Unpack[chipflow.platform.io.iosignature.IOModelOptions])
- class chipflow.platform.I2CSignature(**kwargs)
Bases:
amaranth.lib.wiring.SignatureDescription of an interface object.
An interface object is a Python object that has a
signatureattribute containing aSignatureobject, as well as an attribute for every member of its signature. Signatures and interface objects are tightly linked: an interface object can be created out of a signature, and the signature is used whenconnect()ing two interface objects together. See the introduction to interfaces for a more detailed explanation of why this is useful.Signaturecan be used as a base class to define customized signatures and interface objects.Warning
Signatureobjects are immutable. Classes inheriting fromSignaturemust ensure this remains the case when additional functionality is added.- Parameters:
kwargs (typing_extensions.Unpack[chipflow.platform.io.iosignature.IOModelOptions])
- class chipflow.platform.UARTSignature(**kwargs)
Bases:
amaranth.lib.wiring.SignatureDescription of an interface object.
An interface object is a Python object that has a
signatureattribute containing aSignatureobject, as well as an attribute for every member of its signature. Signatures and interface objects are tightly linked: an interface object can be created out of a signature, and the signature is used whenconnect()ing two interface objects together. See the introduction to interfaces for a more detailed explanation of why this is useful.Signaturecan be used as a base class to define customized signatures and interface objects.Warning
Signatureobjects are immutable. Classes inheriting fromSignaturemust ensure this remains the case when additional functionality is added.- Parameters:
kwargs (typing_extensions.Unpack[chipflow.platform.io.iosignature.IOModelOptions])
- class chipflow.platform.GPIOSignature(pin_count=1, **kwargs)
Bases:
amaranth.lib.wiring.SignatureDescription of an interface object.
An interface object is a Python object that has a
signatureattribute containing aSignatureobject, as well as an attribute for every member of its signature. Signatures and interface objects are tightly linked: an interface object can be created out of a signature, and the signature is used whenconnect()ing two interface objects together. See the introduction to interfaces for a more detailed explanation of why this is useful.Signaturecan be used as a base class to define customized signatures and interface objects.Warning
Signatureobjects are immutable. Classes inheriting fromSignaturemust ensure this remains the case when additional functionality is added.- Parameters:
kwargs (typing_extensions.Unpack[chipflow.platform.io.iosignature.IOModelOptions])
- class chipflow.platform.QSPIFlashSignature(**kwargs)
Bases:
amaranth.lib.wiring.SignatureDescription of an interface object.
An interface object is a Python object that has a
signatureattribute containing aSignatureobject, as well as an attribute for every member of its signature. Signatures and interface objects are tightly linked: an interface object can be created out of a signature, and the signature is used whenconnect()ing two interface objects together. See the introduction to interfaces for a more detailed explanation of why this is useful.Signaturecan be used as a base class to define customized signatures and interface objects.Warning
Signatureobjects are immutable. Classes inheriting fromSignaturemust ensure this remains the case when additional functionality is added.- Parameters:
kwargs (typing_extensions.Unpack[chipflow.platform.io.iosignature.IOModelOptions])
- class chipflow.platform.SoftwareDriverSignature(members, **kwargs)
Bases:
amaranth.lib.wiring.SignatureDescription of an interface object.
An interface object is a Python object that has a
signatureattribute containing aSignatureobject, as well as an attribute for every member of its signature. Signatures and interface objects are tightly linked: an interface object can be created out of a signature, and the signature is used whenconnect()ing two interface objects together. See the introduction to interfaces for a more detailed explanation of why this is useful.Signaturecan be used as a base class to define customized signatures and interface objects.Warning
Signatureobjects are immutable. Classes inheriting fromSignaturemust ensure this remains the case when additional functionality is added.- Parameters:
kwargs (typing_extensions.Unpack[DriverModel])
- class chipflow.platform.SoftwareBuild(*, sources, includes=[], include_dirs=[], offset=0)
This holds the information needed for building software and providing the built outcome
- Parameters:
sources (list[pathlib.Path])
includes (list[pathlib.Path])
- class chipflow.platform.Sky130DriveMode
Bases:
enum.StrEnumModels the potential drive modes of an SkyWater 130 IO cell [sky130_fd_io__gpiov2](https://skywater-pdk.readthedocs.io/en/main/contents/libraries/sky130_fd_io/docs/user_guide.html) These are both statically configurable and can be set at runtime on the :py:mod:drive_mode.Sky130Port lines on the port.
- class chipflow.platform.StepBase(config={})
Bases:
abc.ABCBase class for ChipFlow build steps.
- build_cli_parser(parser)
Build the cli parser for this step
- run_cli(args)
Called when this step’s is used from chipflow command
- build(*args)
builds the design
- chipflow.platform.setup_amaranth_tools()
Configure environment for Amaranth/WASM tools.
- chipflow.platform.top_components(config)
Return the top level components for the design, as configured in
chipflow.toml.- Args:
config: The parsed chipflow configuration
- Returns:
Dictionary mapping component names to instantiated Component objects
- Raises:
ChipFlowError: If component references are invalid or instantiation fails
- Parameters:
config (chipflow.config.models.Config)
- Return type:
Dict[str, amaranth.lib.wiring.Component]