MatchLib
All Classes Namespaces Files Functions Modules Pages
Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
match::Module Class Reference

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;
}
...
}
}
Matchlib Module class: a wrapper of sc_module with tracing and stats support.

Definition at line 107 of file nvhls_module.h.

Constructor & Destructor Documentation

◆ Module() [1/2]

match::Module::Module ( )
inline

Definition at line 116 of file nvhls_module.h.

◆ Module() [2/2]

match::Module::Module ( sc_module_name  nm)
inline

Definition at line 122 of file nvhls_module.h.

◆ ~Module()

match::Module::~Module ( )
inline

Definition at line 129 of file nvhls_module.h.

Member Function Documentation

◆ IsModule()

bool match::Module::IsModule ( sc_object *  obj)
inlineprotected

Definition at line 147 of file nvhls_module.h.

◆ GetChildren()

std::vector< Module * > match::Module::GetChildren ( )
inlineprotected

Definition at line 168 of file nvhls_module.h.

◆ IncrStat()

void match::Module::IncrStat ( const std::string &  name,
unsigned int  num = 1 
)
inlineprotected

Definition at line 185 of file nvhls_module.h.

◆ IncrStatIndexed()

void match::Module::IncrStatIndexed ( const std::string &  name,
unsigned int  idx,
unsigned int  num = 1 
)
inlineprotected

Definition at line 191 of file nvhls_module.h.

◆ T()

Tracer & match::Module::T ( int  l = 0)
inlineprotected

Definition at line 200 of file nvhls_module.h.

◆ ASSERT()

Tracer & match::Module::ASSERT ( bool  cond)
inlineprotected

Definition at line 243 of file nvhls_module.h.

◆ SetTraceLevel()

void match::Module::SetTraceLevel ( int  l)
inline

Definition at line 263 of file nvhls_module.h.

◆ RecordEvent()

void match::Module::RecordEvent ( const std::string &  name,
uint64  param = 0 
)
inlineprotected

Definition at line 274 of file nvhls_module.h.

◆ PrintStats()

void match::Module::PrintStats ( std::ostream &  ofile,
unsigned int  lvl,
Module aggregator 
)
inlineprotected

Definition at line 281 of file nvhls_module.h.

◆ Indent()

void match::Module::Indent ( std::ostream &  ofile,
unsigned int  lvl 
)
inlineprotected

Definition at line 293 of file nvhls_module.h.

◆ HasStats()

bool match::Module::HasStats ( )
inline

Definition at line 302 of file nvhls_module.h.

◆ ChildrenHaveStats()

bool match::Module::ChildrenHaveStats ( )
inline

Definition at line 309 of file nvhls_module.h.

◆ DumpStats()

void match::Module::DumpStats ( std::ostream &  ofile,
unsigned int  lvl,
Module aggregator 
)
inline

Definition at line 324 of file nvhls_module.h.

◆ Marshall()

template<unsigned int Size>
void match::Module::Marshall ( Marshaller< Size > &  m)
inline

Definition at line 358 of file nvhls_module.h.

Member Data Documentation

◆ clk

sc_in_clk match::Module::clk

Definition at line 110 of file nvhls_module.h.

◆ rst

sc_in<bool> match::Module::rst

Definition at line 111 of file nvhls_module.h.

◆ module_indicator

sc_attr_base* match::Module::module_indicator

Definition at line 113 of file nvhls_module.h.

◆ stats_

std::map<std::string, uint64> match::Module::stats_
protected

Definition at line 139 of file nvhls_module.h.

◆ tracer_

Tracer match::Module::tracer_
protected

Definition at line 141 of file nvhls_module.h.

◆ EndT

Flusher match::Module::EndT
protected

Definition at line 142 of file nvhls_module.h.

◆ width

const unsigned int match::Module::width = 0
static

Definition at line 356 of file nvhls_module.h.


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