summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2018-01-25 00:03:26 -0800
committerGabe Black <gabeblack@google.com>2018-03-22 18:29:37 +0000
commitd28bc0f946fcb7d6ad90b74f917db9fa9d311191 (patch)
tree28d0fbafd391b77f50ee48ae27a1d9199c5e6ae1 /src
parent8f1a604ec3ba2c54bbceef8d3ac188aa59d3a78e (diff)
downloadgem5-d28bc0f946fcb7d6ad90b74f917db9fa9d311191.tar.xz
cpu: Make the protobuf inst tracer accept variable sized instructions.
This change adds an inst_bytes field which is of type bytes, and puts it in a oneof with the previously required inst field. If an instruction's encoding happens to be 4 bytes long, the original inst field will be used. Otherwise, the new variably sized inst_bytes field will be used. Because this tracer doesn't have visibility into how the data in inst_bytes is structured, it can't do any endian conversion itself. To maintain compatibility between producers and consumers who may have different endiannesses, all data should be manually converted to little endian before being stored in this field. inst will be converted into little endian by protobuf, and so compatibility doesn't have to be handled manually. Change-Id: I290713f70e7124d8aa9550c022c71334939d84a6 Reviewed-on: https://gem5-review.googlesource.com/7561 Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/proto/inst.proto5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/proto/inst.proto b/src/proto/inst.proto
index 5ef266455..d561661f1 100644
--- a/src/proto/inst.proto
+++ b/src/proto/inst.proto
@@ -52,7 +52,10 @@ message InstHeader {
message Inst {
required uint64 pc = 1;
- required fixed32 inst = 2;
+ oneof inst_oneof {
+ fixed32 inst = 2;
+ bytes inst_bytes = 9;
+ }
optional uint32 nodeid = 3;
optional uint32 cpuid = 4;
optional fixed64 tick = 5;