Subgraph Netlist Decorator
- class hal_py.SubgraphNetlistDecorator
- __init__(self: hal_py.SubgraphNetlistDecorator, netlist: hal_py.Netlist) None
Construct new SubgraphNetlistDecorator object.
- Parameters
netlist (hal_py.Netlist) – The netlist to operate on.
- copy_subgraph_netlist(*args, **kwargs)
Overloaded function.
copy_subgraph_netlist(self: hal_py.SubgraphNetlistDecorator, subgraph_gates: List[hal_py.Gate], all_global_io: bool = False) -> hal_py.Netlist
Get a deep copy of a netlist subgraph including all of its gates and nets, but excluding modules and groupings.
- param list[hal_py.Gate] subgraph_gates
The gates making up the subgraph that shall be copied from the netlist.
- param bool all_global_io
Set
True
to mark all nets as global input or output that lost at least one source or destination in the copied netlist,False
to only mark them if all sources or destinations were removed. Global inputs and outputs of the parent netlist will always also be annotated as global inputs or outputs. Defaults toFalse
.- returns
The copied subgraph netlist on success, None otherwise.
- rtype
hal_py.Netlist or None
copy_subgraph_netlist(self: hal_py.SubgraphNetlistDecorator, subgraph_module: hal_py.Module, all_global_io: bool = False) -> hal_py.Netlist
Get a deep copy of a netlist subgraph including all of its gates and nets, but excluding modules and groupings.
- param hal_py.Module subgraph_module
The module making up the subgraph that shall be copied from the netlist.
- param bool all_global_io
Set
True
to mark all nets as global input or output that lost at least one source or destination in the copied netlist,False
to only mark them if all sources or destinations were removed. Global inputs and outputs of the parent netlist will always also be annotated as global inputs or outputs. Defaults toFalse
.- returns
The copied subgraph netlist on success, None otherwise.
- rtype
hal_py.Netlist or None
- get_subgraph_function(*args, **kwargs)
Overloaded function.
get_subgraph_function(self: hal_py.SubgraphNetlistDecorator, subgraph_gates: List[hal_py.Gate], subgraph_output: hal_py.Net, cache: Dict[Tuple[int, hal_py.GatePin], hal_py.BooleanFunction]) -> Optional[hal_py.BooleanFunction]
Get the combined Boolean function of a subgraph of combinational gates starting at the source of the provided subgraph output net. The variables of the resulting Boolean function are created from the subgraph input nets using ‘BooleanFunctionNetDecorator.get_boolean_variable’. Utilizes a cache for speedup on consecutive calls.
- param list[hal_py.Gate] subgraph_gates
The gates making up the subgraph to consider.
- param hal_py.Net subgraph_output
The subgraph oputput net for which to generate the Boolean function.
- param dict[tuple(int,hal_py.GatePin),hal_py.BooleanFunction] cache
Cache to speed up computations. The cache is filled by this function.
- returns
The combined Boolean function of the subgraph on success, None otherwise.
- rtype
hal_py.BooleanFunction or None
get_subgraph_function(self: hal_py.SubgraphNetlistDecorator, subgraph_gates: List[hal_py.Gate], subgraph_output: hal_py.Net) -> Optional[hal_py.BooleanFunction]
Get the combined Boolean function of a subgraph of combinational gates starting at the source of the provided subgraph output net. The variables of the resulting Boolean function are created from the subgraph input nets using ‘BooleanFunctionNetDecorator.get_boolean_variable’.
- param list[hal_py.Gate] subgraph_gates
The gates making up the subgraph to consider.
- param hal_py.Net subgraph_output
The subgraph oputput net for which to generate the Boolean function.
- returns
The combined Boolean function of the subgraph on success, None otherwise.
- rtype
hal_py.BooleanFunction or None
get_subgraph_function(self: hal_py.SubgraphNetlistDecorator, subgraph_module: hal_py.Module, subgraph_output: hal_py.Net, cache: Dict[Tuple[int, hal_py.GatePin], hal_py.BooleanFunction]) -> Optional[hal_py.BooleanFunction]
Get the combined Boolean function of a subgraph of combinational gates starting at the source of the provided subgraph output net. The variables of the resulting Boolean function are created from the subgraph input nets using ‘BooleanFunctionNetDecorator.get_boolean_variable’. Utilizes a cache for speedup on consecutive calls.
- param hal_py.Module subgraph_module
The module making up the subgraph to consider.
- param hal_py.Net subgraph_output
The subgraph oputput net for which to generate the Boolean function.
- param dict[tuple(int,hal_py.GatePin),hal_py.BooleanFunction] cache
Cache to speed up computations. The cache is filled by this function.
- returns
The combined Boolean function of the subgraph on success, None otherwise.
- rtype
hal_py.BooleanFunction or None
get_subgraph_function(self: hal_py.SubgraphNetlistDecorator, subgraph_module: hal_py.Module, subgraph_output: hal_py.Net) -> Optional[hal_py.BooleanFunction]
Get the combined Boolean function of a subgraph of combinational gates starting at the source of the provided subgraph output net. The variables of the resulting Boolean function are created from the subgraph input nets using ‘BooleanFunctionNetDecorator.get_boolean_variable’.
:param hal_py.Module subgraph_module:The module making up the subgraph to consider. :param hal_py.Net subgraph_output: The subgraph oputput net for which to generate the Boolean function. :returns: The combined Boolean function of the subgraph on success, None otherwise. :rtype: hal_py.BooleanFunction or None
- get_subgraph_function_inputs(*args, **kwargs)
Overloaded function.
get_subgraph_function_inputs(self: hal_py.SubgraphNetlistDecorator, subgraph_gates: List[hal_py.Gate], subgraph_output: hal_py.Net) -> Optional[Set[hal_py.Net]]
Get the inputs of the combined Boolean function of a subgraph of combinational gates starting at the source of the provided subgraph output net. This does not actually build the boolean function but only determines the inputs the subgraph function would have, which is a lot faster.
- param list[hal_py.Gate] subgraph_gates
The subgraph_gates making up the subgraph to consider.
- param hal_py.Net subgraph_output
The subgraph oputput net from which to start the back propagation from.
- returns
The input nets that would be the input for the subgraph function
- rtype
set(hal_py.Net) or None
get_subgraph_function_inputs(self: hal_py.SubgraphNetlistDecorator, subgraph_module: hal_py.Module, subgraph_output: hal_py.Net) -> Optional[Set[hal_py.Net]]
Get the inputs of the combined Boolean function of a subgraph of combinational gates starting at the source of the provided subgraph output net. This does not actually build the boolean function but only determines the inputs the subgraph function would have, which is a lot faster.
:param hal_py.Module subgraph_module:The module making up the subgraph to consider. :param hal_py.Net subgraph_output: The subgraph oputput net from which to start the back propagation from. :returns: The input nets that would be the input for the subgraph function :rtype: set(hal_py.Net) or None