Yosys Netlist¶
The classes in digsim.utils read a Yosys JSON netlist, for example to build a
YosysComponent from it:
from digsim.utils import YosysNetlist
netlist = YosysNetlist(**synthesis.synth_to_dict())
counter.create_from_netlist(netlist)
YosysNetlist
¶
A Yosys JSON netlist, read with YosysNetlist(**netlist_dict). Only the parts that DigSim uses are kept.
modules
class-attribute
instance-attribute
¶
modules: dict[str, YosysModule] = Field(
default_factory=dict
)
YosysModule
¶
A module of a netlist: its ports and cells
ports
class-attribute
instance-attribute
¶
ports: dict[str, YosysPort] = Field(default_factory=dict)
cells
class-attribute
instance-attribute
¶
cells: dict[str, YosysCell] = Field(default_factory=dict)
is_same_interface
¶
is_same_interface(netlist: YosysModule) -> bool
Same port names, with the same directions and bitwidths
YosysPort
¶
YosysCell
¶
A cell (a gate or flip-flop) of a module, and the nets its ports connect to