41 namespace module_identification
72 u32 max_control_signal,
75 const std::vector<std::vector<Gate*>>& registers);
409 std::map<std::string, std::map<std::string, std::map<std::string, std::map<std::string, u64>>>>
m_timings;
This file contains the CandidateContext struct and that is used for optimization purposes during the ...
Represents a functional candidate derived from structural candidates.
static hal::Result< std::vector< FunctionalCandidate > > discard_equal_candidate(CandidateContext &ctx, const FunctionalCandidate &candidate)
Discard equal candidates based on their number of input signals.
static hal::Result< std::vector< FunctionalCandidate > > create_input_extension_variants(CandidateContext &ctx, const FunctionalCandidate &candidate)
Create input extension variants for an adder, subtractor, or counter.
std::vector< Gate * > m_gates
std::vector< std::pair< Net *, Net * > > m_permuted_single_pairs
std::map< Net *, Net * > m_single_input_to_output
std::vector< Net * > m_output_nets
static hal::Result< std::vector< FunctionalCandidate > > build_input_operand(CandidateContext &ctx, const FunctionalCandidate &candidate)
Build an input operand for a functional candidate by including all external input signals of the cand...
static hal::Result< std::vector< FunctionalCandidate > > add_single_input_signals(CandidateContext &ctx, const FunctionalCandidate &candidate)
Add single input signals for an adder, subtractor, or counter.
static hal::Result< std::vector< FunctionalCandidate > > add_selected_shifted_operand(CandidateContext &ctx, const FunctionalCandidate &candidate)
Add shifted operands to the functional candidate based on its input output stats.
std::map< std::string, std::string > get_all_additional_data() const
Get all additional data of the functional candidate.
static hal::Result< std::vector< FunctionalCandidate > > trim_to_single_output_net(CandidateContext &ctx, const FunctionalCandidate &candidate)
Trim a functional candidate to a single output net.
std::map< u32, std::vector< Net * > > m_influence_count_to_input_nets
std::map< std::string, std::map< std::string, std::map< std::string, std::map< std::string, u64 > > > > m_timings
static hal::Result< std::vector< FunctionalCandidate > > add_all_shifted_operand(CandidateContext &ctx, const FunctionalCandidate &candidate)
Add all possible variations of possible shifted operands to the functional candidate.
StructuralCandidate * m_structural_candidate
std::string get_candidate_info() const
Get candidate information as a string.
static hal::Result< std::vector< FunctionalCandidate > > realize_control_signals(CandidateContext &ctx, const FunctionalCandidate &candidate)
Realize control signals for an adder, subtractor, or counter by setting the control signals to concre...
std::vector< Gate * > m_base_gates
static hal::Result< std::vector< FunctionalCandidate > > permute_single_input_signals(CandidateContext &ctx, const FunctionalCandidate &candidate)
Permute single input signals for an adder, subtractor, or counter.
static hal::Result< std::vector< FunctionalCandidate > > create_sign_bit_variants(CandidateContext &ctx, const FunctionalCandidate &candidate)
Create sign bit variants for an adder, subtractor, or counter.
std::vector< Net * > m_input_nets
static hal::Result< std::vector< FunctionalCandidate > > check_output_size(CandidateContext &ctx, const FunctionalCandidate &candidate)
Check the output size of a functional candidate.
static hal::Result< std::vector< FunctionalCandidate > > find_control_signals(CandidateContext &ctx, const FunctionalCandidate &candidate)
Find control signals for a functional candidate.
static hal::Result< std::vector< FunctionalCandidate > > update_input_output_stats(CandidateContext &ctx, const FunctionalCandidate &candidate)
Update input and output statistics for an adder, subtractor, or counter.
static hal::Result< std::vector< FunctionalCandidate > > create_sign_extension_variants(CandidateContext &ctx, const FunctionalCandidate &candidate)
Create sign extension variants of a functional candidate.
std::vector< Net * > m_control_signals
static hal::Result< std::vector< FunctionalCandidate > > create_candidates(StructuralCandidate *sc, u32 max_control_signal, CandidateContext &ctx, module_identification::CandidateType candidate_type, const std::vector< std::vector< Gate * >> ®isters)
Create functional candidates from a structural candidate.
static hal::Result< std::vector< FunctionalCandidate > > identify_control_signals(CandidateContext &ctx, const FunctionalCandidate &candidate)
Identify control signals for an adder, subtractor, or counter.
std::map< u32, std::vector< Net * > > m_input_count_to_output_nets
static hal::Result< std::vector< FunctionalCandidate > > order_input_operands(CandidateContext &ctx, const FunctionalCandidate &candidate)
Order input operands for a functional candidate.
static FunctionalCandidate add_n_shifted_operands(const FunctionalCandidate &candidate, const std::vector< i32 > &shift_vals)
Add n shifted operands for constant multiplication.
static hal::Result< std::vector< FunctionalCandidate > > order_output_signals(CandidateContext &ctx, const FunctionalCandidate &candidate)
Order output signals for an adder, subtractor, or counter.
std::map< Net *, BooleanFunction::Value > m_control_mapping
static hal::Result< std::vector< FunctionalCandidate > > build_input_operands(CandidateContext &ctx, const FunctionalCandidate &candidate)
Build input operands for an adder, subtractor, or counter.
static hal::Result< std::vector< FunctionalCandidate > > early_abort(CandidateContext &ctx, const FunctionalCandidate &candidate)
Early abort process for a functional candidate.
std::map< std::string, std::string > m_additional_data
u32 m_max_control_signals
std::vector< Net * > m_sign_nets
module_identification::CandidateType m_candidate_type
static hal::Result< std::vector< FunctionalCandidate > > create_operand_control_variations(CandidateContext &ctx, const FunctionalCandidate &candidate)
Create operand control variations for absolute functional candidates.
FunctionalCandidate(StructuralCandidate *sc, u32 max_control_signal, module_identification::CandidateType candidate_type)
Constructor for FunctionalCandidate.
Net * m_ctrl_to_operand_net
static hal::Result< std::vector< FunctionalCandidate > > create_output_net_variant(CandidateContext &ctx, const FunctionalCandidate &candidate)
Create output net variants for an adder, subtractor, or counter.
hal::Result< VerifiedCandidate > check(const std::vector< BooleanFunction > &output_functions, const std::vector< std::vector< Gate * >> ®isters)
Check whether a functional candidate with the given input operands and output functions is actually i...
void add_additional_data(std::string key, std::string value)
Add additional data to the functional candidate.
std::vector< std::vector< Net * > > m_operands
A class representing a structural candidate for module identification.
CandidateType
Enumeration of the different candidate types for module identification.
This struct manages the context of a candidate during module identification, including caches for all...
This file contains the class for defining and managing structural candidates within the module identi...