MatchLib
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.
Definition: nvhls_module.h:107
#define NVHLS_NEG_RESET_SIGNAL_IS(port)
ENABLE_SYNC_RESET define: Select synchronous or asynchronous reset.
Definition: nvhls_module.h:39

Definition at line 91 of file nvhls_trace.h.


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