From: Matteo Andreozzi Date: Wed, 24 Feb 2016 09:16:55 +0000 (-0500) Subject: cpu: TraceGen fix for tick frequency check X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=496a8c6c924b2b970eafa941b2617aca789ebe3c;p=gem5.git 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. --- 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