encode_packet_trace.py (10107:524afa92d940) encode_packet_trace.py (11351:bfc1285c61eb)
1#!/usr/bin/env python
2
3# Copyright (c) 2013-2014 ARM Limited
4# All rights reserved
5#
6# The license below extends only to copyright in the software and shall
7# not be construed as granting a license to any other intellectual
8# property including but not limited to intellectual property relating

--- 91 unchanged lines hidden (view full) ---

100 # Write the magic number in 4-byte Little Endian, similar to what
101 # is done in src/proto/protoio.cc
102 proto_out.write("gem5")
103
104 # Add the packet header
105 header = packet_pb2.PacketHeader()
106 header.obj_id = "Converted ASCII trace " + sys.argv[1]
107 # Assume the default tick rate
1#!/usr/bin/env python
2
3# Copyright (c) 2013-2014 ARM Limited
4# All rights reserved
5#
6# The license below extends only to copyright in the software and shall
7# not be construed as granting a license to any other intellectual
8# property including but not limited to intellectual property relating

--- 91 unchanged lines hidden (view full) ---

100 # Write the magic number in 4-byte Little Endian, similar to what
101 # is done in src/proto/protoio.cc
102 proto_out.write("gem5")
103
104 # Add the packet header
105 header = packet_pb2.PacketHeader()
106 header.obj_id = "Converted ASCII trace " + sys.argv[1]
107 # Assume the default tick rate
108 header.tick_freq = 1000000000
108 header.tick_freq = 1000000000000
109 protolib.encodeMessage(proto_out, header)
110
111 # For each line in the ASCII trace, create a packet message and
112 # write it to the encoded output
113 for line in ascii_in:
114 cmd, addr, size, tick = line.split(',')
115 packet = packet_pb2.Packet()
116 packet.tick = long(tick)

--- 12 unchanged lines hidden ---
109 protolib.encodeMessage(proto_out, header)
110
111 # For each line in the ASCII trace, create a packet message and
112 # write it to the encoded output
113 for line in ascii_in:
114 cmd, addr, size, tick = line.split(',')
115 packet = packet_pb2.Packet()
116 packet.tick = long(tick)

--- 12 unchanged lines hidden ---