Netlist

class hal_py.netlist
create_gate(*args, **kwargs)

Overloaded function.

  1. create_gate(self: hal_py.netlist, id: int, gate_type: str, name: str) -> gate

Creates and adds a new gate to the netlist.

Parameters:
  • id (int) – The unique ID != 0 for the new gate.
  • gate_type (str) – The gate type.
  • name (str) – A name for the gate.
Returns:

The new gate on success, None on error.

Return type:

hal_py.gate or None

  1. create_gate(self: hal_py.netlist, gate_type: str, name: str) -> gate

Creates and adds a new gate to the netlist. It is identifiable via its unique ID which is automatically set to the next free ID.

Parameters:
  • gate_type (str) – The gate type.
  • name (str) – A name for the gate.
Returns:

The new gate on success, None on error.

Return type:

hal_py.gate or None

create_module(*args, **kwargs)

Overloaded function.

  1. create_module(self: hal_py.netlist, id: int, name: str, parent: module) -> module

Creates and adds a new module to the netlist. It is identifiable via its unique id.

Parameters:
  • id (int) – The unique id != 0 for the new module.
  • name (str) – A name for the module.
  • parent (hal_py.module) – The parent module.
Returns:

The new module on succes, None on error.

Return type:

hal_py.module or None

  1. create_module(self: hal_py.netlist, name: str, parent: module) -> module

Creates and adds a new module to the netlist. It is identifiable via its unique ID which is automatically set to the next free ID.

Parameters:
  • name (str) – A name for the module.
  • parent (hal_py.module) – The parent module.
Returns:

The new module on succes, None on error.

Return type:

hal_py.module or None

create_net(*args, **kwargs)

Overloaded function.

  1. create_net(self: hal_py.netlist, id: int, name: str) -> net

Creates and adds a new net to the netlist. It is identifiable via its unique id.

Parameters:
  • id (int) – The unique id != 0 for the new net.
  • name – A name for the net.
Returns:

The new net on success, None on error.

Return type:

hal_py.net or None

  1. create_net(self: hal_py.netlist, name: str) -> net

Creates and adds a new net to the netlist. It is identifiable via its unique ID which is automatically set to the next free ID.

Parameters:name – A name for the net.
Returns:The new net on success, None on error.
Return type:hal_py.net or None
delete_gate(self: hal_py.netlist, gate: gate) → bool

Removes a gate from the netlist.

Parameters:gate (hal_py.gate) – The gate to be removed.
Returns:True on success.
Return type:bool
delete_module(self: hal_py.netlist, module: module) → bool

Removes a module from the netlist.

Parameters:module (hal_py.module) – The module to be removed.
Returns:True on success.
Return type:bool
delete_net(self: hal_py.netlist, net: net) → bool

Removes a net from the netlist.

Parameters:net (hal_py.net) – The net to be removed.
Returns:True on success.
Return type:bool
design_name

The design’s name.

Type:str
device_name

Hardware device’s name.

Type:str
gates

Get all gates of the netlist.

Returns:A set of gates.
Return type:set(hal_py.gate)
get_design_name(self: hal_py.netlist) → str

Get the design name.

Returns:The design name.
Return type:str
get_device_name(self: hal_py.netlist) → str

Get the name of the hardware device if specified.

Returns:The target device name.
Return type:str
get_gate_by_id(self: hal_py.netlist, gate_id: int) → gate

Get a gate specified by id.

Parameters:gate_id (int) – The gate’s id.
Returns:The gate or None.
Return type:hal_py.gate or None
get_gate_library(self: hal_py.netlist) → hal_py.gate_library

Get the gate library associated with the netlist.

Returns:The gate library.
Return type:hal_py.gate_library
get_gates(self: hal_py.netlist, gate_type_filter: str='__DONT_CARE__', name_filter: str='__DONT_CARE__') → Set[gate]

Get all gates of the netlist. You can filter the set before output with the optional parameters.

Parameters:
  • gate_type_filter (str) – Filter for the gate type.
  • name_filter (str) – Filter for the name.
Returns:

A set of gates.

Return type:

set(hal_py.gate)

get_global_gnd_gates(self: hal_py.netlist) → Set[gate]

Get all global gnd gates.

