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

Tracer class to dump simulation stats to an output stream (stdout by default). More...

#include <nvhls_trace.h>

Public Member Functions

 Tracer (std::ostream *o=NULL)
 
 Tracer (const Tracer &other)
 
Traceroperator= (const Tracer &other)
 
template<typename T_MSG >
Traceroperator<< (T_MSG t)
 
Traceroperator<< (std::ostream &(*f)(std::ostream &))
 
Traceroperator<< (Tracer &(*f)(Tracer &))
 
Traceroperator<< (Flusher &endt)
 
TracerFlushBuffer ()
 
int GetTraceLevel ()
 
void SetTraceLevel (int l)
 
void SetCurrentLevel (int l)
 
void SetFatal ()
 

Protected Attributes

std::ostream * ostr_
 
int trace_level_
 
int cur_level_
 
bool fatal_
 

Detailed Description

Tracer class to dump simulation stats to an output stream (stdout by default).

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();
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.
#define NVHLS_NEG_RESET_SIGNAL_IS(port)
ENABLE_SYNC_RESET define: Select synchronous or asynchronous reset.

Definition at line 91 of file nvhls_trace.h.

Constructor & Destructor Documentation

◆ Tracer() [1/2]

match::Tracer::Tracer ( std::ostream *  o = NULL)
inlineexplicit

Definition at line 101 of file nvhls_trace.h.

◆ Tracer() [2/2]

match::Tracer::Tracer ( const Tracer other)
inline

Definition at line 117 of file nvhls_trace.h.

Member Function Documentation

◆ operator=()

Tracer & match::Tracer::operator= ( const Tracer other)
inline

Definition at line 126 of file nvhls_trace.h.

◆ operator<<() [1/4]

template<typename T_MSG >
Tracer & match::Tracer::operator<< ( T_MSG  t)
inline

Definition at line 137 of file nvhls_trace.h.

◆ operator<<() [2/4]

Tracer & match::Tracer::operator<< ( std::ostream &(*)(std::ostream &)  f)
inline

Definition at line 144 of file nvhls_trace.h.

◆ operator<<() [3/4]

Tracer & match::Tracer::operator<< ( Tracer &(*)(Tracer &)  f)
inline

Definition at line 152 of file nvhls_trace.h.

◆ operator<<() [4/4]

Tracer & match::Tracer::operator<< ( Flusher endt)
inline

Definition at line 157 of file nvhls_trace.h.

◆ FlushBuffer()

Tracer & match::Tracer::FlushBuffer ( )
inline

Definition at line 162 of file nvhls_trace.h.

◆ GetTraceLevel()

int match::Tracer::GetTraceLevel ( )
inline

Definition at line 176 of file nvhls_trace.h.

◆ SetTraceLevel()

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

Definition at line 184 of file nvhls_trace.h.

◆ SetCurrentLevel()

void match::Tracer::SetCurrentLevel ( int  l)
inline

Definition at line 189 of file nvhls_trace.h.

◆ SetFatal()

void match::Tracer::SetFatal ( )
inline

Definition at line 194 of file nvhls_trace.h.

Member Data Documentation

◆ ostr_

std::ostream* match::Tracer::ostr_
protected

Definition at line 94 of file nvhls_trace.h.

◆ trace_level_

int match::Tracer::trace_level_
protected

Definition at line 95 of file nvhls_trace.h.

◆ cur_level_

int match::Tracer::cur_level_
protected

Definition at line 96 of file nvhls_trace.h.

◆ fatal_

bool match::Tracer::fatal_
protected

Definition at line 97 of file nvhls_trace.h.


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