History log of /gem5/util/protolib.py
Revision Date Author Comments
# 13540:da30e62884ee 10-Jan-2019 Andrea Mondelli <andrea.mondelli@ucf.edu>

misc: updated shabang for python script

The default python on MacOS doesn’t have an alias to python2.
The official python version supported in gem5 is Python2.7.

This patch updates the shabang according to the version required in gem5.

Change-Id: I9533c0f7858b5b3cab0ef101be1ee5cd718105b0
Reviewed-on: https://gem5-review.googlesource.com/c/15375
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>


# 12210:4c6eb3ea3e1a 04-Oct-2017 Gabe Black <gabeblack@google.com>

misc: Small style fix in _EncodeVarint32.

Added spaces around the '|' operator.

Change-Id: I5cb82b98e7d2769605cde141f76a62a6e3c6570d
Reviewed-on: https://gem5-review.googlesource.com/5002
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>


# 12209:2c8d30e495ab 04-Oct-2017 Gabe Black <gabeblack@google.com>

misc: Rename the (De|En)codeVarint function _(De|En)codeVarint32.

DecodeVarint implicitly truncates its inputs to 32 bits, and that should be
obvious from its name, and so not a surprise to the caller. EncodeVarint also
has the suffix added for consistency. Both functions are only used in
protolib.py, so add a _ to make it private (in the python sense) to the
module.

Change-Id: I835295717bb51672351b963fe1227ed619836f22
Reviewed-on: https://gem5-review.googlesource.com/5001
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>


# 12208:621c3f3f80f2 04-Oct-2017 Gabe Black <gabeblack@google.com>

misc: Fix the indentation in DecodeVarint in util/protolib.py.

The DecodeVarint was, as a comment describes, lifted from
google.protobuf.internal.decoder. Unfortunately, the relative indentation of
some lines was changed, changing what scope they fell under. This changed the
behavior of the function, breaking it for multibyte and negative values.

This change restores the correct indentation and fixes the function's
behavior.

Change-Id: If645649506b0fe5a617b37a8202c9ca1c57aaf15
Reviewed-on: https://gem5-review.googlesource.com/5000
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>


# 11828:36b064696175 10-Feb-2017 Jason Lowe-Power <jason@lowepower.com>

misc: Update #!env calls for python to explicit version

In some newer Linux distributions, env python default to Python 3.0. This
patch explicitly uses "python2" instead of just "python" for all scripts
that use #!

Reported-by: Sanchayan Maity <maitysanchayan@gmail.com>
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>


# 10269:82773ace39fa 10-Aug-2014 Radhika Jagtap <radhika.jagtap@ARM.com>

util: Move packet trace file read to protolib

This patch moves the code for opening an input protobuf packet trace into
a function defined in the protobuf library. This is because the code is
commonly used in decode scripts and is independent of the src protobuf
message.


# 10107:524afa92d940 07-Mar-2014 Radhika Jagtap <radhika.jagtap@ARM.com>

mem: Edit proto Packet and enhance the python script

This patch changes the decode script to output the optional fields of
the proto message Packet, namely id and flags. The flags field is set
by the communication monitor.

The id field is useful for CPU trace experiments, e.g. linking the
fetch side to decode side. It had to be renamed because it clashes
with a built in python function id() for getting the "identity" of an
object.

This patch also takes a few common function definitions out from the
multiple scripts and adds them to a protolib python module.