Netlist Serializer
HAL Netlist Serializer functions.
- hal_py.NetlistSerializer.deserialize_from_file(hal_file: os.PathLike, gate_lib: hal_py.GateLibrary = None) hal_py.Netlist
Deserializes a netlist from a
.hal
file using the provided gate library. If no gate library is provided, a gate library path must be specified within the.hal
file.- Parameters
hal_file (pathlib.Path) – The path to the
.hal
file.gate_lib (hal_py.GateLibrary) – The gate library. Defaults to
None
.
- Returns
The deserialized netlist on success,
None
otherwise.- Return type
- hal_py.NetlistSerializer.deserialize_from_string(hal_string: str, gate_lib: hal_py.GateLibrary = None) hal_py.Netlist
Deserializes a string which contains a netlist in HAL-(JSON)-format using the provided gate library. If no gate library is provided, a gate library path must be specified within the
.hal
file.- Parameters
hal_file (pathlib.Path) – The string containing the netlist in HAL-(JSON)-format.
gate_lib (hal_py.GateLibrary) – The gate library. Defaults to
None
.
- Returns
The deserialized netlist on success,
None
otherwise.- Return type
- hal_py.NetlistSerializer.serialize_to_file(netlist: hal_py.Netlist, hal_file: os.PathLike) bool
Serializes a netlist into a
.hal
file.- Parameters
netlist (hal_py.Netlist) – The netlist to serialize.
hal_file (pathlib.Path) – The path to the
.hal
file.
- Returns
True
on success,False
otherwise.- Return type