32 #include "debug/RubyCacheTrace.hh" 41 out <<
"[TraceRecord: Node, " << m_cntrl_id <<
", " 42 << m_data_address <<
", " << m_pc_address <<
", " 43 << m_type <<
", Time: " << m_time <<
"]";
47 : m_uncompressed_trace(NULL),
48 m_uncompressed_trace_size(0),
49 m_block_size_bytes(
RubySystem::getBlockSizeBytes())
54 uint64_t uncompressed_trace_size,
56 uint64_t block_size_bytes)
67 panic(
"Recorded cache block size (%d) < current block size (%d) !!",
95 assert(m_sequencer_ptr != NULL);
98 DPRINTF(RubyCacheTrace,
"Flushing %s\n", *rec);
111 DPRINTF(RubyCacheTrace,
"Issuing %s\n", *traceRecord);
118 if (traceRecord->
m_type == RubyRequestType_LD) {
120 req = std::make_shared<Request>(
123 }
else if (traceRecord->
m_type == RubyRequestType_IFETCH) {
125 req = std::make_shared<Request>(
131 req = std::make_shared<Request>(
137 pkt->dataStatic(traceRecord->
m_data + rec_bytes_read);
140 assert(m_sequencer_ptr != NULL);
174 uint64_t current_size = 0;
177 for (
int i = 0;
i < size; ++
i) {
179 if (current_size + record_size > total_size) {
180 uint8_t* new_buf =
new (nothrow) uint8_t[total_size * 2];
181 if (new_buf == NULL) {
182 fatal(
"Unable to allocate buffer of size %s\n",
185 total_size = total_size * 2;
186 uint8_t* old_buf = *buf;
187 memcpy(new_buf, old_buf, current_size);
193 memcpy(&((*buf)[current_size]),
m_records[
i], record_size);
194 current_size += record_size;
void enqueueNextFetchRequest()
Function for fetching warming up the memory and the caches.
#define panic(...)
This implements a cprintf based panic() function.
const uint8_t * getData(int offset, int len) const
#define fatal(...)
This implements a cprintf based fatal() function.
std::shared_ptr< Request > RequestPtr
uint64_t aggregateRecords(uint8_t **data, uint64_t size)
void addRecord(int cntrl, Addr data_addr, Addr pc_addr, RubyRequestType type, Tick time, DataBlock &data)
std::vector< TraceRecord * > m_records
Overload hash function for BasicBlockRange type.
Class for recording cache contents.
std::vector< Sequencer * > m_seq_map
void enqueueNextFlushRequest()
Function for flushing the memory contents of the caches to the main memory.
uint64_t m_records_flushed
uint64_t Tick
Tick count type.
uint64_t m_block_size_bytes
void print(std::ostream &out) const
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
bool compareTraceRecords(const TraceRecord *n1, const TraceRecord *n2)
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
This master id is used for functional requests that don't come from a particular device.
uint8_t * m_uncompressed_trace
The request was an instruction fetch.
uint64_t m_uncompressed_trace_size
Command
List of all commands associated with a packet.
RequestStatus makeRequest(PacketPtr pkt)
static uint32_t getBlockSizeBytes()
ProbePointArg< PacketInfo > Packet
Packet probe point.