55 #include <boost/algorithm/string.hpp> 58 const DesignFlowManagerConstRef _design_flow_manager,
const ParameterConstRef _parameters)
59 :
VarDeclFix(_AppM, _function_id, _design_flow_manager, _parameters, HDL_VAR_DECL_FIX),
85 const auto hdl_reserved_names = hdl_writer->GetHDLReservedNames();
86 already_examinated_names.insert(hdl_reserved_names.begin(), hdl_reserved_names.end());
89 already_examinated_names.insert(std::string(
"this"));
96 auto* fd = GetPointer<function_decl>(curr_tn);
98 const auto HLSMgr = GetPointer<HLS_manager>(
AppM);
100 for(
const auto&
arg : fd->list_of_args)
104 THROW_ASSERT(GetPointer<identifier_node>(argName),
"unexpected condition");
105 const std::string parm_name = GetPointer<identifier_node>(argName)->strg;
106 recursive_examinate(
arg, already_examinated_decls, already_examinated_names, already_examinated_type_names,
111 THROW_ASSERT(GetPointer<identifier_node>(argName),
"unexpected condition");
112 const std::string parm_name_new = GetPointer<identifier_node>(argName)->strg;
113 const auto func_arch = HLSMgr->module_arch->GetArchitecture(fname);
114 if(func_arch && parm_name != parm_name_new)
116 const auto parm_it = func_arch->parms.find(parm_name);
117 if(parm_it != func_arch->parms.end())
119 func_arch->parms[parm_name_new] = parm_it->second;
120 func_arch->parms.erase(parm_it);
122 if(HLSMgr->design_interface_io.find(fname) != HLSMgr->design_interface_io.end())
124 for(
auto& [bbi, ioOps] : HLSMgr->design_interface_io.find(fname)->second)
126 const auto it = ioOps.find(parm_name);
127 if(it != ioOps.end())
129 ioOps[parm_name_new] = it->second;
#define GET_NODE(t)
Macro used to hide implementation details when accessing a tree_node from another tree_node...
DesignFlowStep_Status InternalExec() override
Fixes the var_decl duplication.
Data structure representing the entire HLS information.
#define GET_CLASS(obj)
Macro returning the actual type of an object.
Definition of the class representing a generic C application.
HDLVarDeclFix(const application_managerRef AppM, unsigned int _function_id, const DesignFlowManagerConstRef design_flow_manager, const ParameterConstRef parameters)
Constructor.
static language_writerRef create_writer(HDLWriter_Language language, const technology_managerConstRef TM, const ParameterConstRef parameters)
Creates the specialization of the writer based on the desired language.
const HDLWriter_Language hdl_writer_type
The hdl language.
static std::string GetMangledFunctionName(const function_decl *fd)
Return the mangled function name.
Auxiliary methods for manipulating string.
This class writes different HDL based descriptions (VHDL, Verilog, SystemC) starting from a structura...
Classes specification of the tree_node data structures.
const ParameterConstRef parameters
Set of input parameters.
DesignFlowStep_Status
The status of a step.
#define DEBUG_LEVEL_NONE
no debugging print is performed.
This file collects some utility functions.
tree_nodeRef GetTreeNode(const unsigned int index) const
Return the index-th tree_node (modifiable version)
Pre-analysis step fixing var_decl duplication and HDL name conflicts.
const unsigned int function_id
The index of the function to be analyzed.
const application_managerRef AppM
The application manager.
Class specification of the tree_reindex support class.
Template borrowed from the ANTLR library by Terence Parr (http://www.jGuru.com - Software rights: htt...
void recursive_examinate(const tree_nodeRef &tn, CustomUnorderedSet< unsigned int > &already_examinated_decls, CustomUnorderedSet< std::string > &already_examinated_names, CustomUnorderedSet< std::string > &already_examinated_type_names, CustomUnorderedSet< unsigned int > &already_visited_ae)
Recursive examinate tree node.
DesignFlowStep_Status InternalExec() override
Fixes the var_decl duplication.
this class is used to manage the command-line or XML options.
const std::string Normalize(const std::string &identifier) const override
Return the normalized identifier; in this class it is the identifier itself.
int debug_level
The debug level.
~HDLVarDeclFix() override
Destructor.
Class specification of the manager of the tree structures extracted from the raw file.
HLS specialization of generic_device.
A brief description of the C++ Header File.
const FunctionBehaviorRef function_behavior
The function behavior of the function to be analyzed.
#define THROW_ASSERT(cond, str_expr)
helper function used to check an assert and if needed to throw an error in a standard way ...