32#include "debug/RubyCacheTrace.hh"
45 out <<
"[TraceRecord: Node, " <<
m_cntrl_id <<
", "
51 : m_uncompressed_trace(NULL),
52 m_uncompressed_trace_size(0),
53 m_block_size_bytes(
RubySystem::getBlockSizeBytes())
58 uint64_t uncompressed_trace_size,
60 uint64_t block_size_bytes)
61 : m_uncompressed_trace(uncompressed_trace),
62 m_uncompressed_trace_size(uncompressed_trace_size),
63 m_seq_map(seq_map), m_bytes_read(0), m_records_read(0),
64 m_records_flushed(0), m_block_size_bytes(block_size_bytes)
71 panic(
"Recorded cache block size (%d) < current block size (%d) !!",
99 assert(m_sequencer_ptr != NULL);
102 DPRINTF(RubyCacheTrace,
"Flushing %s\n", *rec);
115 DPRINTF(RubyCacheTrace,
"Issuing %s\n", *traceRecord);
122 if (traceRecord->
m_type == RubyRequestType_LD) {
124 req = std::make_shared<Request>(
128 }
else if (traceRecord->
m_type == RubyRequestType_IFETCH) {
130 req = std::make_shared<Request>(
136 req = std::make_shared<Request>(
146 assert(m_sequencer_ptr != NULL);
180 uint64_t current_size = 0;
183 for (
int i = 0;
i < size; ++
i) {
185 if (current_size + record_size > total_size) {
186 uint8_t* new_buf =
new (std::nothrow) uint8_t[total_size * 2];
187 if (new_buf == NULL) {
188 fatal(
"Unable to allocate buffer of size %s\n",
191 total_size = total_size * 2;
192 uint8_t* old_buf = *buf;
193 memcpy(new_buf, old_buf, current_size);
199 memcpy(&((*buf)[current_size]),
m_records[
i], record_size);
200 current_size += record_size;
Command
List of all commands associated with a packet.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
void dataStatic(T *p)
Set the data pointer to the following value that should not be freed.
@ INST_FETCH
The request was an instruction fetch.
@ funcRequestorId
This requestor id is used for functional requests that don't come from a particular device.
uint64_t aggregateRecords(uint8_t **data, uint64_t size)
uint64_t getNumRecords() const
void addRecord(int cntrl, Addr data_addr, Addr pc_addr, RubyRequestType type, Tick time, DataBlock &data)
uint64_t m_records_flushed
uint64_t m_block_size_bytes
std::vector< TraceRecord * > m_records
void enqueueNextFetchRequest()
Function for fetching warming up the memory and the caches.
uint8_t * m_uncompressed_trace
std::vector< Sequencer * > m_seq_map
void enqueueNextFlushRequest()
Function for flushing the memory contents of the caches to the main memory.
uint64_t m_uncompressed_trace_size
static uint32_t getBlockSizeBytes()
RequestStatus makeRequest(PacketPtr pkt) override
Class for recording cache contents.
void print(std::ostream &out) const
#define panic(...)
This implements a cprintf based panic() function.
#define fatal(...)
This implements a cprintf based fatal() function.
bool compareTraceRecords(const TraceRecord *n1, const TraceRecord *n2)
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
std::shared_ptr< Request > RequestPtr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
uint64_t Tick
Tick count type.