Boolean Function Decorator
- class hal_py.BooleanFunctionDecorator
- __init__(self: hal_py.BooleanFunctionDecorator, bf: hal_py.BooleanFunction) None
Construct new BooleanFunctionDecorator object.
- Parameters
bf (hal_py.BooleanFunction) – The Booelan function to operate on.
- static get_boolean_function_from(*args, **kwargs)
Overloaded function.
get_boolean_function_from(functions: List[hal_py.BooleanFunction], extend_to_size: int = 0, sign_extend: bool = False, ascending: bool = True) -> Optional[hal_py.BooleanFunction]
Get the Boolean function that is the concatenation of Boolean functions. The Boolean function can optionally be extended to any desired size greater the size of the given net vector.
- param list[hal_py.BooleanFunction] functions
The Boolean functions to concatenate.
- param int extend_to_size
The size to which to extend the Boolean function. Set to
0to prevent extension. Defaults to0.- param bool sign_extend
Set
Trueto sign extend,Falseto zero extend. Defaults toFalse.- param bool ascending
Set
Trueto concatenate in ascending order (from0ton-1),Falsefor descending order (fromn-1to0). Defaults toTrue.- returns
The resulting Boolean function on success,
Noneotherwise.- rtype
hal_py.BooleanFunction or None
get_boolean_function_from(nets: List[hal_py.Net], extend_to_size: int = 0, sign_extend: bool = False, ascending: bool = True) -> Optional[hal_py.BooleanFunction]
Get the Boolean function that is the concatenation of variable names corresponding to nets of a netlist. The Boolean function can optionally be extended to any desired size greater the size of the given net vector.
- param list[hal_py.Net] nets
The nets to concatenate.
- param int extend_to_size
The size to which to extend the Boolean function. Set to
0to prevent extension. Defaults to0.- param bool sign_extend
Set
Trueto sign extend,Falseto zero extend. Defaults toFalse.- param bool ascending
Set
Trueto concatenate in ascending order (from0ton-1),Falsefor descending order (fromn-1to0). Defaults toTrue.- returns
The resulting Boolean function on success,
Noneotherwise.- rtype
hal_py.BooleanFunction or None
get_boolean_function_from(pin_group: hal_py.ModulePinGroup, extend_to_size: int = 0, sign_extend: bool = False) -> Optional[hal_py.BooleanFunction]
Get the Boolean function that is the concatenation of variable names corresponding to the nets connected to the pins of the given pin group. The Boolean function can optionally be extended to any desired size greater the size of the given net vector.
- param hal_py.ModulePinGroup pin_group
The module pin group.
- param int extend_to_size
The size to which to extend the Boolean function. Set to
0to prevent extension. Defaults to0.- param bool sign_extend
Set
Trueto sign extend,Falseto zero extend. Defaults toFalse.- returns
The resulting Boolean function on success,
Noneotherwise.- rtype
hal_py.BooleanFunction or None
- substitute_power_ground_nets(self: hal_py.BooleanFunctionDecorator, nl: hal_py.Netlist) Optional[hal_py.BooleanFunction]
Substitute all Boolean function variables fed by power or ground gates by constant
0and1.- Parameters
nl (hal_py.Netlist) – The netlist to operate on.
- Returns
The resulting Boolean function on success,
Noneotherwise.- Return type
- substitute_power_ground_pins(self: hal_py.BooleanFunctionDecorator, g: hal_py.Gate) Optional[hal_py.BooleanFunction]
Substitute all Boolean function variables that belong to a pin connected to a power or ground gate by constant
0and1.- Parameters
g (hal_py.Gate) – The gate which is connected to the pins and belongs to the Boolean function under inspection.
- Returns
The resulting Boolean function on success,
Noneotherwise.- Return type