Proto commits in darchr/gem5

These 21 commits are when the Protocol Buffers files have changed:

Commit:b09ec2c
Author:Giacomo Travaglini
Committer:Giacomo Travaglini

misc: Remove unused IprAccess OpClass This was used by the alpha ISA and would be the analogous of the newly added SystemOp class Change-Id: Ibb94ec56cdab57e6f8306cd5630c98c16ff2b429 Signed-off-by: Giacomo Travaglini <giacomo.travaglini.arm.com>

Commit:2d0e8ea
Author:Jason Lowe-Power
Committer:GitHub

misc: Update protobuf files to remove required (#2403) The "required" statement is considered bad practice now. So much so that proto3 removed "required" as an option. See the discussion: https://stackoverflow.com/questions/31801257/why-required-and-optional-is-removed-in-protocol-buffers-3 This change converts required to optional. This shouldn't affect any existing traces or gem5's code in any way. Signed-off-by: Jason Lowe-Power <jlowepower@google.com> Co-authored-by: Jason Lowe-Power <jlowepower@google.com>

Commit:505a39d
Author:mbabaie

mem: added all the files

Commit:76b1df3
Author:mbabaie

mem: added all the files

Commit:2bc5a8b
Author:Bobby R. Bruce
Committer:Bobby Bruce

misc: Run pre-commit run on all files in repo The following command was run: ``` pre-commit run --all-files ``` This ensures all the files in the repository are formatted to pass our checks. Change-Id: Ia2fe3529a50ad925d1076a612d60a4280adc40de Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/62572 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Maintainer: Jason Lowe-Power <power.jg@gmail.com> Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>

The documentation is generated from this commit.

Commit:7f1de4e
Author:Daniel R. Carvalho
Committer:Daniel Carvalho

misc: Fix coding style for enum's opening braces The systemc dir was not included in this fix. First it was identified that there were only occurrences at 0, 1, and 2 levels of indentation (and 2 of 2 spaces, 1 of 3 spaces and 2 of 12 spaces), using: grep -nrE --exclude-dir=systemc \ "^ *enum [A-Za-z].* {$" src/ Then the following commands were run to replace: <indent level>enum X ... { by: <indent level>enum X ... <indent level>{ Level 0: grep -nrl --exclude-dir=systemc \ "^enum [A-Za-z].* {$" src/ | \ xargs sed -Ei \ 's/^enum ([A-Za-z].*) \{$/enum \1\n\{/g' Level 1: grep -nrl --exclude-dir=systemc \ "^ enum [A-Za-z].* {$" src/ | \ xargs sed -Ei \ 's/^ enum ([A-Za-z].*) \{$/ enum \1\n \{/g' and so on. Change-Id: Ib186cf379049098ceaec20dfe4d1edcedd5f940d Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br> Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/43326 Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com> Reviewed-by: Gabe Black <gabe.black@gmail.com> Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com> Tested-by: kokoro <noreply+kokoro@google.com>

Commit:0cf61bf
Author:Gabe Black
Committer:Gabe Black

misc: Delete authors lists from proto. Change-Id: I3ec4f28c82de2f006518ca276f761813d08d7977 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/25407 Maintainer: Gabe Black <gabeblack@google.com> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>

Commit:197ae7a
Author:Gabe Black
Committer:Gabe Black

cpu: Stop extracting inst_flags from the machInst. The instruction representation is already encoded in the trace protobuf, so there's no reason to encode a part of it again. This is especially true since this supposedly generic code is extracting the first 8 bits of the machInst, a totally arbitrary set of bits for most ISAs. If certain bits within a machine instruction are actually relevant, the consumer of the trace should be able to interpret the instruction bytes which are already there and extract the same bits within the context of whatever ISA they're appropriate for. Change-Id: Idaebe6a110d7d4812c3d7c434582d5a9470bcec1 Reviewed-on: https://gem5-review.googlesource.com/9401 Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Maintainer: Gabe Black <gabeblack@google.com>

Commit:979b30e
Author:Gabe Black
Committer:Gabe Black

cpu: Proposed fix for backwards compatibility in proto/inst.proto. I haven't tested this at all, but this may fix backwards compatibility in inst.proto by removing the oneof construct. Change-Id: Iba19744791c2c577c3b442402f8cc6dcef8550bd Reviewed-on: https://gem5-review.googlesource.com/9361 Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Gabe Black <gabeblack@google.com>

Commit:d28bc0f
Author:Gabe Black
Committer:Gabe Black

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>

Commit:10cd85c
Author:Gabe Black
Committer:Gabe Black

mem: Add a "map" of packet IDs to strings in probe traces. This map is intended to map from request MasterIDs to master names. It could be used to map to arbitrary strings in other situations, however. The original idea to store this information was to add a new message type which would store one ID and the string associated with it. This change stores the IDs in the header instead so that they'll be easy to find and all available before the packet data. One downside of this approach is that it won't be possible to add new master ID strings as they come up during a trace. If that becomes an issue, the two approaches could be combined and messages could be added which would augment the map in the header. Also worth mentioning is that the proto2 version of the protobuf description language does not support the "map" field type, and the protoc compiler on my workstation doesn't support proto3. Because that's such an appropriate representation for this data, the map is represented in an equivalent format described in the proto3 documentation. Change-Id: I137c8611c33d9ce6589e196d50c8638c1d88750c Reviewed-on: https://gem5-review.googlesource.com/4782 Reviewed-by: Rahul Thakur <rjthakur@google.com> Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com> Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>

Commit:227bdde
Author:Nikos Nikoleris

proto: Fix warnings for protoc v3 protoc v3 introduces a new syntax for proto files and warns when the syntax is not explicitly stated. protoc relies on the fact that undefined preprocessor symbols are explanded to 0 but since we use -Wundef they end up generating warnings. Change-Id: If07abeb54e932469c8f2c4d38634a97fdae40f77 Reviewed-by: Andreas Hansson <andreas.hansson@arm.com> Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Signed-off-by: Jason Lowe-Power <jason@lowepower.com>

Commit:54519fd
Author:Radhika Jagtap

cpu: Support virtual addr in elastic traces This patch adds support to optionally capture the virtual address and asid for load/store instructions in the elastic traces. If they are present in the traces, Trace CPU will set those fields of the request during replay.

Commit:3080bbc
Author:Radhika Jagtap

cpu: Create record type enum for elastic traces This patch replaces the booleans that specified the elastic trace record type with an enum type. The source of change is the proto message for elastic trace where the enum is introduced. The struct definitions in the elastic trace probe listener as well as the Trace CPU replace the boleans with the proto message enum. The patch does not impact functionality, but traces are not compatible with previous version. This is preparation for adding new types of records in subsequent patches.

Commit:de4dc50
Author:Radhika Jagtap

proto, probe: Add elastic trace probe to o3 cpu The elastic trace is a type of probe listener and listens to probe points in multiple stages of the O3CPU. The notify method is called on a probe point typically when an instruction successfully progresses through that stage. As different listener methods mapped to the different probe points execute, relevant information about the instruction, e.g. timestamps and register accesses, are captured and stored in temporary InstExecInfo class objects. When the instruction progresses through the commit stage, the timing and the dependency information about the instruction is finalised and encapsulated in a struct called TraceInfo. TraceInfo objects are collected in a list instead of writing them out to the trace file one a time. This is required as the trace is processed in chunks to evaluate order dependencies and computational delay in case an instruction does not have any register dependencies. By this we achieve a simpler algorithm during replay because every record in the trace can be hooked onto a record in its past. The instruction dependency trace is written out as a protobuf format file. A second trace containing fetch requests at absolute timestamps is written to a separate protobuf format file. If the instruction is not executed then it is not added to the trace. The code checks if the instruction had a fault, if it predicated false and thus previous register values were restored or if it was a load/store that did not have a request (e.g. when the size of the request is zero). In all these cases the instruction is set as executed by the Execute stage and is picked up by the commit probe listener. But a request is not issued and registers are not written. So practically, skipping these should not hurt the dependency modelling. If squashing results in squashing younger instructions, it may happen that the squash probe discards the inst and removes it from the temporary store but execute stage deals with the instruction in the next cycle which results in the execute probe seeing this inst as 'new' inst. A sequence number of the last processed trace record is used to trap these cases and not add to the temporary store. The elastic instruction trace and fetch request trace can be read in and played back by the TraceCPU.

Commit:4eff4fa
Author:Ali Saidi

cpu: add support for outputing a protobuf formatted CPU trace Doesn't support x86 due to static instruction representation. --HG-- rename : src/cpu/CPUTracers.py => src/cpu/InstPBTrace.py

Commit:d07abd9
Author:Nilay Vaish

mem: change the namespace Message to ProtoMessage The namespace Message conflicts with the Message data type used extensively in Ruby. Since Ruby is being moved to the same Master/Slave ports based configuration style as the rest of gem5, this conflict needs to be resolved. Hence, the namespace is being renamed to ProtoMessage.

Commit:c446dc4
Author:Radhika Jagtap

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.

Commit:2123176
Author:Andreas Hansson

mem: Add a generic id field to the packet trace This patch adds an optional generic 64-bit identifier field to the packet trace. This can be used to store the sequential number of the instruction that gave rise to the packet, thread id, master id, "sub"-master within a larger module etc. As the field is optional it has a marginal cost if not used.

Commit:7a57b1b
Author:Andreas Hansson

mem: Add optional request flags to the packet trace This patch adds an optional flags field to the packet trace to encode the request flags that contain information about whether the request is (un)cacheable, instruction fetch, preftech etc.

Commit:f456c79
Author:Andreas Hansson

mem: Add tracing support in the communication monitor This patch adds packet tracing to the communication monitor using a protobuf as the mechanism for creating the trace. If no file is specified, then the tracing is disabled. If a file is specified, then for every packet that is successfully sent, a protobuf message is serialized to the file.