Hi Andreas,

Yes, I came across that script earlier in the day, and was able to decode
the tracefile. To note in case others run into problems, I had to also
install python-protobuf for the packet_pb2.py package to find protobuffer
library (essentially it was needed to run the script). The part about
generating packet_pb2.py is noted in the script notes, and the part about
needing proto-compiler is noted when building gem5, but nothing about
python-protobuf.

As a side note, after I got the communication monitor working, I used the
encoding/decoding part to capture ruby prefetch packets. In that case,
there is no master/slave wiring where a CommMonitor can be inserted in
between (the ruby cache/ruby prefetcher have direct pointer to enqueue
messages rather than going through ports, so I just used the the
protobuffer message class to write out to a Outprotostream.

To get that to compile, I had to change the package name of packet.proto to
something other than 'Message' (in my case I changed it to MessageTrace)
because Ruby has a Message class which confuses gcc (package Message
generates a Message namespace, and so it conflicts with the Ruby Message
Class.

Malek




On Mon, Sep 9, 2013 at 9:50 PM, Andreas Hansson <andreas.hans...@arm.com>wrote:

>  Hi Malek,
>
>  My bad for not getting any documentation onto the Wiki yet. Have a look
> at util/decode_packet_trace which shows you how to decode the information
> using python. You could also have a look at the TrafficGen and the
> ProtoInputStream to see how the decoding is done.
>
>  protoc is used to generate a Python module (or C++ class) for encoding
> decoding, and this is then used at run-time. I am not familiar with the
> "--encode" functionality of protoc as it is not something I have ever used.
>
>  Let me know if there are any issues.
>
>  Andreas
>
>   From: Malek Musleh <malek.mus...@gmail.com>
> Reply-To: gem5 users mailing list <gem5-users@gem5.org>
> Date: Sunday, 8 September 2013 21:01
> To: gem5 users mailing list <gem5-users@gem5.org>
> Subject: [gem5-users] Using Protobuf for reading CommMonitor Trace
>
>   Hi,
>
>  I am using the CommMonitor component to look at a trace of memory
> address references between the cpu/cache. I seem to have connected it
> properly, as in my output directory I see a protobuf binary file generated
> for each monitor: e.g.  monitor_0.ptrc,  monitor_1.ptrc, etc.
>
>  This file generated is a protobuf binary file, but its not clear how I
> am supposed to use protoc to read in/print out the contents. It looks like
> I have to specify message format from the packet.proto file located in
> /src/proto/, but when using the following commandline:
>
>  $ protoc --encode=packet.proto monitor_0.ptrc
>
>  monitor_0.ptrc:2:48983: Invalid control characters encountered in text.
> monitor_0.ptrc:2:48991: Invalid control characters encountered in text.
> monitor_0.ptrc:2:48993: Invalid control characters encountered in text.
> monitor_0.ptrc:2:49002: Invalid control characters encountered in text.
>
>  I am guessing the format of the text should look like the contents
> in: tests/quick/se/70.tgen/tgen-simple-dram.cfg
>
>  Can someone indicate the proper way to do this? I don't see any
> documentation/info on the wiki about TrafficGen/CommMonitor.
>
>  Thanks,
>
>  Malek
>
> -- IMPORTANT NOTICE: The contents of this email and any attachments are
> confidential and may also be privileged. If you are not the intended
> recipient, please notify the sender immediately and do not disclose the
> contents to any other person, use it for any purpose, or store or copy the
> information in any medium. Thank you.
>
> ARM Limited, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ,
> Registered in England & Wales, Company No: 2557590
> ARM Holdings plc, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ,
> Registered in England & Wales, Company No: 2548782
>
> _______________________________________________
> gem5-users mailing list
> gem5-users@gem5.org
> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
>
_______________________________________________
gem5-users mailing list
gem5-users@gem5.org
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users

Reply via email to