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) -> 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
0
to prevent extension. Defaults to0
.- param bool sign_extend
Set
True
to sign extend,False
to zero extend. Defaults toFalse
.- returns
The resulting Boolean function on success,
None
otherwise.- rtype
hal_py.BooleanFunction or None
get_boolean_function_from(nets: List[hal_py.Net], 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 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
0
to prevent extension. Defaults to0
.- param bool sign_extend
Set
True
to sign extend,False
to zero extend. Defaults toFalse
.- returns
The resulting Boolean function on success,
None
otherwise.- 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
0
to prevent extension. Defaults to0
.- param bool sign_extend
Set
True
to sign extend,False
to zero extend. Defaults toFalse
.- returns
The resulting Boolean function on success,
None
otherwise.- 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
0
and1
.- Parameters
nl (hal_py.Netlist) – The netlist to operate on.
- Returns
The resulting Boolean function on success,
None
otherwise.- 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
0
and1
.- 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,
None
otherwise.- Return type