gem5  v21.1.0.2
Public Member Functions | Private Attributes | List of all members
gem5::TraceCPU::ElasticDataGen::InputStream Class Reference

The InputStream encapsulates a trace file and the internal buffers and populates GraphNodes based on the input. More...

Public Member Functions

 InputStream (const std::string &filename, const double time_multiplier)
 Create a trace input stream for a given file name. More...
 
void reset ()
 Reset the stream such that it can be played once again. More...
 
bool read (GraphNode *element)
 Attempt to read a trace element from the stream, and also notify the caller if the end of the file was reached. More...
 
uint32_t getWindowSize () const
 Get window size from trace. More...
 
uint64_t getMicroOpCount () const
 Get number of micro-ops modelled in the TraceCPU replay. More...
 

Private Attributes

ProtoInputStream trace
 Input file stream for the protobuf trace. More...
 
const double timeMultiplier
 A multiplier for the compute delays in the trace to modulate the Trace CPU frequency either up or down. More...
 
uint64_t microOpCount
 Count of committed ops read from trace plus the filtered ops. More...
 
uint32_t windowSize
 The window size that is read from the header of the protobuf trace and used to process the dependency trace. More...
 

Detailed Description

The InputStream encapsulates a trace file and the internal buffers and populates GraphNodes based on the input.

Definition at line 761 of file trace_cpu.hh.

Constructor & Destructor Documentation

◆ InputStream()

gem5::TraceCPU::ElasticDataGen::InputStream::InputStream ( const std::string &  filename,
const double  time_multiplier 
)

Create a trace input stream for a given file name.

Parameters
filenamePath to the file to read from
time_multiplierused to scale the compute delays

Definition at line 1197 of file trace_cpu.cc.

References gem5::sim_clock::Frequency, panic, ProtoInputStream::read(), trace, and windowSize.

Member Function Documentation

◆ getMicroOpCount()

uint64_t gem5::TraceCPU::ElasticDataGen::InputStream::getMicroOpCount ( ) const
inline

Get number of micro-ops modelled in the TraceCPU replay.

Definition at line 815 of file trace_cpu.hh.

References microOpCount.

Referenced by gem5::TraceCPU::ElasticDataGen::getMicroOpCount().

◆ getWindowSize()

uint32_t gem5::TraceCPU::ElasticDataGen::InputStream::getWindowSize ( ) const
inline

Get window size from trace.

Definition at line 812 of file trace_cpu.hh.

References windowSize.

◆ read()

bool gem5::TraceCPU::ElasticDataGen::InputStream::read ( GraphNode element)

◆ reset()

void gem5::TraceCPU::ElasticDataGen::InputStream::reset ( )

Reset the stream such that it can be played once again.

Definition at line 1220 of file trace_cpu.cc.

References reset(), and gem5::TraceCPU::ElasticDataGen::trace.

Referenced by gem5::TraceCPU::ElasticDataGen::exit(), and reset().

Member Data Documentation

◆ microOpCount

uint64_t gem5::TraceCPU::ElasticDataGen::InputStream::microOpCount
private

Count of committed ops read from trace plus the filtered ops.

Definition at line 776 of file trace_cpu.hh.

Referenced by getMicroOpCount().

◆ timeMultiplier

const double gem5::TraceCPU::ElasticDataGen::InputStream::timeMultiplier
private

A multiplier for the compute delays in the trace to modulate the Trace CPU frequency either up or down.

The Trace CPU's clock domain frequency must also be set to match the expected result of frequency scaling.

Definition at line 773 of file trace_cpu.hh.

◆ trace

ProtoInputStream gem5::TraceCPU::ElasticDataGen::InputStream::trace
private

Input file stream for the protobuf trace.

Definition at line 765 of file trace_cpu.hh.

Referenced by InputStream().

◆ windowSize

uint32_t gem5::TraceCPU::ElasticDataGen::InputStream::windowSize
private

The window size that is read from the header of the protobuf trace and used to process the dependency trace.

Definition at line 782 of file trace_cpu.hh.

Referenced by getWindowSize(), and InputStream().


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

Generated on Tue Sep 21 2021 12:28:19 for gem5 by doxygen 1.8.17