insttracer.hh (10934:5af8f40d8f2c) insttracer.hh (10935:acd48ddd725f)
1/*
2 * Copyright (c) 2014 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 44 unchanged lines hidden (view full) ---

53
54class ThreadContext;
55
56namespace Trace {
57
58class InstRecord
59{
60 protected:
1/*
2 * Copyright (c) 2014 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 44 unchanged lines hidden (view full) ---

53
54class ThreadContext;
55
56namespace Trace {
57
58class InstRecord
59{
60 protected:
61 typedef TheISA::VectorReg VectorReg;
62
63 Tick when;
64
65 // The following fields are initialized by the constructor and
66 // thus guaranteed to be valid.
67 ThreadContext *thread;
68 // need to make this ref-counted so it doesn't go away before we
69 // dump the record
70 StaticInstPtr staticInst;

--- 23 unchanged lines hidden (view full) ---

94 * since many instructions write multiple values (e.g. destintation
95 * register, flags, status, ...) This only captures the last write.
96 * @TODO fix this and record all destintations that an instruction writes
97 * @see data_status
98 */
99 union {
100 uint64_t as_int;
101 double as_double;
61 Tick when;
62
63 // The following fields are initialized by the constructor and
64 // thus guaranteed to be valid.
65 ThreadContext *thread;
66 // need to make this ref-counted so it doesn't go away before we
67 // dump the record
68 StaticInstPtr staticInst;

--- 23 unchanged lines hidden (view full) ---

92 * since many instructions write multiple values (e.g. destintation
93 * register, flags, status, ...) This only captures the last write.
94 * @TODO fix this and record all destintations that an instruction writes
95 * @see data_status
96 */
97 union {
98 uint64_t as_int;
99 double as_double;
102 VectorReg as_vector;
103 } data;
104
105 /** @defgroup fetch_seq
106 * This records the serial number that the instruction was fetched in.
107 * @see fetch_seq_valid
108 */
109 InstSeqNum fetch_seq;
110

--- 7 unchanged lines hidden (view full) ---

118 * What size of data was written?
119 */
120 enum {
121 DataInvalid = 0,
122 DataInt8 = 1, // set to equal number of bytes
123 DataInt16 = 2,
124 DataInt32 = 4,
125 DataInt64 = 8,
100 } data;
101
102 /** @defgroup fetch_seq
103 * This records the serial number that the instruction was fetched in.
104 * @see fetch_seq_valid
105 */
106 InstSeqNum fetch_seq;
107

--- 7 unchanged lines hidden (view full) ---

115 * What size of data was written?
116 */
117 enum {
118 DataInvalid = 0,
119 DataInt8 = 1, // set to equal number of bytes
120 DataInt16 = 2,
121 DataInt32 = 4,
122 DataInt64 = 8,
126 DataDouble = 3,
127 DataVector = sizeof(VectorReg),
123 DataDouble = 3
128 } data_status;
129
130 /** @ingroup memory
131 * Are the memory fields in the record valid?
132 */
133 bool mem_valid;
134
135 /** @ingroup fetch_seq

--- 36 unchanged lines hidden (view full) ---

172 void setData(uint8_t d) { data.as_int = d; data_status = DataInt8; }
173
174 void setData(int64_t d) { setData((uint64_t)d); }
175 void setData(int32_t d) { setData((uint32_t)d); }
176 void setData(int16_t d) { setData((uint16_t)d); }
177 void setData(int8_t d) { setData((uint8_t)d); }
178
179 void setData(double d) { data.as_double = d; data_status = DataDouble; }
124 } data_status;
125
126 /** @ingroup memory
127 * Are the memory fields in the record valid?
128 */
129 bool mem_valid;
130
131 /** @ingroup fetch_seq

--- 36 unchanged lines hidden (view full) ---

168 void setData(uint8_t d) { data.as_int = d; data_status = DataInt8; }
169
170 void setData(int64_t d) { setData((uint64_t)d); }
171 void setData(int32_t d) { setData((uint32_t)d); }
172 void setData(int16_t d) { setData((uint16_t)d); }
173 void setData(int8_t d) { setData((uint8_t)d); }
174
175 void setData(double d) { data.as_double = d; data_status = DataDouble; }
180 void setData(const VectorReg& v)
181 { data.as_vector = v; data_status = DataVector; }
182
183 void setFetchSeq(InstSeqNum seq)
184 { fetch_seq = seq; fetch_seq_valid = true; }
185
186 void setCPSeq(InstSeqNum seq)
187 { cp_seq = seq; cp_seq_valid = true; }
188
189 void setPredicate(bool val) { predicate = val; }

--- 9 unchanged lines hidden (view full) ---

199
200 Addr getAddr() const { return addr; }
201 Addr getSize() const { return size; }
202 unsigned getFlags() const { return flags; }
203 bool getMemValid() const { return mem_valid; }
204
205 uint64_t getIntData() const { return data.as_int; }
206 double getFloatData() const { return data.as_double; }
176
177 void setFetchSeq(InstSeqNum seq)
178 { fetch_seq = seq; fetch_seq_valid = true; }
179
180 void setCPSeq(InstSeqNum seq)
181 { cp_seq = seq; cp_seq_valid = true; }
182
183 void setPredicate(bool val) { predicate = val; }

--- 9 unchanged lines hidden (view full) ---

193
194 Addr getAddr() const { return addr; }
195 Addr getSize() const { return size; }
196 unsigned getFlags() const { return flags; }
197 bool getMemValid() const { return mem_valid; }
198
199 uint64_t getIntData() const { return data.as_int; }
200 double getFloatData() const { return data.as_double; }
207 const VectorReg &getVectorData() const { return data.as_vector; }
208 int getDataStatus() const { return data_status; }
209
210 InstSeqNum getFetchSeq() const { return fetch_seq; }
211 bool getFetchSeqValid() const { return fetch_seq_valid; }
212
213 InstSeqNum getCpSeq() const { return cp_seq; }
214 bool getCpSeqValid() const { return cp_seq_valid; }
215};

--- 21 unchanged lines hidden ---
201 int getDataStatus() const { return data_status; }
202
203 InstSeqNum getFetchSeq() const { return fetch_seq; }
204 bool getFetchSeqValid() const { return fetch_seq_valid; }
205
206 InstSeqNum getCpSeq() const { return cp_seq; }
207 bool getCpSeqValid() const { return cp_seq_valid; }
208};

--- 21 unchanged lines hidden ---