From: Gabe Black Date: Thu, 25 Jan 2018 08:03:26 +0000 (-0800) Subject: cpu: Make the protobuf inst tracer accept variable sized instructions. X-Git-Tag: v19.0.0.0~2217 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d28bc0f946fcb7d6ad90b74f917db9fa9d311191;p=gem5.git 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 Maintainer: Gabe Black --- 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;