chipflow.platform.io.signatures
Common interface signatures for ChipFlow platforms.
Classes
Simulation interface metadata for ChipFlow components. |
|
Base class for protocol classes. |
|
This holds the information needed for building software and providing the built outcome |
|
This holds the information needed for building software and providing the built outcome |
|
Container for data associated with a ChipFlow component. |
|
Options for |
|
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. |
Functions
|
Decorator for creating simulatable interface signatures. |
Module Contents
- class chipflow.platform.io.signatures.SimInterface
Bases:
typing_extensions.TypedDictSimulation interface metadata for ChipFlow components.
- Attributes:
uid: Unique identifier for the interface. parameters: List of (name, value) tuples for interface parameters.
- class chipflow.platform.io.signatures.DataclassProtocol
Bases:
ProtocolBase class for protocol classes.
Protocol classes are defined as:
class Proto(Protocol): def meth(self) -> int: ...
Such classes are primarily used with static type checkers that recognize structural subtyping (static duck-typing).
For example:
class C: def meth(self) -> int: return 0 def func(x: Proto) -> int: return x.meth() func(C()) # Passes static type check
See PEP 544 for details. Protocol classes decorated with @typing.runtime_checkable act as simple-minded runtime protocols that check only the presence of given attributes, ignoring their type signatures. Protocol classes can be generic, they are defined as:
class GenProto[T](Protocol): def meth(self) -> T: ...
- class chipflow.platform.io.signatures.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.io.signatures.BinaryData(*, filename, offset=0)
This holds the information needed for building software and providing the built outcome
- Parameters:
filename (pathlib.Path)
- class chipflow.platform.io.signatures.Data
Bases:
typing_extensions.TypedDict,Generic[_T_DataClass]Container for data associated with a ChipFlow component.
- Attributes:
data: The dataclass instance containing component data.
- class chipflow.platform.io.signatures.DriverModel
Bases:
typing_extensions.TypedDictOptions for
SoftwareDriverSignature.- Attributes:
component: The
wiring.Componentthat this is the signature for. regs_struct: The name of the C struct that represents the registers of this component. h_files: Header files for the driver. c_files: C files for the driver. regs_bus: The bus of thisComponentwhich contains its control registers. include_dirs: Any extra include directories needed by the driver.
- chipflow.platform.io.signatures.simulatable_interface(base='com.chipflow.chipflow')
Decorator for creating simulatable interface signatures.
The decorated class will have a
__chipflow_parameters__method that returns a list of tuples (name, value). It is expected that a model that takes parameters is implemented as a template, with the parameters in the order given.- Args:
base: Base UID string for the interface (default: “com.chipflow.chipflow”).
- Returns:
A decorator function that adds chipflow annotation support to a class.
- class chipflow.platform.io.signatures.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.io.signatures.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.io.signatures.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.io.signatures.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.io.signatures.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.io.signatures.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.io.signatures.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])