56 #include <boost/algorithm/string/replace.hpp> 64 const std::vector<ModuleGenerator::parameter>& ,
65 const std::vector<ModuleGenerator::parameter>& ,
66 const std::vector<ModuleGenerator::parameter>& ,
67 const std::vector<ModuleGenerator::parameter>& )
69 const auto FB = HLSMgr->CGetFunctionBehavior(function_id);
71 std::string asm_string = FB->CGetBehavioralHelper()->get_asm_string(cfg->CGetOpNodeInfo(op_v)->GetNodeId());
72 boost::replace_all(asm_string,
"%%",
"&percent;");
73 boost::replace_all(asm_string,
"&percent;",
"%");
74 boost::replace_all(asm_string,
"\\n",
"\n");
75 boost::replace_all(asm_string,
"\\\"",
"\"");
76 boost::replace_all(asm_string,
"\\\'",
"\'");
78 if(asm_string.empty())
80 out <<
"assign done_port = start_port;\n";
89 auto open_curl =
false;
90 auto count_pipes = 0
U;
92 char prec_char =
'\0';
93 for(
auto i = 0
U; i < asm_string.size(); ++i)
95 const auto& current_char = asm_string[i];
96 if(current_char ==
'{' && prec_char !=
'%')
100 else if(current_char ==
'}' && prec_char !=
'%')
105 else if(open_curl && current_char ==
'|' && prec_char !=
'%')
109 else if(open_curl && count_pipes != skip_count)
112 else if(open_curl && count_pipes == skip_count)
120 prec_char = current_char;
Data structure representing the entire HLS information.
void InternalExec(std::ostream &out, structural_objectRef mod, unsigned int function_id, vertex op_v, const HDLWriter_Language language, const std::vector< ModuleGenerator::parameter > &_p, const std::vector< ModuleGenerator::parameter > &_ports_in, const std::vector< ModuleGenerator::parameter > &_ports_out, const std::vector< ModuleGenerator::parameter > &_ports_inout) final
This class writes different HDL based descriptions (VHDL, Verilog, SystemC) starting from a structura...
boost::graph_traits< graph >::vertex_descriptor vertex
vertex definition.
ASMModuleGenerator(const HLS_managerRef &HLSMgr)
Data structures used in operations graph.
Template borrowed from the ANTLR library by Terence Parr (http://www.jGuru.com - Software rights: htt...
A brief description of the C++ Header File.