cpu: TraceGen fix for tick frequency check
authorMatteo Andreozzi <Matteo.Andreozzi@arm.com>
Wed, 24 Feb 2016 09:16:55 +0000 (04:16 -0500)
committerMatteo Andreozzi <Matteo.Andreozzi@arm.com>
Wed, 24 Feb 2016 09:16:55 +0000 (04:16 -0500)
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.

src/cpu/testers/traffic_gen/generators.cc
tests/quick/se/70.tgen/tgen-simple-mem.trc
util/encode_packet_trace.py

index 300bcc1227c5df93f150d78b603452e36f7b0e22..75de2f957595593dc9dbc2b2d912e12b376481d9 100644 (file)
@@ -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());
     }
 }
 
index 58f0e1115fef5608524d175e365830a0b9b3a9e4..9a3425ea89e1b66f3747e6d1e4df2f7b1a7afa14 100644 (file)
@@ -1,2 +1,2 @@
-gem51
-)Converted ASCII trace tgen-simple-mem.trc\18\80\94ëÜ\ 3\f\bè\a\10\ 1\18ç\8a\8d      @\v\b \1f\10\ 4\18ïý\ 2 @
\ No newline at end of file
+gem5)
+ Converted ASCII trace output.txt\18\80 \94¥\8d\1d\f\bè\a\10\ 1\18ç\8a\8d      @\v\b \1f\10\ 4\18ïý\ 2 @
\ No newline at end of file
index bee26f01cb0f630c839498627922a7692ff95a33..0734d43c8ed22f7aee90d1bc8026ac7a657f1198 100755 (executable)
@@ -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