summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatteo Andreozzi <Matteo.Andreozzi@arm.com>2016-02-24 04:16:55 -0500
committerMatteo Andreozzi <Matteo.Andreozzi@arm.com>2016-02-24 04:16:55 -0500
commit496a8c6c924b2b970eafa941b2617aca789ebe3c (patch)
tree90a45d9dc2ae8f362405a088e060ccd8262ea4f5
parente2cea54deb1a06bb38e669937bf5f6aad24220c4 (diff)
downloadgem5-496a8c6c924b2b970eafa941b2617aca789ebe3c.tar.xz
cpu: TraceGen fix for tick frequency check
Bug fix for check on protobuf file frequency being different than global frequency. The ASCII encoder script is also fixed, and the example trace used in the regressions is updated.
-rw-r--r--src/cpu/testers/traffic_gen/generators.cc8
-rw-r--r--tests/quick/se/70.tgen/tgen-simple-mem.trc4
-rwxr-xr-xutil/encode_packet_trace.py2
3 files changed, 6 insertions, 8 deletions
diff --git a/src/cpu/testers/traffic_gen/generators.cc b/src/cpu/testers/traffic_gen/generators.cc
index 300bcc122..75de2f957 100644
--- a/src/cpu/testers/traffic_gen/generators.cc
+++ b/src/cpu/testers/traffic_gen/generators.cc
@@ -420,11 +420,9 @@ TraceGen::InputStream::init()
ProtoMessage::PacketHeader header_msg;
if (!trace.read(header_msg)) {
panic("Failed to read packet header from trace\n");
-
- if (header_msg.tick_freq() != SimClock::Frequency) {
- panic("Trace was recorded with a different tick frequency %d\n",
- header_msg.tick_freq());
- }
+ } else if (header_msg.tick_freq() != SimClock::Frequency) {
+ panic("Trace was recorded with a different tick frequency %d\n",
+ header_msg.tick_freq());
}
}
diff --git a/tests/quick/se/70.tgen/tgen-simple-mem.trc b/tests/quick/se/70.tgen/tgen-simple-mem.trc
index 58f0e1115..9a3425ea8 100644
--- a/tests/quick/se/70.tgen/tgen-simple-mem.trc
+++ b/tests/quick/se/70.tgen/tgen-simple-mem.trc
@@ -1,2 +1,2 @@
-gem51
-)Converted ASCII trace tgen-simple-mem.trc 犍 @  @ \ No newline at end of file
+gem5)
+ Converted ASCII trace output.txt 犍 @  @ \ No newline at end of file
diff --git a/util/encode_packet_trace.py b/util/encode_packet_trace.py
index bee26f01c..0734d43c8 100755
--- a/util/encode_packet_trace.py
+++ b/util/encode_packet_trace.py
@@ -105,7 +105,7 @@ def main():
header = packet_pb2.PacketHeader()
header.obj_id = "Converted ASCII trace " + sys.argv[1]
# Assume the default tick rate
- header.tick_freq = 1000000000
+ header.tick_freq = 1000000000000
protolib.encodeMessage(proto_out, header)
# For each line in the ASCII trace, create a packet message and