PandA-2024.02
Public Member Functions | Protected Member Functions | Protected Attributes
vcd_utility Class Reference

#include <vcd_utility.hpp>

Inheritance diagram for vcd_utility:
Inheritance graph
[legend]
Collaboration diagram for vcd_utility:
Collaboration graph
[legend]

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< DiscrepancyLogdiscr_list
 
std::list< DiscrepancyLogsoft_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 DesignFlowManagerdesign_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_Typecommand_line_name_to_enum
 Map hls step name to enum. More...
 

Detailed Description

Definition at line 96 of file vcd_utility.hpp.

Constructor & Destructor Documentation

◆ vcd_utility()

vcd_utility::vcd_utility ( const ParameterConstRef  parameters,
const HLS_managerRef  HLSMgr,
const DesignFlowManagerConstRef  design_flow_manager 
)

◆ ~vcd_utility()

vcd_utility::~vcd_utility ( )
overridedefault

Member Function Documentation

◆ compute_fsm_state_from_vcd_string()

std::string vcd_utility::compute_fsm_state_from_vcd_string ( const std::string &  vcd_state_string,
bool  one_hot_encoding 
) const
protected

Definition at line 1255 of file vcd_utility.cpp.

References STR.

Referenced by print_discrepancy(), and print_failed_vcd_head().

Here is the caller graph for this function:

◆ ComputeHLSRelationships()

const CustomUnorderedSet< std::tuple< HLSFlowStep_Type, HLSFlowStepSpecializationConstRef, HLSFlowStep_Relationship > > vcd_utility::ComputeHLSRelationships ( const DesignFlowStep::RelationshipType  relationship_type) const
overrideprotectedvirtual

Return the set of analyses in relationship with this design step.

Parameters
relationship_typeis 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.

◆ detect_address_mismatch()

bool vcd_utility::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 
)
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ detect_binary_double_mismatch()

bool vcd_utility::detect_binary_double_mismatch ( const std::string &  c_val,
const std::string &  resized_vcd_val 
) const
protected

Definition at line 821 of file vcd_utility.cpp.

References DesignFlowStep::parameters, STR, and THROW_ASSERT.

Referenced by detect_regular_mismatch().

Here is the caller graph for this function:

◆ detect_binary_float_mismatch()

bool vcd_utility::detect_binary_float_mismatch ( const std::string &  c_val,
const std::string &  resized_vcd_val 
) const
protected

Definition at line 766 of file vcd_utility.cpp.

References DesignFlowStep::parameters, STR, and THROW_ASSERT.

Referenced by detect_regular_mismatch().

Here is the caller graph for this function:

◆ detect_fixed_address_mismatch()

bool vcd_utility::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
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ detect_mismatch()

bool vcd_utility::detect_mismatch ( const vcd_trace_head t,
const uint64_t  c_context,
const std::string &  c_val 
)
protected

◆ detect_mismatch_element()

bool vcd_utility::detect_mismatch_element ( const vcd_trace_head t,
const uint64_t  c_context,
const std::string &  c_val,
const unsigned int  el_idx 
)
protected

◆ detect_mismatch_simple()

bool vcd_utility::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 
)
protected

◆ detect_regular_mismatch()

bool vcd_utility::detect_regular_mismatch ( const vcd_trace_head t,
const std::string &  c_val,
const std::string &  vcd_val 
) const
protected

◆ Exec()

DesignFlowStep_Status vcd_utility::Exec ( )
overridevirtual

◆ GetClockPeriod()

unsigned long long vcd_utility::GetClockPeriod ( const vcd_parser::vcd_trace_t vcd_trace) const
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ HasToBeExecuted()

bool vcd_utility::HasToBeExecuted ( ) const
overridevirtual

Check if this step has actually to be executed.

Returns
true if the step has to be executed

Implements DesignFlowStep.

Definition at line 524 of file vcd_utility.cpp.

◆ print_discrepancy()

void vcd_utility::print_discrepancy ( const DiscrepancyLog l,
bool  one_hot_encoding,
const int  verbosity 
) const
protected

◆ print_failed_vcd_head()

void vcd_utility::print_failed_vcd_head ( const vcd_trace_head t,
bool  one_hot_encoding,
const int  verbosity 
) const
protected

◆ update_discr_list()

void vcd_utility::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 
)
protected

Field Documentation

◆ allow_uninitialized

bool vcd_utility::allow_uninitialized
protected

Definition at line 125 of file vcd_utility.hpp.

Referenced by detect_regular_mismatch().

◆ Discr

const DiscrepancyRef vcd_utility::Discr
protected

◆ discr_list

std::list<DiscrepancyLog> vcd_utility::discr_list
protected

Definition at line 127 of file vcd_utility.hpp.

Referenced by Exec(), and update_discr_list().

◆ mismatched_integers

unsigned long long vcd_utility::mismatched_integers {0}
protected

Definition at line 123 of file vcd_utility.hpp.

Referenced by detect_mismatch_simple(), and Exec().

◆ possibly_lost_address

unsigned long long vcd_utility::possibly_lost_address {0}
protected

Definition at line 121 of file vcd_utility.hpp.

Referenced by detect_address_mismatch(), and Exec().

◆ present_state_name

std::string vcd_utility::present_state_name
protected

The name of the present state signal.

Definition at line 132 of file vcd_utility.hpp.

Referenced by Exec().

◆ soft_discr_list

std::list<DiscrepancyLog> vcd_utility::soft_discr_list
protected

Definition at line 129 of file vcd_utility.hpp.

Referenced by Exec(), and update_discr_list().

◆ TM

const tree_managerRef vcd_utility::TM
protected

The documentation for this class was generated from the following files:

Generated on Mon Feb 12 2024 13:04:09 for PandA-2024.02 by doxygen 1.8.13