32#include "debug/RubyCacheTrace.hh"
47 out <<
"[TraceRecord: Node, " <<
m_cntrl_id <<
", "
53 : m_uncompressed_trace(NULL),
54 m_uncompressed_trace_size(0),
55 m_block_size_bytes(
RubySystem::getBlockSizeBytes())
60 uint64_t uncompressed_trace_size,
62 uint64_t block_size_bytes)
63 : m_uncompressed_trace(uncompressed_trace),
64 m_uncompressed_trace_size(uncompressed_trace_size),
65 m_ruby_port_map(ruby_port_map), m_bytes_read(0),
66 m_records_read(0), m_records_flushed(0),
67 m_block_size_bytes(block_size_bytes)
75 panic(
"Recorded cache block size (%d) < current block size (%d) !!",
105 assert(m_ruby_port_ptr != NULL);
108 DPRINTF(RubyCacheTrace,
"Flushing %s\n", *rec);
125 DPRINTF(RubyCacheTrace,
"Issuing %s\n", *traceRecord);
132 if (traceRecord->
m_type == RubyRequestType_LD) {
134 req = std::make_shared<Request>(
138 }
else if (traceRecord->
m_type == RubyRequestType_IFETCH) {
140 req = std::make_shared<Request>(
146 req = std::make_shared<Request>(
159 assert(m_ruby_port_ptr != NULL);
185 DPRINTF(RubyCacheTrace,
"Inside addRecord with cntrl id %d and type %d\n",
196 uint64_t current_size = 0;
199 for (
int i = 0;
i < size; ++
i) {
201 if (current_size + record_size > total_size) {
202 uint8_t* new_buf =
new (std::nothrow) uint8_t[total_size * 2];
203 if (new_buf == NULL) {
204 fatal(
"Unable to allocate buffer of size %s\n",
207 total_size = total_size * 2;
208 uint8_t* old_buf = *buf;
209 memcpy(new_buf, old_buf, current_size);
215 memcpy(&((*buf)[current_size]),
m_records[
i], record_size);
216 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.
RequestPtr req
A pointer to the original request.
@ 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
void enqueueNextFlushRequest()
Function for flushing the memory contents of the caches to the main memory.
std::vector< RubyPort * > m_ruby_port_map
uint64_t m_uncompressed_trace_size
virtual RequestStatus makeRequest(PacketPtr pkt)=0
static uint32_t getBlockSizeBytes()
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)
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
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.
void exitSimLoop(const std::string &message, int exit_code, Tick when, Tick repeat, bool serialize)
Schedule an event to exit the simulation loop (returning to Python) at the end of the current cycle (...
Declaration of the Packet class.