|
SILICON
|
Mutable module-building interface passed to component serializers. More...
#include <netlist.hpp>
Classes | |
| struct | Impl |
Public Member Functions | |
| Json | bits (const core::Bus &bus, std::string_view nullValue="x") const |
| Convert a Silicon bus to a Yosys least-significant-bit-first vector. | |
| Json | inputBits (const core::Component &component, std::size_t index, std::size_t expectedWidth) const |
| Encode a component input, applying its declared unconnected-input default. | |
| Json | allocateBits (std::size_t width) |
| Allocate module-local temporary signal bits. | |
| std::string | componentIdentifier () const |
| Stable name of the component being serialized within its module. | |
| void | addCell (std::string_view suffix, std::string_view type, Json parameters, Json portDirections, Json connections, Json attributes=Json::object()) |
| Emit one native Yosys cell for the current Silicon component. | |
| void | addPort (std::string name, std::string_view direction, const core::Bus &bus) |
| Register a named top-level input or output port. | |
| void | addSubcircuitInstance (std::string_view slug, const std::vector< core::Bus > &inputs, const std::vector< core::Bus > &outputs, const core::CircuitResolver *resolver) |
| Emit a hierarchical instance and recursively serialize its definition. | |
| SerializationContext (Impl &impl) | |
Static Public Member Functions | |
| static Json | concatenate (const std::vector< Json > &vectors) |
| Concatenate bit vectors in their existing LSB-first order. | |
| static std::string | parameter (std::uint64_t value, std::size_t width=32) |
| Encode an unsigned Yosys parameter as a fixed-width binary string. | |
Private Attributes | |
| Impl & | impl |
Friends | |
| std::string | serialize (const core::Circuit &circuit, std::string_view moduleName) |
| Serialize a complete Silicon circuit as Yosys write_json-compatible JSON. | |
Mutable module-building interface passed to component serializers.
Components use this context to translate their logical behavior into native Yosys cells. Signal numbering, port netnames, and recursive module construction remain owned by the circuit-level serializer.
Definition at line 174 of file netlist.hpp.
|
inlineexplicit |
Definition at line 215 of file netlist.hpp.
| void addCell | ( | std::string_view | suffix, |
| std::string_view | type, | ||
| Json | parameters, | ||
| Json | portDirections, | ||
| Json | connections, | ||
| Json | attributes = Json::object() ) |
Emit one native Yosys cell for the current Silicon component.
Definition at line 346 of file netlist.cpp.
| void addPort | ( | std::string | name, |
| std::string_view | direction, | ||
| const core::Bus & | bus ) |
Register a named top-level input or output port.
Definition at line 402 of file netlist.cpp.
| void addSubcircuitInstance | ( | std::string_view | slug, |
| const std::vector< core::Bus > & | inputs, | ||
| const std::vector< core::Bus > & | outputs, | ||
| const core::CircuitResolver * | resolver ) |
Emit a hierarchical instance and recursively serialize its definition.
Definition at line 415 of file netlist.cpp.
|
nodiscard |
Allocate module-local temporary signal bits.
Definition at line 314 of file netlist.cpp.
Convert a Silicon bus to a Yosys least-significant-bit-first vector.
Definition at line 276 of file netlist.cpp.
|
nodiscard |
Stable name of the component being serialized within its module.
Definition at line 341 of file netlist.cpp.
Concatenate bit vectors in their existing LSB-first order.
Definition at line 322 of file netlist.cpp.
|
nodiscard |
Encode a component input, applying its declared unconnected-input default.
| component | Component that owns the input |
| index | Input bus index |
| expectedWidth | Required bus width |
Definition at line 290 of file netlist.cpp.
|
staticnodiscard |
Encode an unsigned Yosys parameter as a fixed-width binary string.
Definition at line 331 of file netlist.cpp.
|
friend |
Serialize a complete Silicon circuit as Yosys write_json-compatible JSON.
| circuit | The circuit to serialize. |
| moduleName | The Yosys module name to assign to the top-level circuit. The circuit itself owns no name; the caller supplies one (e.g. derived from the project document slug). |
Definition at line 443 of file netlist.cpp.
|
private |
Definition at line 218 of file netlist.hpp.