Netlist Preprocessing

class netlist_preprocessing.NetlistPreprocessingPlugin
static decompose_gate(nl: hal_py.Netlist, g: hal_py.Gate, delete_gate: bool = True) → bool

Builds the Boolean function of each output pin of the gate and constructs a gate tree implementing it. Afterwards the original output net is connected to the built gate tree and the gate is deleted if the ‘delete_gate’ flag is set.

For the decomposition we currently only support the base operands AND, OR, INVERT. The function searches in the gate library for a fitting two input gate and uses a standard HAL gate type if none is found.

Parameters:
  • nl (hal_py.Netlist) – The netlist to operate on.
  • gate (hal_py.Gate) – The gate to decompose.
  • delete_gate (bool) – Determines whether the original gate gets deleted by the function, defaults to True.
Returns:

True on success, False otherwise.

Return type:

bool

static decompose_gates_of_type(nl: hal_py.Netlist, gate_types: List[hal_py.GateType]) → Optional[int]

Decomposes each gate of the specified type by building the Boolean function for each output pin of the gate and contructing a gate tree implementing it. Afterwards the original gate is deleted and the output net is connected to the built gate tree.

For the decomposition we currently only support the base operands AND, OR, INVERT. The function searches in the gate library for a fitting two input gate and uses a standard HAL gate type if none is found.

Parameters:
Returns:

The number of decomposed gates on success, None otherwise.

Return type:

int or None

get_name(self: netlist_preprocessing.NetlistPreprocessingPlugin) → str

Get the name of the plugin.

Returns:Plugin name.
Return type:str
get_version(self: netlist_preprocessing.NetlistPreprocessingPlugin) → str

Get the version of the plugin.

Returns:Plugin version.
Return type:str
name

The name of the plugin.

Type:str
static parse_def_file(nl: hal_py.Netlist, def_file: os.PathLike) → bool

Parses a design exchange format file and extracts the coordinated of a placed design for each component/gate. The extracted coordinates get annotated to the gates.

Parameters:
Returns:

True on success, False otherwise.

Return type:

bool

static reconstruct_indexed_ff_identifiers(nl: hal_py.Netlist) → Optional[int]

Tries to reconstruct a name and index for each flip flop that was part of a multibit wire in the verilog code. This is NOT a general netlist reverse engineering algorithm and ONLY works on synthesized netlists with names annotated by the synthesizer. This function mainly focuses netlists synthesized with yosys since yosys names the output wires of the flip flops but not the gate it self. We try to reconstruct name and index for each flip flop based on the name of its output nets.

Parameters:nl (hal_py.Netlist) – The netlist to operate on.
Returns:The number of reconstructed names on success, None otherwise.
Return type:int or None
static remove_buffers(nl: hal_py.Netlist) → Optional[int]

Removes buffer gates from the netlist and connect their fan-in to their fan-out nets. Considers all combinational gates and takes their inputs into account. For example, a 2-input AND gate with one input being connected to constant ‘1’ will also be removed.

Parameters:nl (hal_py.Netlist) – The netlist to operate on.
Returns:The number of removed buffers on success, None otherwise.
Return type:int or None
static remove_redundant_logic(nl: hal_py.Netlist) → Optional[int]

Removes redundant gates from the netlist, i.e., gates that are functionally equivalent and are connected to the same input nets.

Parameters:nl (hal_py.Netlist) – The netlist to operate on.
Returns:The number of removed gates on success, None otherwise.
Return type:int or None
static remove_unconnected_gates(nl: hal_py.Netlist) → Optional[int]

Removes gates which outputs are all unconnected and not a global output net.

Parameters:nl (hal_py.Netlist) – The netlist to operate on.
Returns:The number of removed gates on success, None otherwise.
Return type:int or None
static remove_unconnected_nets(nl: hal_py.Netlist) → Optional[int]

Remove nets which have no source and not destination.

Parameters:nl (hal_py.Netlist) – The netlist to operate on.
Returns:The number of removed nets on success, None otherwise.
Return type:int or None
static remove_unused_lut_inputs(nl: hal_py.Netlist) → Optional[int]

Removes all LUT fan-in endpoints that do not correspond to a variable within the Boolean function that determines the output of a gate.

Parameters:nl (hal_py.Netlist) – The netlist to operate on.
Returns:The number of removed LUT endpoints on success, None otherwise.
Return type:int or None
static simplify_lut_inits(nl: hal_py.Netlist) → Optional[int]

Replaces pins connected to GND/VCC with constants and simplifies the boolean function of a LUT by recomputing the INIT string.

Parameters:nl (hal_py.Netlist) – The netlist to operate on.
Returns:The number of simplified INIT strings on success, None otherwise.
Return type:int or None
version

The version of the plugin.

Type:str