PandA-2024.02
|
#include <VcdSignalSelection.hpp>
Public Member Functions | |
VcdSignalSelection (const ParameterConstRef _parameters, const HLS_managerRef HLSMgr, const DesignFlowManagerConstRef design_flow_manager) | |
Constructor. More... | |
~VcdSignalSelection () override | |
Destructor. More... | |
DesignFlowStep_Status | Exec () override |
Executes 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 | |
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... | |
void | SelectInitialAddrParam (const CustomOrderedSet< unsigned int > &reached_body_fun_ids, CustomUnorderedMap< unsigned int, TreeNodeSet > &address_parameters) |
Selects the initial set of function parameters to skip, iterating on the reached functions with a body and inserting the parm_decl tree_nodes in param_to_skip. More... | |
void | InitialSsaIsAddress (const tree_nodeConstRef &tn, const CustomUnorderedSet< unsigned int > &addr_fun_ids, const CustomUnorderedMap< unsigned int, UnorderedSetStdStable< unsigned int >> &call_id_to_called_id) |
Determines if the tree_node tn assigns an ssa_name representing an address. More... | |
void | InitialPhiResIsAddress (const tree_nodeConstRef &tn) |
Determines if the tree_node tn assigns an ssa_name representing an address. More... | |
void | SelectInitialSsa (const CustomOrderedSet< unsigned int > &reached_body_fun_ids, const CustomUnorderedSet< unsigned int > &addr_fun_ids, const CustomUnorderedMap< unsigned int, UnorderedSetStdStable< unsigned int >> &call_id_to_called_id) |
Selects the initial set of ssa to skip, iterating on the reached functions with a body and inserting the ssa tree_nodes in ssa_to_skip. More... | |
void | SingleStepPropagateParamToSsa (const TreeNodeMap< size_t > &used_ssa, const TreeNodeSet &address_parameters) |
Single step used in the loop of PropagateAddrParamToSsa() More... | |
void | PropagateAddrParamToSsa (const CustomUnorderedMap< unsigned int, TreeNodeSet > &address_parameters, const CustomOrderedSet< unsigned int > &reached_body_fun_ids) |
Propagates the information on the ssa to skip to all the ssa in the functions with body. More... | |
void | SingleStepPropagateAddrSsa (const tree_nodeRef &curr_tn) |
Single step used in the loop of PropagateAddrSsa() More... | |
void | PropagateAddrSsa () |
Propagates the information on the ssa representing addresses across all the ssa in the functions with body. More... | |
void | DetectInvalidReturns (const CustomOrderedSet< unsigned int > &reached_body_functions, CustomUnorderedSet< unsigned int > &addr_fun_ids) |
Detects return statements resulting in values to be skipped in the discrepancy analysis. More... | |
void | InProcedurePropagateAddr (const CustomUnorderedMap< unsigned int, TreeNodeSet > &address_parameters, const CustomOrderedSet< unsigned int > &reached_body_functions, CustomUnorderedSet< unsigned int > &addr_fun_ids) |
Propagates the information on the ssa to skip to all the ssa in the functions with body. More... | |
void | CrossPropagateAddrSsa (CustomUnorderedMap< unsigned int, TreeNodeSet > &address_parameters, const CustomOrderedSet< unsigned int > &reached_body_functions, const CustomUnorderedSet< unsigned int > &addr_fun_ids, const CustomUnorderedMap< unsigned int, UnorderedSetStdStable< unsigned int >> &fu_id_to_call_ids, const CustomUnorderedMap< unsigned int, UnorderedSetStdStable< unsigned int >> &call_id_to_called_id) |
Propagates the information on the parameters to skip across function calls. More... | |
void | SelectAddrSsa (const CustomUnorderedMap< unsigned int, UnorderedSetStdStable< unsigned int >> &fu_id_to_call_ids, const CustomUnorderedMap< unsigned int, UnorderedSetStdStable< unsigned int >> &call_id_to_called_id) |
Compute the ssa representing address values. More... | |
bool | IsAddressType (const unsigned int type_index) const |
Checks if type_index represents an address type. More... | |
void | SelectInternalSignals (CustomUnorderedMap< unsigned int, UnorderedSetStdStable< std::string >> &fun_id_to_sig_names) const |
Protected Attributes | |
const tree_managerRef | TM |
const DiscrepancyRef | Discr |
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 45 of file VcdSignalSelection.hpp.
VcdSignalSelection::VcdSignalSelection | ( | const ParameterConstRef | _parameters, |
const HLS_managerRef | _HLSMgr, | ||
const DesignFlowManagerConstRef | _design_flow_manager | ||
) |
Constructor.
Definition at line 62 of file VcdSignalSelection.cpp.
References DesignFlowStep::debug_level, GET_CLASS, HLS_step::HLSMgr, DesignFlowStep::parameters, STR, THROW_ASSERT, VERILOG, and ~VcdSignalSelection().
|
overridedefault |
|
overrideprotectedvirtual |
Return the set of analyses in relationship with this design step.
Reimplemented from HLS_step.
Definition at line 88 of file VcdSignalSelection.cpp.
References CALL_GRAPH_UNFOLDING, DesignFlowStep::DEPENDENCE_RELATIONSHIP, HW_PATH_COMPUTATION, DesignFlowStep::INVALIDATION_RELATIONSHIP, DesignFlowStep::PRECEDENCE_RELATIONSHIP, THROW_UNREACHABLE, and TOP_FUNCTION.
|
protected |
Propagates the information on the parameters to skip across function calls.
If a function is called with a parameter which is a ssa marked to skip, then the parm_decl associated to that paramter must be marked to skip. This propagation is based on the ssa names already marked to be skipped
[in,out] | address_parameters | Set of parm_decl tree_nodes of the parameters to skip |
[in] | reached_body_functions | List of the ids of the reached functions with body |
[in] | addr_fun_ids | List of ids of the reached functions that return an address value |
[in] | fu_id_to_call_ids | Maps a function id to the set of ids of operations where it calls other functions |
[in] | call_id_to_called_id | Maps the id of a call operation to the id of the called function |
Definition at line 546 of file VcdSignalSelection.cpp.
References BUILTIN_WAIT_CALL, FunctionBehavior::CGetBehavioralHelper(), FunctionBehavior::CGetOpGraph(), OpGraph::CGetOpGraphInfo(), OpGraph::CGetOpNodeInfo(), Discr, FunctionBehavior::FCFG, BehavioralHelper::function_has_to_be_printed(), BehavioralHelper::get_function_name(), tree_node::get_kind(), GET_NODE, BehavioralHelper::has_implementation(), HLS_step::HLSMgr, BehavioralHelper::is_operating_system_function(), BehavioralHelper::is_var_args(), MEMCPY, STR, THROW_ASSERT, THROW_WARNING, and TM.
Referenced by SelectAddrSsa().
|
protected |
Detects return statements resulting in values to be skipped in the discrepancy analysis.
[in] | reached_body_functions | List of the ids of the reached functions with body |
[in,out] | addr_fun_ids | List of ids of the reached functions that return an address value |
Definition at line 500 of file VcdSignalSelection.cpp.
References OpGraph::CGetInEdges(), FunctionBehavior::CGetOpGraph(), OpGraph::CGetOpGraphInfo(), OpGraph::CGetOpNodeInfo(), Discr, ENTRY_ID, EXIT_ID, FunctionBehavior::FCFG, GET_INDEX_NODE, tree_node::get_kind(), GET_NODE, tree_helper::get_type_index(), HLS_step::HLSMgr, IsAddressType(), and TM.
Referenced by InProcedurePropagateAddr().
|
overridevirtual |
Executes the step.
Implements DesignFlowStep.
Definition at line 919 of file VcdSignalSelection.cpp.
References CLOCK_PORT_NAME, DesignFlowStep::debug_level, DEBUG_LEVEL_PEDANTIC, Discr, DONE_PORT_NAME, tree_helper::get_base_index(), tree_helper::get_type_index(), HIERARCHY_SEPARATOR, HLS_step::HLSMgr, INDENT_OUT_MEX, IsAddressType(), DesignFlowStep::output_level, OUTPUT_LEVEL_VERBOSE, DesignFlowStep::parameters, present_state_name, PRINT_DBG_MEX, SelectAddrSsa(), SelectInternalSignals(), START_PORT_NAME, STR, SUCCESS, THROW_ASSERT, and TM.
|
overridevirtual |
Check if this step has actually to be executed.
Implements DesignFlowStep.
Definition at line 1026 of file VcdSignalSelection.cpp.
|
protected |
Determines if the tree_node tn assigns an ssa_name representing an address.
[in] | tn | The node to analyze |
Definition at line 231 of file VcdSignalSelection.cpp.
References gimple_phi::CGetDefEdgesList(), Discr, tree_node::get_kind(), GET_NODE, tree_node::GetString(), tree_node::index, phi, gimple_phi::res, STR, THROW_ASSERT, and tree_node::ToString().
Referenced by SelectInitialSsa().
|
protected |
Determines if the tree_node tn assigns an ssa_name representing an address.
The ssa to be skipped at the beginning are
[in] | tn | The node to analyze |
[in] | addr_fun_ids | List of ids of the reached functions that return an address value |
[in] | call_id_to_called_id | Map the id of a call to the id of the called function |
Definition at line 137 of file VcdSignalSelection.cpp.
References Discr, GET_INDEX_NODE, tree_node::get_kind(), GET_NODE, tree_helper::get_type_index(), tree_node::GetString(), tree_node::index, tree_helper::is_a_complex(), tree_helper::is_real(), IsAddressType(), DesignFlowStep::parameters, STR, THROW_ASSERT, TM, and tree_node::ToString().
Referenced by SelectInitialSsa().
|
protected |
Propagates the information on the ssa to skip to all the ssa in the functions with body.
This propagation is based on the ssa_name and param_decl already marked to skip.
[in] | address_parameters | Set of parm_decl tree_nodes of the parameters to skip |
[in] | reached_body_functions | List of the ids of the reached functions with body |
[in,out] | addr_fun_ids | List of ids of the reached functions that return an address value |
Definition at line 536 of file VcdSignalSelection.cpp.
References DetectInvalidReturns(), PropagateAddrParamToSsa(), and PropagateAddrSsa().
Referenced by SelectAddrSsa().
|
protected |
Checks if type_index represents an address type.
Definition at line 80 of file VcdSignalSelection.cpp.
References tree_helper::GetElements(), tree_helper::is_a_pointer(), tree_helper::is_a_vector(), tree_helper::is_an_array(), and TM.
Referenced by DetectInvalidReturns(), Exec(), InitialSsaIsAddress(), SelectAddrSsa(), SelectInitialAddrParam(), and SelectInitialSsa().
|
protected |
Propagates the information on the ssa to skip to all the ssa in the functions with body.
This propagation mark to skip all the ssa_name tree_nodes wich are referred to a param_decl already marked to be skipped. The propagation is intra procedural.
[in] | address_parameters | Set of parm_decl tree_nodes of the parameters to skip |
[in] | reached_body_functions | List of the ids of the reached functions with body |
Definition at line 358 of file VcdSignalSelection.cpp.
References FunctionBehavior::CGetBehavioralHelper(), FunctionBehavior::CGetOpGraph(), OpGraph::CGetOpNodeInfo(), tree_helper::ComputeSsaUses(), ENTRY_ID, EXIT_ID, FunctionBehavior::FCFG, tree_node::get_kind(), HLS_step::HLSMgr, SingleStepPropagateParamToSsa(), THROW_ASSERT, and TM.
Referenced by InProcedurePropagateAddr().
|
protected |
Propagates the information on the ssa representing addresses across all the ssa in the functions with body.
The propagation is intra procedural.
Definition at line 481 of file VcdSignalSelection.cpp.
References Discr, tree_node::GetString(), SingleStepPropagateAddrSsa(), and THROW_ASSERT.
Referenced by InProcedurePropagateAddr().
|
protected |
Compute the ssa representing address values.
They must be manipulated in a different way by the discrepancy analysis
[in] | fu_id_to_call_ids | Maps a function id to the set of ids of operations where it calls other functions |
[in] | call_id_to_called_id | Maps the id of a call operation to the id of the called function |
Definition at line 743 of file VcdSignalSelection.cpp.
References FunctionBehavior::CGetBehavioralHelper(), CrossPropagateAddrSsa(), Discr, BehavioralHelper::GetFunctionReturnType(), HLS_step::HLSMgr, InProcedurePropagateAddr(), IsAddressType(), SelectInitialAddrParam(), and SelectInitialSsa().
Referenced by Exec().
|
protected |
Selects the initial set of function parameters to skip, iterating on the reached functions with a body and inserting the parm_decl tree_nodes in param_to_skip.
[in] | reached_body_fun_ids | List of ids of the reached functions with body |
[out] | address_parameters | The set of parm_decl tree_nodes representing addresses |
Definition at line 115 of file VcdSignalSelection.cpp.
References GET_INDEX_NODE, tree_node::get_kind(), GET_NODE, tree_helper::get_type_index(), tree_node::GetString(), IsAddressType(), THROW_ASSERT, TM, and tree_node::ToString().
Referenced by SelectAddrSsa().
|
protected |
Selects the initial set of ssa to skip, iterating on the reached functions with a body and inserting the ssa tree_nodes in ssa_to_skip.
[in] | reached_body_fun_ids | List of ids of the reached functions with body |
[in] | addr_fun_ids | List of ids of the reached functions that return an address value |
[in] | call_id_to_called_id | Map the id of a call to the id of the called function |
Definition at line 250 of file VcdSignalSelection.cpp.
References FunctionBehavior::CGetBehavioralHelper(), FunctionBehavior::CGetOpGraph(), OpGraph::CGetOpNodeInfo(), Discr, ENTRY_ID, EXIT_ID, FunctionBehavior::FCFG, tree_node::get_kind(), tree_helper::get_type_index(), HLS_step::HLSMgr, InitialPhiResIsAddress(), InitialSsaIsAddress(), tree_helper::is_a_complex(), tree_helper::is_real(), IsAddressType(), THROW_ASSERT, and TM.
Referenced by SelectAddrSsa().
|
protected |
Definition at line 807 of file VcdSignalSelection.cpp.
References Discr, ENTRY_ID, EXIT_ID, FunctionBehavior::FCFG, refcount< T >::get(), GET_NAME, HLS_step::HLSMgr, phi, starts_with(), STR, THROW_ASSERT, TM, and WRAPPED_PROXY_PREFIX.
Referenced by Exec().
|
protected |
Single step used in the loop of PropagateAddrSsa()
Definition at line 400 of file VcdSignalSelection.cpp.
References gimple_phi::CGetDefEdgesList(), tree_helper::CGetType(), Discr, GET_CONST_NODE, GET_INDEX_NODE, tree_node::get_kind(), GET_NODE, tree_node::GetString(), tree_node::index, tree_helper::is_a_complex(), tree_helper::is_a_vector(), tree_helper::is_real(), phi, gimple_phi::res, STR, THROW_ASSERT, TM, and tree_node::ToString().
Referenced by PropagateAddrSsa().
|
protected |
Single step used in the loop of PropagateAddrParamToSsa()
Definition at line 327 of file VcdSignalSelection.cpp.
References Discr, GET_NODE, tree_node::GetString(), THROW_ASSERT, and tree_node::ToString().
Referenced by PropagateAddrParamToSsa().
|
protected |
Definition at line 50 of file VcdSignalSelection.hpp.
Referenced by CrossPropagateAddrSsa(), DetectInvalidReturns(), Exec(), InitialPhiResIsAddress(), InitialSsaIsAddress(), PropagateAddrSsa(), SelectAddrSsa(), SelectInitialSsa(), SelectInternalSignals(), SingleStepPropagateAddrSsa(), and SingleStepPropagateParamToSsa().
|
protected |
The name of the present state signal.
Definition at line 53 of file VcdSignalSelection.hpp.
Referenced by Exec().
|
protected |
Definition at line 48 of file VcdSignalSelection.hpp.
Referenced by CrossPropagateAddrSsa(), DetectInvalidReturns(), Exec(), InitialSsaIsAddress(), IsAddressType(), PropagateAddrParamToSsa(), SelectInitialAddrParam(), SelectInitialSsa(), SelectInternalSignals(), and SingleStepPropagateAddrSsa().