58                                                      unsigned int function_id, 
vertex ,
    60                                                      const std::vector<ModuleGenerator::parameter>& ,
    61                                                      const std::vector<ModuleGenerator::parameter>& ,
    62                                                      const std::vector<ModuleGenerator::parameter>& ,
    63                                                      const std::vector<ModuleGenerator::parameter>& )
    71    const auto arg_name = mod_cir->
get_id().substr(
sizeof(
"if_handshake_") - 1
U, std::string::npos);
    73    const auto top_fname = HLSMgr->CGetFunctionBehavior(function_id)->CGetBehavioralHelper()->GetMangledFunctionName();
    74    const auto& iface_attrs = HLSMgr->module_arch->GetArchitecture(top_fname)->ifaces.at(arg_name);
    76    const std::string in_suffix = if_dir == port_o::IO ? 
"_i" : 
"";
    77    const std::string out_suffix = if_dir == port_o::IO ? 
"_o" : 
"";
    78    std::string np_library = mod_cir->
get_id() + 
" index";
    79    std::vector<std::string> ip_components;
    80    const auto add_port_parametric = [&](
const std::string& suffix, 
port_o::port_direction dir, 
unsigned port_size) {
    81       const auto port_name = arg_name + suffix;
    84       np_library += 
" " + port_name;
    86    out << 
"localparam BITSIZE_data=BITSIZE_" << arg_name << (in_suffix.size() ? in_suffix : out_suffix) << 
";\n";
    87    if(if_dir == port_o::IN)
    89       out << 
"assign tb_done_port = 1'b1;\n\n";
    91    if(if_dir == port_o::IN || if_dir == port_o::IO)
    93       add_port_parametric(in_suffix, port_o::OUT, 1
U);
    94       add_port_parametric(in_suffix + 
"_vld", port_o::OUT, 0
U);
    95       add_port_parametric(in_suffix + 
"_ack", port_o::IN, 0
U);
    96       ip_components.push_back(
"TestbenchFifoRead");
    97       out << 
"TestbenchFifoRead #(.index(index),\n"    98           << 
"  .CHECK_ACK(1),\n"    99           << 
"  .BITSIZE_dout(BITSIZE_data)) fifo_read(.clock(clock),\n"   100           << 
"  .setup_port(setup_port),\n"   101           << 
"  .done_port(done_port),\n"   102           << 
"  .empty_n(" << arg_name << in_suffix << 
"_vld),\n"   103           << 
"  .read(" << arg_name << in_suffix << 
"_ack),\n"   104           << 
"  .dout(" << arg_name << in_suffix << 
"));\n";
   106    if(if_dir == port_o::OUT || if_dir == port_o::IO)
   108       add_port_parametric(out_suffix, port_o::IN, 1
U);
   109       add_port_parametric(out_suffix + 
"_vld", port_o::IN, 0
U);
   110       add_port_parametric(out_suffix + 
"_ack", port_o::OUT, 0
U);
   111       ip_components.push_back(
"TestbenchFifoWrite");
   112       out << 
"wire _full_n;\n\n"   113           << 
"assign " << arg_name << out_suffix << 
"_ack = _full_n;\n"   114           << 
"assign tb_done_port = ~_full_n;\n\n"   115           << 
"TestbenchFifoWrite #(.index(index),\n"   116           << 
"  .BITSIZE_din(BITSIZE_data)) fifo_write(.clock(clock),\n"   117           << 
"  .setup_port(setup_port),\n"   118           << 
"  .done_port(done_port),\n"   119           << 
"  .full_n(_full_n),\n"   120           << 
"  .write(" << arg_name << out_suffix << 
"_vld),\n"   121           << 
"  .din(" << arg_name << out_suffix << 
"));\n";
 Data structure representing the entire HLS information. 
 
refcount< structural_type_descriptor > structural_type_descriptorRef
RefCount type definition of the structural_type_descriptor class structure. 
 
Structure representing the most relevant information about the type of a structural object...
 
const std::string & get_id() const
Return the identifier associated with the structural_object. 
 
port_direction
Enumerative type describing the direction of a port. 
 
#define THROW_UNREACHABLE(str_expr)
helper function used to specify that some points should never be reached 
 
static void add_NP_functionality(structural_objectRef cir, NP_functionality::NP_functionaly_type dt, std::string functionality_description)
Add a not-parsed functionality. 
 
This class writes different HDL based descriptions (VHDL, Verilog, SystemC) starting from a structura...
 
static port_direction to_port_direction(const std::string &val)
Convert a string into the corresponding port_direction enumerative type. 
 
static structural_objectRef add_port(const std::string &id, port_o::port_direction pdir, structural_objectRef owner, structural_type_descriptorRef type_descr, unsigned int treenode=0)
Create a new port. 
 
boost::graph_traits< graph >::vertex_descriptor vertex
vertex definition. 
 
This file collects some utility functions and macros. 
 
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
 
Template borrowed from the ANTLR library by Terence Parr (http://www.jGuru.com - Software rights: htt...
 
std::string container_to_string(_InputIt first, _InputIt last, const std::string &separator, bool trim_empty=true)
 
Class implementation of the structural_manager. 
 
TestbenchHandshakeModuleGenerator(const HLS_managerRef &HLSMgr)
 
A brief description of the C++ Header File.