81 unsigned int function_id,
vertex ,
83 const std::vector<ModuleGenerator::parameter>& ,
84 const std::vector<ModuleGenerator::parameter>& _ports_in,
85 const std::vector<ModuleGenerator::parameter>& _ports_out,
86 const std::vector<ModuleGenerator::parameter>& )
98 const auto top_fid = HLSMgr->CGetCallGraphManager()->GetRootFunction(function_id);
99 const auto top_fname = HLSMgr->CGetFunctionBehavior(top_fid)->CGetBehavioralHelper()->GetMangledFunctionName();
100 const auto& iface_attrs = HLSMgr->module_arch->GetArchitecture(top_fname)->ifaces.at(bundle_name);
101 const auto registered = iface_attrs.find(FunctionArchitecture::iface_register) != iface_attrs.end();
105 out <<
"reg acked;\n";
106 out <<
"wire ack_next;\n";
108 out <<
"always @(posedge clock 1RESET_EDGE)\n";
110 out <<
" if (1RESET_VALUE)\n";
112 out <<
" acked <= 0;\n";
116 out <<
" acked <= ack_next;\n";
120 out <<
"assign ack_next = " << _ports_in[
i_ack].name <<
";\n";
122 out <<
"reg started;\n";
123 out <<
"wire started_next;\n\n";
125 out <<
"always @(posedge clock 1RESET_EDGE)\n";
127 out <<
" if (1RESET_VALUE)\n";
129 out <<
" started <= 0;\n";
133 out <<
" started <= started_next;\n";
137 out <<
"assign " << _ports_out[
o_out1].name <<
" = " << _ports_in[
i_in2].name <<
";\n";
141 out <<
"assign started_next = (" << _ports_in[
i_start].name <<
" | started) & ~(started & acked);\n";
142 out <<
"assign " << _ports_out[
o_done].name <<
" = started & acked;\n";
146 out <<
"assign started_next = (" << _ports_in[
i_start].name <<
" | started) & ~" << _ports_in[
i_ack].name
148 out <<
"assign " << _ports_out[
o_done].name <<
" = (" << _ports_in[
i_start].name <<
" | started) & " 149 << _ports_in[
i_ack].name <<
";\n";
Data structure representing the entire HLS information.
#define STR_CST_interface_parameter_keyword
interface_parameter_keyword
const std::string & get_id() const
Return the identifier associated with the structural_object.
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
#define THROW_UNREACHABLE(str_expr)
helper function used to specify that some points should never be reached
This class writes different HDL based descriptions (VHDL, Verilog, SystemC) starting from a structura...
boost::graph_traits< graph >::vertex_descriptor vertex
vertex definition.
This class describes all classes used to represent a structural object.
Write_acknowledgeModuleGenerator(const HLS_managerRef &HLSMgr)
Template borrowed from the ANTLR library by Terence Parr (http://www.jGuru.com - Software rights: htt...
A brief description of the C++ Header File.
#define THROW_ASSERT(cond, str_expr)
helper function used to check an assert and if needed to throw an error in a standard way ...