Returns:A set of gates.
Return type:set(hal_py.gate)
get_global_inout_nets(self: hal_py.netlist) → Set[net]

Get all global inout nets.

Returns:A set of nets.
Return type:set(hal_py.net)
get_global_input_nets(self: hal_py.netlist) → Set[net]

Get all global input nets.

Returns:A set of nets.
Return type:set(hal_py.net)
get_global_output_nets(self: hal_py.netlist) → Set[net]

Get all global output nets.

Returns:A set of nets.
Return type:set(hal_py.net)
get_global_vcc_gates(self: hal_py.netlist) → Set[gate]

Get all global vcc gates.

Returns:A set of gates.
Return type:set(hal_py.gate)
get_id(self: hal_py.netlist) → int

Get the netlist’s id. If not changed via set_id() the id is zero.

Returns:The netlist’s id.
Return type:int
get_inout_pin_types(self: hal_py.netlist, gate_type: str) → List[str]

Get the inout pin types for a gate type.

Parameters:gate_type (str) – The gate type.
Returns:A List of all inout pin types.
Return type:list(str)
get_input_filename(self: hal_py.netlist) → hal_py.hal_path

Get the file name of the input design.

Returns:The input file’s name.
Return type:hal_py.hal_path
get_input_pin_types(self: hal_py.netlist, gate_type: str) → List[str]

Get the input pin types for a gate type.

Parameters:gate_type (str) – The gate type.
Returns:A List of all input pin types.
Return type:list(str)
get_module_by_id(self: hal_py.netlist, id: int) → module

Get a single module specified by its id.

Parameters:id (int) – The module id.
Returns:The module.
Return type:hal_py.module
get_modules(self: hal_py.netlist) → Set[module]

Get all modules of the netlist. The top module is included!

Returns:A set of modules.
Return type:set(hal_py.module)
get_net_by_id(self: hal_py.netlist, net_id: int) → net

Get a net specified by id.

Parameters:net_id (int) – The net’s id.
Returns:The net or None.
Return type:hal_py.net or None
get_nets(self: hal_py.netlist, name_filter: str='__DONT_CARE__') → Set[net]

Get all nets of the netlist. You can filter the set before output with the optional parameters.

Parameters:name_filter (str) – Filter for the name.
Returns:A set of nets.
Return type:set(hal_py.net)
get_output_pin_types(self: hal_py.netlist, gate_type: str) → List[str]

Get the output pin types for a gate type.

Parameters:gate_type (str) – The gate type.
Returns:A List of all output pin types.
Return type:list(str)
get_top_module(self: hal_py.netlist) → module

Get the top module of the netlist.

Returns:The top module.
Return type:hal_py.module
get_unique_gate_id(self: hal_py.netlist) → int

Gets an unoccupied gate id. The value 0 is reserved and represents an invalid id.

Returns:An unoccupied unique id.
Return type:int
get_unique_module_id(self: hal_py.netlist) → int

Gets an unoccupied module id. The value of 0 is reserved and represents an invalid id.

Returns:An unoccupied id.
Return type:int
get_unique_net_id(self: hal_py.netlist) → int

Gets an unoccupied net id. The value 0 is reserved and represents an invalid id.

Returns:An unoccupied unique id.
Return type:int
global_gnd_gates

Get all global gnd gates.

Returns:A set of gates.
Return type:set(hal_py.gate)
global_inout_nets

Get all global inout nets.

Returns:A set of nets.
Return type:set(hal_py.net)
global_input_nets

Get all global input nets.

Returns:A set of nets.
Return type:set(hal_py.net)
global_output_nets

Get all global output nets.

Returns:A set of nets.
Return type:set(hal_py.net)
global_vcc_gates

Get all global vcc gates.

Returns:A set of gates.
Return type:set(hal_py.gate)
id

The netlist’s id. If not changed via set_id() the id is zero.

Type:int
input_filename

The file name of the input design.

Type:str
is_gate_in_netlist(self: hal_py.netlist, gate: gate) → bool

Check wether a gate is registered in the netlist.

Parameters:gate (hal_py.gate) – The gate to check.
Returns:True if the gate is in netlist.
Return type:bool
is_global_gnd_gate(self: hal_py.netlist, gate: gate) → bool

Checks whether a gate is a global gnd gate.

