79 const std::vector<ModuleGenerator::parameter>& ,
80 const std::vector<ModuleGenerator::parameter>& _ports_in,
81 const std::vector<ModuleGenerator::parameter>& _ports_out,
82 const std::vector<ModuleGenerator::parameter>& )
88 const auto top_bh = HLSMgr->CGetFunctionBehavior(function_id)->CGetBehavioralHelper();
89 const auto top_fname = top_bh->GetMangledFunctionName();
90 const auto& iface_attrs = HLSMgr->module_arch->GetArchitecture(top_fname)->ifaces.at(bundle_name);
92 if(iface_attrs.find(FunctionArchitecture::iface_register) != iface_attrs.end())
96 out <<
"constant ones : std_logic_vector(\\" << _ports_out[
o_out1].name <<
"\\'range) := (others => '1');\n";
97 out <<
"constant threezeros : std_logic_vector(2 downto 0) := (others => '0');\n";
99 out <<
"process(clock,reset)\n";
100 out <<
" variable \\" << _ports_out[
o_out1].name <<
"_0\\ : std_logic_vector(" 101 << (_ports_out[
o_out1].type_size - 1) <<
" downto 0);\n";
103 out <<
" if (1RESET_VALUE) then\n";
104 out <<
" \\" << _ports_out[
o_out1].name <<
"\\ <= (others => '0');\n";
105 out <<
" elsif (clock'event and clock='1') then\n";
106 out <<
" if(unsigned(" << _ports_in[
i_start].name <<
") /= 0 ) then\n";
107 out <<
" \\" << _ports_out[
o_out1].name <<
"\\ <= std_logic_vector(resize(unsigned(" 108 << _ports_in[
i_in2].name <<
"), " << _ports_out[
o_out1].type_size <<
"));\n";
111 out <<
"end process;\n";
115 out <<
"reg [" << (_ports_out[
o_out1].type_size - 1) <<
":0] " << _ports_out[
o_out1].name <<
";\n";
117 out <<
"always @(posedge clock 1RESET_EDGE)\n";
119 out <<
" if (1RESET_VALUE)\n";
120 out <<
" " << _ports_out[
o_out1].name <<
" <= 0;\n";
121 out <<
" else if(" << _ports_in[
i_start].name <<
")\n";
122 out <<
" " << _ports_out[
o_out1].name <<
" <= " << _ports_in[
i_in2].name <<
";\n";
130 out <<
"begin\n \\" << _ports_out[
o_out1].name <<
"\\ <= std_logic_vector(resize(unsigned(" 131 << _ports_in[
i_in2].name <<
"), " << _ports_out[
o_out1].type_size <<
"));\n";
135 out <<
"assign " << _ports_out[
o_out1].name <<
" = " << _ports_in[
i_in2].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
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.
Template borrowed from the ANTLR library by Terence Parr (http://www.jGuru.com - Software rights: htt...
Write_noneModuleGenerator(const HLS_managerRef &HLSMgr)
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 ...