PandA-2024.02
|
#include <vcd_utility.hpp>
Public Member Functions | |
vcd_utility (const ParameterConstRef parameters, const HLS_managerRef HLSMgr, const DesignFlowManagerConstRef design_flow_manager) | |
Constructor. More... | |
~vcd_utility () override=default | |
DesignFlowStep_Status | Exec () override |
Execute the step. More... | |
bool | HasToBeExecuted () const override |
Check if this step has actually to be executed. More... | |
Public Member Functions inherited from HLS_step | |
HLS_step (const ParameterConstRef _parameters, const HLS_managerRef HLSMgr, const DesignFlowManagerConstRef design_flow_manager, const HLSFlowStep_Type hls_flow_step_type, const HLSFlowStepSpecializationConstRef hls_flow_step_specialization=HLSFlowStepSpecializationConstRef()) | |
Constructor. More... | |
~HLS_step () override | |
Destructor. More... | |
std::string | GetSignature () const override |
Return a unified identifier of this design step. More... | |
std::string | GetName () const override |
Return the name of this design step. More... | |
virtual std::string | GetKindText () const |
Return the name of the type of this frontend flow step. More... | |
DesignFlowStepFactoryConstRef | CGetDesignFlowStepFactory () const final |
Return the factory to create this type of steps. More... | |
void | ComputeRelationships (DesignFlowStepSet &design_flow_step_set, const DesignFlowStep::RelationshipType relationship_type) override |
Compute the relationships of a step with other steps. More... | |
Public Member Functions inherited from DesignFlowStep | |
DesignFlowStep (const DesignFlowManagerConstRef design_flow_manager, const ParameterConstRef parameters) | |
Constructor. More... | |
virtual | ~DesignFlowStep () |
Destructor. More... | |
virtual void | Initialize () |
Initialize the step (i.e., like a constructor, but executed just before exec. More... | |
DesignFlowStep_Status | GetStatus () const |
Return the status of this design step. More... | |
virtual void | WriteDot (std::ostream &out) const |
Write the label for a dot graph. More... | |
bool | IsComposed () const |
Returns if this step is composed. More... | |
int | CGetDebugLevel () const |
Return the debug level of the step. More... | |
virtual void | PrintInitialIR () const |
Dump the initial intermediate representation. More... | |
virtual void | PrintFinalIR () const |
Dump the final intermediate representation. More... | |
Protected Member Functions | |
unsigned long long | GetClockPeriod (const vcd_parser::vcd_trace_t &vcd_trace) const |
const CustomUnorderedSet< std::tuple< HLSFlowStep_Type, HLSFlowStepSpecializationConstRef, HLSFlowStep_Relationship > > | ComputeHLSRelationships (const DesignFlowStep::RelationshipType relationship_type) const override |
Return the set of analyses in relationship with this design step. More... | |
bool | detect_mismatch (const vcd_trace_head &t, const uint64_t c_context, const std::string &c_val) |
bool | detect_regular_mismatch (const vcd_trace_head &t, const std::string &c_val, const std::string &vcd_val) const |
bool | detect_binary_float_mismatch (const std::string &c_val, const std::string &resized_vcd_val) const |
bool | detect_binary_double_mismatch (const std::string &c_val, const std::string &resized_vcd_val) const |
bool | detect_address_mismatch (const DiscrepancyOpInfo &op_info, const uint64_t c_context, const std::string &c_val, const std::string &vcd_val, unsigned int &base_index) |
bool | detect_fixed_address_mismatch (const DiscrepancyOpInfo &op_info, const uint64_t c_context, const std::string &c_val, const std::string &vcd_val, const unsigned int base_index) const |
bool | detect_mismatch_element (const vcd_trace_head &t, const uint64_t c_context, const std::string &c_val, const unsigned int el_idx) |
bool | detect_mismatch_simple (const vcd_trace_head &t, const uint64_t c_context, const std::string &c_val, const unsigned int el_idx, const std::string::size_type first_c_bit, const std::string::size_type c_size) |
void | update_discr_list (const vcd_trace_head &t, const uint64_t c_context, const std::string &c_val, const unsigned int el_idx, const std::string::size_type first_c_bit, const std::string::size_type c_size, const unsigned int base_index) |
void | print_failed_vcd_head (const vcd_trace_head &t, bool one_hot_encoding, const int verbosity) const |
void | print_discrepancy (const DiscrepancyLog &l, bool one_hot_encoding, const int verbosity) const |
std::string | compute_fsm_state_from_vcd_string (const std::string &vcd_state_string, bool one_hot_encoding) const |
Protected Attributes | |
const tree_managerRef | TM |
const DiscrepancyRef | Discr |
unsigned long long | possibly_lost_address {0} |
unsigned long long | mismatched_integers {0} |
bool | allow_uninitialized |
std::list< DiscrepancyLog > | discr_list |
std::list< DiscrepancyLog > | soft_discr_list |
std::string | present_state_name |
The name of the present state signal. More... | |
Protected Attributes inherited from HLS_step | |
const HLS_managerRef | HLSMgr |
information about all the HLS synthesis More... | |
const HLSFlowStep_Type | hls_flow_step_type |
The type of this step. More... | |
const HLSFlowStepSpecializationConstRef | hls_flow_step_specialization |
The information about specialization. More... | |
Protected Attributes inherited from DesignFlowStep | |
bool | composed |
True if this step represents a composition of design flow steps (e.g., a flow); must be set by specialized constructors. More... | |
const Wrefcount< const DesignFlowManager > | design_flow_manager |
The design flow manager. More... | |
const ParameterConstRef | parameters |
Set of input parameters. More... | |
int | debug_level |
The debug level. More... | |
const int | output_level |
The output level. More... | |
Additional Inherited Members | |
Public Types inherited from DesignFlowStep | |
enum | RelationshipType { DEPENDENCE_RELATIONSHIP, INVALIDATION_RELATIONSHIP, PRECEDENCE_RELATIONSHIP } |
The relationship type. More... | |
Static Public Member Functions inherited from HLS_step | |
static std::string | EnumToName (const HLSFlowStep_Type hls_flow_step_type) |
Given a HLS flow step type, return the name of the type. More... | |
static const std::string | ComputeSignature (const HLSFlowStep_Type hls_flow_step_type, const HLSFlowStepSpecializationConstRef hls_flow_step_specialization) |
Compute the signature of a hls flow step. More... | |
Static Protected Attributes inherited from HLS_step | |
static CustomUnorderedMap< std::string, HLSFlowStep_Type > | command_line_name_to_enum |
Map hls step name to enum. More... | |
Definition at line 96 of file vcd_utility.hpp.
vcd_utility::vcd_utility | ( | const ParameterConstRef | parameters, |
const HLS_managerRef | HLSMgr, | ||
const DesignFlowManagerConstRef | design_flow_manager | ||
) |
Constructor.
Definition at line 104 of file vcd_utility.cpp.
References DesignFlowStep::debug_level, GET_CLASS, HLS_step::HLSMgr, DesignFlowStep::parameters, STR, and THROW_ASSERT.
|
overridedefault |
|
protected |
Definition at line 1255 of file vcd_utility.cpp.
References STR.
Referenced by print_discrepancy(), and print_failed_vcd_head().
|
overrideprotectedvirtual |
Return the set of analyses in relationship with this design step.
relationship_type | is the type of relationship to be considered |
Reimplemented from HLS_step.
Definition at line 123 of file vcd_utility.cpp.
References C_TESTBENCH_EXECUTION, DesignFlowStep::DEPENDENCE_RELATIONSHIP, DesignFlowStep::INVALIDATION_RELATIONSHIP, DesignFlowStep::parameters, DesignFlowStep::PRECEDENCE_RELATIONSHIP, THROW_UNREACHABLE, and TOP_FUNCTION.
|
protected |
Definition at line 938 of file vcd_utility.cpp.
References detect_fixed_address_mismatch(), Discr, tree_helper::get_base_index(), GET_INDEX_NODE, HLS_step::HLSMgr, DiscrepancyOpInfo::op_id, possibly_lost_address, DiscrepancyOpInfo::ssa_name_node_id, STR, THROW_ASSERT, and TM.
Referenced by detect_mismatch_simple().
|
protected |
Definition at line 821 of file vcd_utility.cpp.
References DesignFlowStep::parameters, STR, and THROW_ASSERT.
Referenced by detect_regular_mismatch().
|
protected |
Definition at line 766 of file vcd_utility.cpp.
References DesignFlowStep::parameters, STR, and THROW_ASSERT.
Referenced by detect_regular_mismatch().
|
protected |
Definition at line 876 of file vcd_utility.cpp.
References tree_helper::CGetType(), Discr, HLS_step::HLSMgr, max, tree_helper::Size(), DiscrepancyOpInfo::stg_fun_id, STR, THROW_ASSERT, and TM.
Referenced by detect_address_mismatch().
|
protected |
Definition at line 529 of file vcd_utility.cpp.
References detect_mismatch_element(), DISCR_VECTOR, vcd_trace_head::fullsigname, vcd_trace_head::op_info, vcd_trace_head::out_var_it, DesignFlowStep::parameters, DiscrepancyOpInfo::ssa_name, DiscrepancyOpInfo::ssa_name_node_id, STR, THROW_ASSERT, DiscrepancyOpInfo::type, update_discr_list(), and DiscrepancyOpInfo::vec_base_bitsize.
Referenced by Exec().
|
protected |
Definition at line 587 of file vcd_utility.cpp.
References detect_mismatch_simple(), DISCR_COMPLEX, vcd_trace_head::fullsigname, vcd_trace_head::op_info, vcd_trace_head::out_var_it, DiscrepancyOpInfo::ssa_name, DiscrepancyOpInfo::ssa_name_node_id, STR, THROW_ASSERT, DiscrepancyOpInfo::type, and DiscrepancyOpInfo::vec_base_bitsize.
Referenced by detect_mismatch().
|
protected |
Definition at line 661 of file vcd_utility.cpp.
References detect_address_mismatch(), detect_regular_mismatch(), DISCR_ADDR, DISCR_COMPLEX, DISCR_REAL, DISCR_VECTOR, vcd_trace_head::discrepancy_found, mismatched_integers, DiscrepancyOpInfo::op_id, vcd_trace_head::op_info, vcd_trace_head::out_var_it, DiscrepancyOpInfo::ssa_name, STR, THROW_ASSERT, DiscrepancyOpInfo::type, and update_discr_list().
Referenced by detect_mismatch_element().
|
protected |
Definition at line 1009 of file vcd_utility.cpp.
References allow_uninitialized, detect_binary_double_mismatch(), detect_binary_float_mismatch(), DISCR_REAL, vcd_trace_head::fullsigname, GET_NODE, vcd_trace_head::op_info, DiscrepancyOpInfo::ssa_name, DiscrepancyOpInfo::ssa_name_node_id, STR, THROW_ASSERT, THROW_UNREACHABLE, TM, and DiscrepancyOpInfo::type.
Referenced by detect_mismatch_simple().
|
overridevirtual |
Execute the step.
Implements DesignFlowStep.
Definition at line 196 of file vcd_utility.cpp.
References vcd_trace_head::advance(), vcd_trace_head::after_discrepancy, vcd_trace_head::checked, DesignFlowStep::debug_level, DEBUG_LEVEL_VERY_PEDANTIC, detect_mismatch(), Discr, discr_list, vcd_trace_head::discrepancy_found, vcd_trace_head::ends_after(), vcd_trace_head::exec_times_in_current_state, get_signal_variations(), GetClockPeriod(), HIERARCHY_SEPARATOR, HLS_step::HLSMgr, INDENT_DBG_MEX, INDENT_OUT_MEX, vcd_trace_head::init_fail, vcd_trace_head::initialized, ControlFlowChecker::IsOneHotFSM(), max, mismatched_integers, vcd_trace_head::more_executions_in_this_hw_state(), DiscrepancyOpInfo::op_id, DesignFlowStep::output_level, OUTPUT_LEVEL_MINIMUM, OUTPUT_LEVEL_NONE, OUTPUT_LEVEL_VERBOSE, DesignFlowStep::parameters, parse_discrepancy(), vcd_parser::parse_vcd(), possibly_lost_address, present_state_name, print_cpu_time(), print_discrepancy(), print_failed_vcd_head(), vcd_trace_head::running, soft_discr_list, START_PORT_NAME, START_TIME, vcd_trace_head::state, DiscrepancyOpInfo::stg_fun_id, STOP_TIME, STR, SUCCESS, vcd_trace_head::suspended, lenet_tvm::target, THROW_ASSERT, THROW_ERROR, THROW_UNREACHABLE, THROW_WARNING, TM, and vcd_trace_head::uninitialized.
|
protected |
Definition at line 175 of file vcd_utility.cpp.
References CLOCK_PORT_NAME, Discr, get_signal_variations(), HIERARCHY_SEPARATOR, STR, THROW_ASSERT, and THROW_ERROR.
Referenced by Exec().
|
overridevirtual |
Check if this step has actually to be executed.
Implements DesignFlowStep.
Definition at line 524 of file vcd_utility.cpp.
|
protected |
Definition at line 1079 of file vcd_utility.cpp.
References DiscrepancyLog::base_index, DiscrepancyLog::bitsize, DiscrepancyLog::c_val, tree_helper::CGetType(), compute_fsm_state_from_vcd_string(), DiscrepancyLog::context, Discr, DISCR_ADDR, DISCR_COMPLEX, DISCR_VECTOR, DiscrepancyLog::fu_name, DiscrepancyLog::fullsigname, DiscrepancyLog::fun_id, GET_NODE, HLS_step::HLSMgr, INDENT_OUT_MEX, max, DiscrepancyLog::op_end_time, DiscrepancyLog::op_id, DiscrepancyLog::op_start_state, DiscrepancyLog::op_start_time, DesignFlowStep::output_level, tree_helper::Size(), DiscrepancyLog::ssa_id, DiscrepancyLog::stmt_string, STR, THROW_ASSERT, TM, DiscrepancyLog::type, and DiscrepancyLog::vcd_val.
Referenced by Exec().
|
protected |
Definition at line 1196 of file vcd_utility.cpp.
References compute_fsm_state_from_vcd_string(), vcd_trace_head::fail_none, vcd_trace_head::failed, vcd_trace_head::fsm_ss_it, vcd_trace_head::fullsigname, vcd_trace_head::function_does_not_start, INDENT_OUT_MEX, vcd_trace_head::no_end_state, vcd_trace_head::no_start_state, vcd_trace_head::op_end_time, DiscrepancyOpInfo::op_id, vcd_trace_head::op_info, vcd_trace_head::op_start_time, DesignFlowStep::output_level, vcd_trace_head::state, DiscrepancyOpInfo::stg_fun_id, STR, and THROW_UNREACHABLE.
Referenced by Exec().
|
protected |
Definition at line 708 of file vcd_utility.cpp.
References DISCR_ADDR, discr_list, HLS_step::HLSMgr, vcd_trace_head::op_end_time, vcd_trace_head::op_info, DesignFlowStep::parameters, soft_discr_list, and DiscrepancyOpInfo::type.
Referenced by detect_mismatch(), and detect_mismatch_simple().
|
protected |
Definition at line 125 of file vcd_utility.hpp.
Referenced by detect_regular_mismatch().
|
protected |
Definition at line 119 of file vcd_utility.hpp.
Referenced by detect_address_mismatch(), detect_fixed_address_mismatch(), Exec(), GetClockPeriod(), and print_discrepancy().
|
protected |
Definition at line 127 of file vcd_utility.hpp.
Referenced by Exec(), and update_discr_list().
|
protected |
Definition at line 123 of file vcd_utility.hpp.
Referenced by detect_mismatch_simple(), and Exec().
|
protected |
Definition at line 121 of file vcd_utility.hpp.
Referenced by detect_address_mismatch(), and Exec().
|
protected |
The name of the present state signal.
Definition at line 132 of file vcd_utility.hpp.
Referenced by Exec().
|
protected |
Definition at line 129 of file vcd_utility.hpp.
Referenced by Exec(), and update_discr_list().
|
protected |
Definition at line 117 of file vcd_utility.hpp.
Referenced by detect_address_mismatch(), detect_fixed_address_mismatch(), detect_regular_mismatch(), Exec(), and print_discrepancy().