summaryrefslogtreecommitdiff
path: root/src/cpu/trace/trace_cpu.hh
diff options
context:
space:
mode:
authorRadhika Jagtap <radhika.jagtap@ARM.com>2015-12-07 16:42:16 -0600
committerRadhika Jagtap <radhika.jagtap@ARM.com>2015-12-07 16:42:16 -0600
commit3080bbcc365e6ed663787a4c06cd2b7c4a118d47 (patch)
treea73d051d5aa5a26d0e64d348a7f121e089ebc139 /src/cpu/trace/trace_cpu.hh
parent9bd5051b6022249f95364ef30b100b69ac7e7c37 (diff)
downloadgem5-3080bbcc365e6ed663787a4c06cd2b7c4a118d47.tar.xz
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.
Diffstat (limited to 'src/cpu/trace/trace_cpu.hh')
-rw-r--r--src/cpu/trace/trace_cpu.hh22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/cpu/trace/trace_cpu.hh b/src/cpu/trace/trace_cpu.hh
index 3a869ebe0..751321491 100644
--- a/src/cpu/trace/trace_cpu.hh
+++ b/src/cpu/trace/trace_cpu.hh
@@ -561,6 +561,9 @@ class TraceCPU : public BaseCPU
/** Node ROB number type. */
typedef uint64_t NodeRobNum;
+ typedef ProtoMessage::InstDepRecord::RecordType RecordType;
+ typedef ProtoMessage::InstDepRecord Record;
+
/**
* The struct GraphNode stores an instruction in the trace file. The
* format of the trace file favours constructing a dependency graph of
@@ -589,11 +592,8 @@ class TraceCPU : public BaseCPU
/** ROB occupancy number */
NodeRobNum robNum;
- /** If instruction is a load */
- bool isLoad;
-
- /** If instruction is a store */
- bool isStore;
+ /** Type of the node corresponding to the instruction modelled by it */
+ RecordType type;
/** The address for the request if any */
Addr addr;
@@ -632,6 +632,15 @@ class TraceCPU : public BaseCPU
*/
std::vector<GraphNode *> dependents;
+ /** Is the node a load */
+ bool isLoad() const { return (type == Record::LOAD); }
+
+ /** Is the node a store */
+ bool isStore() const { return (type == Record::STORE); }
+
+ /** Is the node a compute (non load/store) node */
+ bool isComp() const { return (type == Record::COMP); }
+
/** Initialize register dependency array to all zeroes */
void clearRegDep();
@@ -656,6 +665,9 @@ class TraceCPU : public BaseCPU
* TraceCPUData.
*/
void writeElementAsTrace() const;
+
+ /** Return string specifying the type of the node */
+ std::string typeToStr() const;
};
/** Struct to store a ready-to-execute node and its execution tick. */