![]() |
HAL
|
#include <boolean_function_decorator.h>
Public Member Functions | |
BooleanFunctionDecorator (const BooleanFunction &bf) | |
Result< BooleanFunction > | substitute_power_ground_nets (const Netlist *nl) const |
Result< BooleanFunction > | substitute_power_ground_pins (const Gate *g) const |
Result< BooleanFunction > | substitute_module_pins (const std::vector< Module * > &modules) const |
Static Public Member Functions | |
static Result< BooleanFunction > | get_boolean_function_from (const std::vector< BooleanFunction > &functions, u32 extend_to_size=0, bool sign_extend=false) |
static Result< BooleanFunction > | get_boolean_function_from (const std::vector< Net * > &nets, u32 extend_to_size=0, bool sign_extend=false) |
static Result< BooleanFunction > | get_boolean_function_from (const PinGroup< ModulePin > *pin_group, u32 extend_to_size=0, bool sign_extend=false) |
A Boolean function decorator that provides functionality to operate on the associated Boolean function.
Definition at line 42 of file boolean_function_decorator.h.
hal::BooleanFunctionDecorator::BooleanFunctionDecorator | ( | const BooleanFunction & | bf | ) |
Construct new BooleanFunction object.
[in] | bf | - The Boolean function to operate on. |
Definition at line 12 of file boolean_function_decorator.cpp.
|
static |
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 Boolean function vector.
[in] | pin_group | - The module pin group. |
[in] | extend_to_size | - The size to which to extend the Boolean function. Set to 0 to prevent extension. Defaults to 0. |
[in] | sign_extend | - Set true to sign extend, false to zero extend. Defaults to false . |
Definition at line 268 of file boolean_function_decorator.cpp.
References get_boolean_function_from(), hal::PinGroup< T >::get_pins(), and pins.
|
static |
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 Boolean function vector.
[in] | functions | - The Boolean functions to concatenate. |
[in] | extend_to_size | - The size to which to extend the Boolean function. Set to 0 to prevent extension. Defaults to 0. |
[in] | sign_extend | - Set true to sign extend, false to zero extend. Defaults to false . |
Definition at line 149 of file boolean_function_decorator.cpp.
References hal::BooleanFunction::Concat(), ERR, ERR_APPEND, hal::BooleanFunction::Index(), OK, hal::BooleanFunction::Sext(), and hal::BooleanFunction::Zext().
Referenced by hal::boolean_function_decorator_init(), and get_boolean_function_from().
|
static |
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.
[in] | nets | - The nets to concatenate. |
[in] | extend_to_size | - The size to which to extend the Boolean function. Set to 0 to prevent extension. Defaults to 0. |
[in] | sign_extend | - Set true to sign extend, false to zero extend. Defaults to false . |
Definition at line 205 of file boolean_function_decorator.cpp.
References hal::BooleanFunction::Concat(), ERR, ERR_APPEND, hal::BooleanFunctionNetDecorator::get_boolean_variable_name(), hal::BooleanFunction::Index(), OK, hal::BooleanFunction::Sext(), hal::BooleanFunction::Var(), and hal::BooleanFunction::Zext().
Result< BooleanFunction > hal::BooleanFunctionDecorator::substitute_module_pins | ( | const std::vector< Module * > & | modules | ) | const |
Substitute all Boolean function variables that are either 1) output or 2) input nets to one of the passed module with a BooleanFunction of the form Extract(Var(<module_name>_<pin_group_name>), index, index). This allows a simplification in case multiple pins of the same pin group are concatenated.
[in] | nl | - The netlist to operate on. |
Definition at line 101 of file boolean_function_decorator.cpp.
References hal::BooleanFunction::clone(), ERR, hal::BooleanFunctionNetDecorator::get_net_from(), hal::BooleanFunction::get_variable_names(), hal::BooleanFunction::Index(), test_multiple::netlist, OK, hal::BooleanFunction::Slice(), and hal::BooleanFunction::Var().
Result< BooleanFunction > hal::BooleanFunctionDecorator::substitute_power_ground_nets | ( | const Netlist * | nl | ) | const |
Substitute all Boolean function variables fed by power or ground gates by constant 0
and 1
.
[in] | nl | - The netlist to operate on. |
Definition at line 16 of file boolean_function_decorator.cpp.
References hal::BooleanFunction::clone(), hal::BooleanFunction::Const(), ERR, hal::BooleanFunctionNetDecorator::get_net_from(), hal::BooleanFunction::get_variable_names(), hal::ground, net, OK, hal::power, and hal::BooleanFunction::substitute().
Result< BooleanFunction > hal::BooleanFunctionDecorator::substitute_power_ground_pins | ( | const Gate * | g | ) | const |
Substitute all Boolean function variables that belong to a pin connected to a power or ground gate by constant 0
and 1
.
[in] | g | - The gate which is connected to the pins and belongs to the Boolean function under inspection. |
Definition at line 59 of file boolean_function_decorator.cpp.
References hal::BooleanFunction::clone(), hal::BooleanFunction::Const(), ERR, test_plugin::g, hal::BooleanFunction::get_variable_names(), hal::ground, net, OK, hal::power, and hal::BooleanFunction::substitute().