MatchLib
Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members

Matchlib Module class: a wrapper of sc_module with tracing and stats support. More...

#include <nvhls_module.h>

Inheritance diagram for match::Module:
nvhls_message

Public Member Functions

 Module (sc_module_name nm)
 
void SetTraceLevel (int l)
 
bool HasStats ()
 
bool ChildrenHaveStats ()
 
void DumpStats (std::ostream &ofile, unsigned int lvl, Module *aggregator)
 
template<unsigned int Size>
void Marshall (Marshaller< Size > &m)
 

Public Attributes

sc_in_clk clk
 
sc_in< bool > rst
 
sc_attr_base * module_indicator
 

Static Public Attributes

static const unsigned int width = 0
 

Protected Member Functions

bool IsModule (sc_object *obj)
 
std::vector< Module * > GetChildren ()
 
void IncrStat (const std::string &name, unsigned int num=1)
 
void IncrStatIndexed (const std::string &name, unsigned int idx, unsigned int num=1)
 
TracerT (int l=0)
 
TracerASSERT (bool cond)
 
void RecordEvent (const std::string &name, uint64 param=0)
 
void PrintStats (std::ostream &ofile, unsigned int lvl, Module *aggregator)
 
void Indent (std::ostream &ofile, unsigned int lvl)
 

Protected Attributes

std::map< std::string, uint64 > stats_
 
Tracer tracer_
 
Flusher EndT
 

Detailed Description

Matchlib Module class: a wrapper of sc_module with tracing and stats support.

A Simple Example
#include <nvhls_module.h>
class CrossbarModuleConnectionsInterface : public match::Module {
public:
...
void Process();
SC_HAS_PROCESS(CrossbarModuleConnectionsInterface);
CrossbarModuleConnectionsInterface(sc_module_name name_)
: match::Module(name_) {
SC_THREAD(Process);
sensitive << clk.pos();
async_reset_signal_is(rst, false);
this->SetTraceLevel(2); // Set trace level
}
};
void CrossbarModuleConnectionsInterface::Process() {
...
while(1) {
wait();
T(1) << " Entered DUT" << EndT; // Trace print statements
#pragma hls_unroll yes
for(int inp_lane=0; inp_lane<NumInputLanes; inp_lane++) {
data_in_reg[inp_lane] = data_in[inp_lane].Pop();
T(2) << "data_in[" << inp_lane << "] = " << data_in_reg[inp_lane] << EndT;
}
...
}
}

Definition at line 107 of file nvhls_module.h.


The documentation for this class was generated from the following file: