Netlist Factory

hal_py.NetlistFactory.create_netlist(gate_library: hal_py.GateLibrary) hal_py.Netlist

Create a new empty netlist using the specified gate library.

Parameters

gate_library (hal_py.GateLibrary) – The gate library.

Returns

The netlist on success, None otherwise.

Return type

hal_py.Netlist or None

hal_py.NetlistFactory.load_hal_project(project_dir: os.PathLike) hal_py.Netlist

Create a netlist using information specified in command line arguments on startup. Will either deserialize .hal file or call parser plugin for other formats.

Parameters

project_dir (pathlib.Path) – Path to the hal project directory.

Returns

The netlist on success, None otherwise.

Return type

hal_py.Netlist or None

hal_py.NetlistFactory.load_netlist(*args, **kwargs)

Overloaded function.

  1. load_netlist(netlist_file: os.PathLike, gate_library_file: os.PathLike = PosixPath(‘.’)) -> hal_py.Netlist

    Create a netlist from the given file using the specified gate library file. Will either deserialize .hal file or call parser plugin for other formats. In the latter case the specified gate library file is mandatory.

    param pathlib.Path netlist_file

    Path to the file.

    param pathlib.Path gate_library_file

    Path to the gate library file.

    returns

    The netlist on success, None otherwise.

    rtype

    hal_py.Netlist or None

  2. load_netlist(netlist_file: os.PathLike, gate_library: hal_py.GateLibrary) -> hal_py.Netlist

    Create a netlist from the given file trying to parse it with the specified gate library. Will either deserialize .hal file or call parser plugin for other formats.

    param pathlib.Path netlist_file

    Path to the file.

    param hal_py.GateLibrary gate_library_file

    Path to the gate library file.

    returns

    The netlist on success, None otherwise.

    rtype

    hal_py.Netlist or None

hal_py.NetlistFactory.load_netlist_from_string(hdl_string: str, gate_library_file: os.PathLike = '') hal_py.Netlist

Create a netlist from the given string. The string must contain a netlist in HAL-(JSON)-format.

Parameters
  • netlist_file (pathlib.Path) – The string containing the netlist.

  • gate_library_file (pathlib.Path) – Path to the gate library file.

Returns

The netlist on success, None otherwise.

Return type

hal_py.Netlist or None

hal_py.NetlistFactory.load_netlists(netlist_file: os.PathLike) List[hal_py.Netlist]

Create a netlist from a given file for each matching pre-loaded gate library.

Parameters

netlist_file (pathlib.Path) – Path to the netlist file.

Returns

A list of netlists, one for each suitable gate library.

Return type

list[hal_py.Netlist]