Parameters:gate (hal_py.gate) – The gate to check.
Returns:True if the gate is a global gnd gate.
Return type:bool
is_global_inout_net(self: hal_py.netlist, net: net) → bool

Checks wether a net is a global inout net.

Parameters:net (hal_py.net) – The net to check.
Returns:True if the net is a global inout net.
Return type:bool
is_global_input_net(self: hal_py.netlist, net: net) → bool

Checks wether a net is a global input net.

Parameters:net (hal_py.net) – The net to check.
Returns:True if the net is a global input net.
Return type:bool
is_global_output_net(self: hal_py.netlist, net: net) → bool

Checks wether a net is a global output net.

Parameters:net (hal_py.net) – The net to check.
Returns:True if the net is a global output net.
Return type:bool
is_global_vcc_gate(self: hal_py.netlist, gate: gate) → bool

Checks whether a gate is a global vcc gate.

Parameters:gate (hal_py.gate) – The gate to check.
Returns:True if the gate is a global vcc gate.
Return type:bool
is_module_in_netlist(self: hal_py.netlist, module: module) → bool

Checks whether a module is registered in the netlist.

Parameters:module (hal_py.module) – THe module to check.
Returns:True if the module is in netlist.
Return type:bool
is_net_in_netlist(self: hal_py.netlist, net: net) → bool

Checks whether a net is registered in the netlist.

Parameters:net (hal_py.net) – The net to check.
Returns:True if the net is in netlist.
Return type:bool
mark_global_gnd_gate(self: hal_py.netlist, gate: gate) → bool

Mark a gate as global gnd gate.

Parameters:gate (hal_py.gate) – The new gate.
Returns:True on success.
Return type:bool
mark_global_inout_net(self: hal_py.netlist, net: net) → bool

Mark a net as a global inout net.

Parameters:net (hal_py.net) – The net.
Returns:True on success.
Return type:bool
mark_global_input_net(self: hal_py.netlist, net: net) → bool

Mark a net as a global input net.

Parameters:net (hal_py.net) – The net.
Returns:True on success.
Return type:bool
mark_global_output_net(self: hal_py.netlist, net: net) → bool

Mark a net as a global output net.

Parameters:net (hal_py.net) – The net.
Returns:True on success.
Return type:bool
mark_global_vcc_gate(self: hal_py.netlist, gate: gate) → bool

Mark a gate as global vcc gate.

Parameters:gate (hal_py.gate) – The new gate.
Returns:True on success.
Return type:bool
modules

Get all modules of the netlist.

Returns:A set of modules.
Return type:set(hal_py.module)
nets

Get all nets of the netlist.

Returns:A set of nets.
Return type:set(hal_py.net)
set_design_name(self: hal_py.netlist, design_name: str) → None

Sets the design name.

Parameters:design_name (str) – New design name.
set_device_name(self: hal_py.netlist, device_name: str) → None

Set the name of the target hardware device.

Parameters:divice_name (str) – Name of hardware device.
set_id(self: hal_py.netlist, id: int) → None

Sets the netlist id to a new value.

Parameters:id (int) – The new netlist id.
set_input_filename(self: hal_py.netlist, input_filename: hal_py.hal_path) → None

Set the file name of the input design.

Parameters:input_filename (hal_py.hal_path) – The path to the input file.
unmark_global_gnd_gate(self: hal_py.netlist, gate: gate) → bool

Unmark a global gnd gate.

Parameters:gate (hal_py.gate) – The new gate.
Returns:True on success.
Return type:bool
unmark_global_inout_net(self: hal_py.netlist, net: net) → bool

Unmark a global inout net.

Parameters:net (hal_py.net) – The net.
Returns:True on success.
Return type:bool
unmark_global_input_net(self: hal_py.netlist, net: net) → bool

Unmark a global input net.

Parameters:net (hal_py.net) – The net.
Returns:True on success.
Return type:bool
unmark_global_output_net(self: hal_py.netlist, net: net) → bool

Unmark a global output net.

Parameters:net (hal_py.net) – The net.
Returns:True on success.
Return type:bool
unmark_global_vcc_gate(self: hal_py.netlist, gate: gate) → bool

Unmark a global vcc gate.

Parameters:gate (hal_py.gate) – The new gate.
Return type:bool