summaryrefslogtreecommitdiff
path: root/src/cpu/trace/trace_cpu.cc
diff options
context:
space:
mode:
authorRadhika Jagtap <radhika.jagtap@arm.com>2016-09-15 18:01:09 +0100
committerRadhika Jagtap <radhika.jagtap@arm.com>2016-09-15 18:01:09 +0100
commitd7724d5f542b3ffcb1de05bc2960c820c7b96c85 (patch)
tree4c20416e4fe1af9cf023621d4f510d4068959b7d /src/cpu/trace/trace_cpu.cc
parentfb349aa984daf39831cde68611bd196057cb1b48 (diff)
downloadgem5-d7724d5f542b3ffcb1de05bc2960c820c7b96c85.tar.xz
cpu: Add frequency scaling to the Trace CPU
This change adds a simple feature to scale the frequency of the Trace CPU. The compute delays in the input traces provide timing. This change adds a freqency multiplier parameter to the Trace CPU set to 1.0 by default. The compute delay is manipulated to effectively achieve the frequency at which the nodes become ready and thus scale the frequency of the Trace CPU. Change-Id: Iaabbd57806941ad56094fcddbeb38fcee1172431 Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Diffstat (limited to 'src/cpu/trace/trace_cpu.cc')
-rw-r--r--src/cpu/trace/trace_cpu.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/cpu/trace/trace_cpu.cc b/src/cpu/trace/trace_cpu.cc
index e81a79818..42620a177 100644
--- a/src/cpu/trace/trace_cpu.cc
+++ b/src/cpu/trace/trace_cpu.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 - 2015 ARM Limited
+ * Copyright (c) 2013 - 2016 ARM Limited
* All rights reserved
*
* The license below extends only to copyright in the software and shall
@@ -56,8 +56,7 @@ TraceCPU::TraceCPU(TraceCPUParams *params)
dataTraceFile(params->dataTraceFile),
icacheGen(*this, ".iside", icachePort, instMasterID, instTraceFile),
dcacheGen(*this, ".dside", dcachePort, dataMasterID, dataTraceFile,
- params->sizeROB, params->sizeStoreBuffer,
- params->sizeLoadBuffer),
+ params),
icacheNextEvent(this),
dcacheNextEvent(this),
oneTraceComplete(false),
@@ -1225,8 +1224,11 @@ TraceCPU::DcachePort::recvReqRetry()
owner->dcacheRetryRecvd();
}
-TraceCPU::ElasticDataGen::InputStream::InputStream(const std::string& filename)
+TraceCPU::ElasticDataGen::InputStream::InputStream(
+ const std::string& filename,
+ const double time_multiplier)
: trace(filename),
+ timeMultiplier(time_multiplier),
microOpCount(0)
{
// Create a protobuf message for the header and read it from the stream
@@ -1259,7 +1261,8 @@ TraceCPU::ElasticDataGen::InputStream::read(GraphNode* element)
// Required fields
element->seqNum = pkt_msg.seq_num();
element->type = pkt_msg.type();
- element->compDelay = pkt_msg.comp_delay();
+ // Scale the compute delay to effectively scale the Trace CPU frequency
+ element->compDelay = pkt_msg.comp_delay() * timeMultiplier;
// Repeated field robDepList
element->clearRobDep();