aboutsummaryrefslogtreecommitdiffstats
path: root/decoder/include/opencsd/etmv4/trc_pkt_elem_etmv4i.h
diff options
context:
space:
mode:
Diffstat (limited to 'decoder/include/opencsd/etmv4/trc_pkt_elem_etmv4i.h')
-rw-r--r--decoder/include/opencsd/etmv4/trc_pkt_elem_etmv4i.h40
1 files changed, 28 insertions, 12 deletions
diff --git a/decoder/include/opencsd/etmv4/trc_pkt_elem_etmv4i.h b/decoder/include/opencsd/etmv4/trc_pkt_elem_etmv4i.h
index 02adfc51aa75..8ccf36b373db 100644
--- a/decoder/include/opencsd/etmv4/trc_pkt_elem_etmv4i.h
+++ b/decoder/include/opencsd/etmv4/trc_pkt_elem_etmv4i.h
@@ -57,14 +57,7 @@ class Etmv4PktAddrStack
public:
Etmv4PktAddrStack()
{
- for (int i = 0; i < 3; i++)
- {
- m_v_addr[i].pkt_bits = 0;
- m_v_addr[i].size = VA_64BIT;
- m_v_addr[i].val = 0;
- m_v_addr[i].valid_bits = 0;
- m_v_addr_ISA[i] = 0;
- }
+ reset_stack();
}
~Etmv4PktAddrStack() {};
@@ -87,6 +80,20 @@ public:
}
}
+ // explicit reset for TInfo.
+ void reset_stack()
+ {
+ for (int i = 0; i < 3; i++)
+ {
+ m_v_addr[i].pkt_bits = 0;
+ m_v_addr[i].size = OCSD_MAX_VA_BITSIZE == 64 ? VA_64BIT : VA_32BIT;
+ m_v_addr[i].val = 0;
+ m_v_addr[i].valid_bits = OCSD_MAX_VA_BITSIZE;
+ m_v_addr_ISA[i] = 0;
+ }
+
+ }
+
private:
ocsd_pkt_vaddr m_v_addr[3]; //!< most recently broadcast address packet
uint8_t m_v_addr_ISA[3];
@@ -172,6 +179,7 @@ public:
// atom
const ocsd_pkt_atom &getAtom() const { return atom; };
+ const int getNumAtoms() const { return atom.num; };
// context
const etmv4_context_t &getContext() const { return context; };
@@ -188,6 +196,10 @@ public:
// cc
const uint32_t getCC() const { return pkt_valid.bits.cc_valid ? cycle_count : 0; };
+ // speculation
+ const int getCommitElem() const { return commit_elements; };
+ const int getCancelElem() const { return cancel_elements; };
+
// packet type
const bool isBadPacket() const;
@@ -227,6 +239,10 @@ inline void EtmV4ITrcPacket::clearTraceInfo()
// set these as defaults - if they don't appear in TINFO this is the state.
setTraceInfo(0);
setTraceInfoSpec(0);
+
+ // explicitly reset the stack & zero the current address.
+ m_addr_stack.reset_stack();
+ m_addr_stack.get_idx(0, v_addr, v_addr_ISA);
}
inline void EtmV4ITrcPacket::setTraceInfo(const uint32_t infoVal)
@@ -450,17 +466,17 @@ inline void EtmV4ITrcPacket::set32BitAddress(const uint32_t addr, const uint8_t
if (pkt_valid.bits.context_valid && context.SF)
{
v_addr.size = VA_64BIT;
- if (v_addr.valid_bits < 32) // may be updating a 64 bit address so only set 32 if currently less.
- v_addr.valid_bits = 32;
v_addr.val = (v_addr.val & ~mask) | (addr & mask);
}
else
{
v_addr.val = addr;
v_addr.size = VA_32BIT;
- v_addr.valid_bits = 32;
}
-
+
+ if (v_addr.valid_bits < 32) // may be updating a 64 bit address so only set 32 if currently less.
+ v_addr.valid_bits = 32;
+
v_addr_ISA = IS;
push_vaddr();
}