|
HAL
v4.5.0-83-g30c8f0afc
The Hardware Analyzer - a comprehensive reverse engineering and manipulation framework for gate-level netlists.
|
This struct manages the context of a candidate during module identification, including caches for all Boolean function related and expensive oprations that are populated during the functional candidate generation. More...

Public Member Functions | |
| CandidateContext (const Netlist *nl, const std::vector< Gate * > &gates) | |
| Constructs a new CandidateContext object saving results for one structural candidate. More... | |
| hal::Result< std::monostate > | populate_boolean_function_cache (const std::vector< Net * > nets) |
| Populates the boolean function cache for a set of nets. More... | |
| hal::Result< const BooleanFunction > | get_boolean_function_const (const Net *n, const std::map< Net *, BooleanFunction::Value > &ctrl_mapping) const |
| Retrieves a constant boolean function for a given net and control mapping. More... | |
| hal::Result< std::vector< BooleanFunction > > | get_boolean_functions_const (const std::vector< Net * > nets, const std::map< Net *, BooleanFunction::Value > &ctrl_mapping) const |
| Retrieves a set of constant boolean functions for a given set of nets and control mapping. More... | |
| hal::Result< const BooleanFunction > | get_boolean_function (const Net *n, const std::map< Net *, BooleanFunction::Value > &ctrl_mapping) |
| Retrieves a boolean function for a given net and control mapping. More... | |
| hal::Result< std::vector< BooleanFunction > > | get_boolean_functions (const std::vector< Net * > nets, const std::map< Net *, BooleanFunction::Value > &ctrl_mapping) |
| Retrieves a set of boolean functions for a given set of nets and control mapping. More... | |
| hal::Result< const std::set< std::string > > | get_variable_names (const Net *n, const std::map< Net *, BooleanFunction::Value > &ctrl_mapping) |
| Retrieves the variable names for a given net and control mapping. More... | |
| hal::Result< const std::set< Net * > > | get_variable_nets (const Net *n, const std::map< Net *, BooleanFunction::Value > &ctrl_mapping) |
| Retrieves the variable nets for a given net and control mapping. More... | |
| hal::Result< std::unordered_map< std::string, double > > | get_boolean_influence (const Net *n, const std::map< Net *, BooleanFunction::Value > &ctrl_mapping) |
| Retrieves the boolean influence for a given net and control mapping. More... | |
| hal::Result< std::vector< BooleanFunction::Value > > | evaluate (const Net *n, const std::map< Net *, BooleanFunction::Value > &ctrl_mapping, const std::map< std::string, BooleanFunction::Value > &eval_mapping) |
| Evaluates the boolean function for a given net, control mapping, and evaluation mapping. More... | |
Public Attributes | |
| std::vector< Gate * > | m_gates |
| The gates of the corresponding structural candidate. More... | |
| const Netlist * | m_netlist |
| The netlist associated with the candidate context. More... | |
This struct manages the context of a candidate during module identification, including caches for all Boolean function related and expensive oprations that are populated during the functional candidate generation.
Definition at line 62 of file candidate_context.h.
| hal::module_identification::CandidateContext::CandidateContext | ( | const Netlist * | nl, |
| const std::vector< Gate * > & | gates | ||
| ) |
Constructs a new CandidateContext object saving results for one structural candidate.
| [in] | nl | - The netlist associated with the candidate context. |
| [in] | gates | - The gates of the structural canidate. |
Definition at line 11 of file candidate_context.cpp.
| hal::Result<std::vector<BooleanFunction::Value> > hal::module_identification::CandidateContext::evaluate | ( | const Net * | n, |
| const std::map< Net *, BooleanFunction::Value > & | ctrl_mapping, | ||
| const std::map< std::string, BooleanFunction::Value > & | eval_mapping | ||
| ) |
Evaluates the boolean function for a given net, control mapping, and evaluation mapping.
| [in] | n | - The net to evaluate the boolean function for. |
| [in] | ctrl_mapping | - The control mapping to apply to the function. |
| [in] | eval_mapping | - The evaluation mapping for the boolean function. |
Referenced by hal::module_identification::FunctionalCandidate::early_abort().
| hal::Result<const BooleanFunction> hal::module_identification::CandidateContext::get_boolean_function | ( | const Net * | n, |
| const std::map< Net *, BooleanFunction::Value > & | ctrl_mapping | ||
| ) |
Retrieves a boolean function for a given net and control mapping.
| [in] | n | - The net to retrieve the boolean function for. |
| [in] | ctrl_mapping | - The control mapping to apply to the function. |
Referenced by hal::module_identification::FunctionalCandidate::order_input_operands().
| hal::Result<const BooleanFunction> hal::module_identification::CandidateContext::get_boolean_function_const | ( | const Net * | n, |
| const std::map< Net *, BooleanFunction::Value > & | ctrl_mapping | ||
| ) | const |
Retrieves a constant boolean function for a given net and control mapping.
| [in] | n | - The net to retrieve the boolean function for. |
| [in] | ctrl_mapping | - The control mapping to apply to the function. |
| hal::Result<std::vector<BooleanFunction> > hal::module_identification::CandidateContext::get_boolean_functions | ( | const std::vector< Net * > | nets, |
| const std::map< Net *, BooleanFunction::Value > & | ctrl_mapping | ||
| ) |
Retrieves a set of boolean functions for a given set of nets and control mapping.
| [in] | nets | - The nets to retrieve the boolean functions for. |
| [in] | ctrl_mapping | - The control mapping to apply to the function. |
| hal::Result<std::vector<BooleanFunction> > hal::module_identification::CandidateContext::get_boolean_functions_const | ( | const std::vector< Net * > | nets, |
| const std::map< Net *, BooleanFunction::Value > & | ctrl_mapping | ||
| ) | const |
Retrieves a set of constant boolean functions for a given set of nets and control mapping.
| [in] | nets | - The nets to retrieve the boolean functions for. |
| [in] | ctrl_mapping | - The control mapping to apply to the function. |
| hal::Result<std::unordered_map<std::string, double> > hal::module_identification::CandidateContext::get_boolean_influence | ( | const Net * | n, |
| const std::map< Net *, BooleanFunction::Value > & | ctrl_mapping | ||
| ) |
Retrieves the boolean influence for a given net and control mapping.
| [in] | n | - The net to retrieve the boolean influence for. |
| [in] | ctrl_mapping | - The control mapping to apply to the function. |
Referenced by hal::module_identification::FunctionalCandidate::create_sign_extension_variants(), and hal::module_identification::FunctionalCandidate::find_control_signals().
| hal::Result<const std::set<std::string> > hal::module_identification::CandidateContext::get_variable_names | ( | const Net * | n, |
| const std::map< Net *, BooleanFunction::Value > & | ctrl_mapping | ||
| ) |
Retrieves the variable names for a given net and control mapping.
| [in] | n | - The net to retrieve the variable names for. |
| [in] | ctrl_mapping | - The control mapping to apply to the function. |
Referenced by hal::module_identification::FunctionalCandidate::discard_equal_candidate().
| hal::Result<const std::set<Net*> > hal::module_identification::CandidateContext::get_variable_nets | ( | const Net * | n, |
| const std::map< Net *, BooleanFunction::Value > & | ctrl_mapping | ||
| ) |
Retrieves the variable nets for a given net and control mapping.
| [in] | n | - The net to retrieve the variable nets for. |
| [in] | ctrl_mapping | - The control mapping to apply to the function. |
Referenced by hal::module_identification::FunctionalCandidate::add_selected_shifted_operand(), hal::module_identification::FunctionalCandidate::order_input_operands(), and hal::module_identification::FunctionalCandidate::update_input_output_stats().
| hal::Result<std::monostate> hal::module_identification::CandidateContext::populate_boolean_function_cache | ( | const std::vector< Net * > | nets | ) |
Populates the boolean function cache for a set of nets.
| [in] | nets | - The nets to populate the boolean function cache for. |
Referenced by hal::module_identification::generate_functional_candidates().
| std::vector<Gate*> hal::module_identification::CandidateContext::m_gates |
The gates of the corresponding structural candidate.
Definition at line 158 of file candidate_context.h.
Referenced by hal::module_identification::generate_functional_candidates().
| const Netlist* hal::module_identification::CandidateContext::m_netlist |
The netlist associated with the candidate context.
Definition at line 163 of file candidate_context.h.
Referenced by hal::module_identification::FunctionalCandidate::create_input_extension_variants().