|
HAL
v4.5.0-83-g30c8f0afc
The Hardware Analyzer - a comprehensive reverse engineering and manipulation framework for gate-level netlists.
|
Functions | |
| Result< std::unordered_map< std::string, double > > | get_boolean_influence (const BooleanFunction &bf, const u32 num_evaluations=32000) |
| Result< std::unordered_map< std::string, double > > | get_boolean_influence_with_hal_boolean_function_class (const BooleanFunction &bf, const u32 num_evaluations) |
| Result< std::unordered_map< std::string, double > > | get_boolean_influence_with_z3_expr (const BooleanFunction &bf, const u32 num_evaluations) |
| Result< std::unordered_map< std::string, double > > | get_boolean_influence (const z3::expr &e, const u32 num_evaluations=32000) |
| Result< std::unordered_map< std::string, double > > | get_boolean_influence_deterministic (const BooleanFunction &bf) |
| Result< std::unordered_map< std::string, double > > | get_boolean_influence_deterministic (const z3::expr &e) |
| Result< std::map< Net *, double > > | get_boolean_influences_of_subcircuit (const std::vector< Gate * > &gates, const Net *start_net, const u32 num_evaluations=32000) |
| Result< std::map< Net *, double > > | get_boolean_influences_of_gate (const Gate *gate, const u32 num_evaluations=32000) |
| Result< std::map< Net *, double > > | get_boolean_influences_of_subcircuit_deterministic (const std::vector< Gate * > &gates, const Net *start_net) |
| Result< std::map< Net *, double > > | get_boolean_influences_of_gate_deterministic (const Gate *gate) |
| Result< std::pair< std::map< u32, Gate * >, std::vector< std::vector< double > > > > | get_ff_dependency_matrix (const Netlist *netlist, bool with_boolean_influence) |
Computes the Boolean influence of the input variables of a Boolean function.
The Boolean influence of a variable is the fraction of input assignments for which flipping that variable also flips the output of the function. It therefore ranges from 0.0 for a variable that the function does not depend on to 1.0 for a variable that the output follows directly.
| Result< std::unordered_map< std::string, double > > hal::boolean_influence::get_boolean_influence | ( | const BooleanFunction & | bf, |
| const u32 | num_evaluations = 32000 |
||
| ) |
Compute the Boolean influence of each input variable of a Boolean function. The influence is approximated by evaluating the function on randomly sampled input assignments.
| [in] | bf | - The Boolean function. |
| [in] | num_evaluations | - The number of evaluations that are performed for each input variable. |
Definition at line 407 of file boolean_influence.cpp.
References hal::z3_utils::from_bf().
Referenced by hal::PYBIND11_PLUGIN().
| Result< std::unordered_map< std::string, double > > hal::boolean_influence::get_boolean_influence | ( | const z3::expr & | e, |
| const u32 | num_evaluations = 32000 |
||
| ) |
Compute the Boolean influence of each input variable of a Boolean function. The influence is approximated by evaluating the function on randomly sampled input assignments.
| [in] | e | - The z3 expression representing the Boolean function. |
| [in] | num_evaluations | - The number of evaluations that are performed for each input variable. |
Definition at line 415 of file boolean_influence.cpp.
| Result< std::unordered_map< std::string, double > > hal::boolean_influence::get_boolean_influence_deterministic | ( | const BooleanFunction & | bf | ) |
Compute the exact Boolean influence of each input variable of a Boolean function. In contrast to get_boolean_influence, the function is evaluated on every possible input assignment instead of a random sample. This is only feasible for functions of at most 16 variables.
| [in] | bf | - The Boolean function. |
Definition at line 420 of file boolean_influence.cpp.
References hal::z3_utils::from_bf().
Referenced by hal::PYBIND11_PLUGIN().
| Result< std::unordered_map< std::string, double > > hal::boolean_influence::get_boolean_influence_deterministic | ( | const z3::expr & | e | ) |
Compute the exact Boolean influence of each input variable of a Boolean function. In contrast to get_boolean_influence, the function is evaluated on every possible input assignment instead of a random sample. This is only feasible for functions of at most 16 variables.
| [in] | e | - The z3 expression representing the Boolean function. |
Definition at line 428 of file boolean_influence.cpp.
| Result< std::unordered_map< std::string, double > > hal::boolean_influence::get_boolean_influence_with_hal_boolean_function_class | ( | const BooleanFunction & | bf, |
| const u32 | num_evaluations | ||
| ) |
Compute the Boolean influence of each input variable of a Boolean function using only HAL-internal functionality. The influence is approximated by evaluating the function on randomly sampled input assignments. This variant is slower than get_boolean_influence, but it is better suited for use in a multi-threaded environment.
| [in] | bf | - The Boolean function. |
| [in] | num_evaluations | - The number of evaluations that are performed for each input variable. |
Definition at line 453 of file boolean_influence.cpp.
References ERR_APPEND, hal::BooleanFunction::evaluate(), hal::BooleanFunction::get_variable_names(), OK, x, and y.
Referenced by hal::PYBIND11_PLUGIN().
| Result< std::unordered_map< std::string, double > > hal::boolean_influence::get_boolean_influence_with_z3_expr | ( | const BooleanFunction & | bf, |
| const u32 | num_evaluations | ||
| ) |
Compute the Boolean influence of each input variable of a Boolean function using only z3 substitution and simplification. The influence is approximated by evaluating the function on randomly sampled input assignments. This variant is slower than get_boolean_influence, but it is better suited for use in a multi-threaded environment.
| [in] | bf | - The Boolean function. |
| [in] | num_evaluations | - The number of evaluations that are performed for each input variable. |
Definition at line 509 of file boolean_influence.cpp.
References ERR, hal::z3_utils::from_bf(), hal::BooleanFunction::get_variable_names(), OK, x, and y.
Referenced by hal::PYBIND11_PLUGIN().
| Result< std::map< Net *, double > > hal::boolean_influence::get_boolean_influences_of_gate | ( | const Gate * | gate, |
| const u32 | num_evaluations = 32000 |
||
| ) |
Compute the Boolean influence of each net that drives the data input of the given flip-flop. The Boolean function of the data input net is built, translated into C code, and then compiled and executed for speed. The influence is approximated by evaluating that function on randomly sampled input assignments.
| [in] | gate | - The flip-flop whose data input net is used to build the Boolean function. |
| [in] | num_evaluations | - The number of evaluations that are performed for each input variable. |
Definition at line 438 of file boolean_influence.cpp.
Referenced by get_ff_dependency_matrix(), and hal::PYBIND11_PLUGIN().
| Result< std::map< Net *, double > > hal::boolean_influence::get_boolean_influences_of_gate_deterministic | ( | const Gate * | gate | ) |
Compute the exact Boolean influence of each net that drives the data input of the given flip-flop. In contrast to get_boolean_influences_of_gate, the function is evaluated on every possible input assignment instead of a random sample. This is only feasible for data input functions of at most 16 nets.
| [in] | gate | - The flip-flop whose data input net is used to build the Boolean function. |
Definition at line 448 of file boolean_influence.cpp.
Referenced by hal::PYBIND11_PLUGIN().
| Result< std::map< Net *, double > > hal::boolean_influence::get_boolean_influences_of_subcircuit | ( | const std::vector< Gate * > & | gates, |
| const Net * | start_net, | ||
| const u32 | num_evaluations = 32000 |
||
| ) |
Compute the Boolean influence of each input net of a subcircuit on one of its output nets. The Boolean function of the start net is built from the given gates, translated into C code, and then compiled and executed for speed. The influence is approximated by evaluating that function on randomly sampled input assignments.
| [in] | gates | - The gates of the subcircuit. |
| [in] | start_net | - The output net of the subcircuit at which to start the analysis. |
| [in] | num_evaluations | - The number of evaluations that are performed for each input variable. |
Definition at line 433 of file boolean_influence.cpp.
Referenced by hal::PYBIND11_PLUGIN().
| Result< std::map< Net *, double > > hal::boolean_influence::get_boolean_influences_of_subcircuit_deterministic | ( | const std::vector< Gate * > & | gates, |
| const Net * | start_net | ||
| ) |
Compute the exact Boolean influence of each input net of a subcircuit on one of its output nets. In contrast to get_boolean_influences_of_subcircuit, the function is evaluated on every possible input assignment instead of a random sample. This is only feasible for subcircuits with at most 16 input nets.
| [in] | gates | - The gates of the subcircuit. |
| [in] | start_net | - The output net of the subcircuit at which to start the analysis. |
Definition at line 443 of file boolean_influence.cpp.
Referenced by hal::PYBIND11_PLUGIN().
| Result< std::pair< std::map< u32, Gate * >, std::vector< std::vector< double > > > > hal::boolean_influence::get_ff_dependency_matrix | ( | const Netlist * | netlist, |
| bool | with_boolean_influence | ||
| ) |
Get the flip-flop dependency matrix of a netlist, i.e., a matrix that holds an entry for every pair of flip-flops that are connected through combinational logic.
| [in] | netlist | - The netlist to extract the dependency matrix from. |
| [in] | with_boolean_influence | - Set true to use the Boolean influence as the matrix entry, false to use 1.0 for every connection. |
Definition at line 586 of file boolean_influence.cpp.
References ERR_APPEND, hal::ff, get_boolean_influences_of_gate(), hal::Gate::get_fan_out_nets(), hal::Netlist::get_gates(), hal::NetlistTraversalDecorator::get_next_sequential_gates(), log_info, and OK.
Referenced by hal::PYBIND11_PLUGIN().