arch-arm: Remove getters/setters from SelfDebug class
Change-Id: I63e5ed25e453cb8fcb2c39ba0728cc81c499c166 Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com> Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com> Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/31081 Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Maintainer: Andreas Sandberg <andreas.sandberg@arm.com> Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
@@ -90,13 +90,13 @@ SelfDebug::testBreakPoints(ThreadContext *tc, Addr vaddr)
|
||||
Addr pc = vaddr;
|
||||
if (pcst.itstate() != 0x0)
|
||||
pc = pcst.pc();
|
||||
if (p.getEnable() && p.isActive(pc) &&(!to32 || !p.isSet())){
|
||||
if (p.enable && p.isActive(pc) &&(!to32 || !p.onUse)) {
|
||||
const DBGBCR ctr = p.getControlReg(tc);
|
||||
if (p.isEnabled(tc, el, ctr.hmc, ctr.ssc, ctr.pmc)) {
|
||||
bool debug = p.test(tc, pc, el, ctr, false);
|
||||
if (debug){
|
||||
if (to32)
|
||||
p.setOnUse();
|
||||
p.onUse = true;
|
||||
return triggerException(tc, pc);
|
||||
}
|
||||
}
|
||||
@@ -109,7 +109,7 @@ SelfDebug::testBreakPoints(ThreadContext *tc, Addr vaddr)
|
||||
Fault
|
||||
SelfDebug::triggerException(ThreadContext * tc, Addr vaddr)
|
||||
{
|
||||
if (isTo32()) {
|
||||
if (to32) {
|
||||
return std::make_shared<PrefetchAbort>(vaddr,
|
||||
ArmFault::DebugEvent, false,
|
||||
ArmFault::UnknownTran,
|
||||
@@ -134,8 +134,7 @@ SelfDebug::testWatchPoints(ThreadContext *tc, Addr vaddr, bool write,
|
||||
int idxtmp = -1;
|
||||
for (auto &p: arWatchPoints){
|
||||
idxtmp ++;
|
||||
if (p.getEnable())
|
||||
{
|
||||
if (p.enable) {
|
||||
bool debug = p.test(tc, vaddr, el, write, atomic, size);
|
||||
if (debug){
|
||||
return triggerWatchpointException(tc, vaddr, write, cm);
|
||||
@@ -149,7 +148,7 @@ Fault
|
||||
SelfDebug::triggerWatchpointException(ThreadContext *tc, Addr vaddr,
|
||||
bool write, bool cm)
|
||||
{
|
||||
if (isTo32()) {
|
||||
if (to32) {
|
||||
ArmFault::DebugType d = cm? ArmFault::WPOINT_CM:
|
||||
ArmFault::WPOINT_NOCM;
|
||||
return std::make_shared<DataAbort>(vaddr,
|
||||
@@ -211,7 +210,7 @@ BrkPoint::testLinkedBk(ThreadContext *tc, Addr vaddr, ExceptionLevel el)
|
||||
{
|
||||
bool debug = false;
|
||||
const DBGBCR ctr = getControlReg(tc);
|
||||
if ((ctr.bt & 0x1) && getEnable()){
|
||||
if ((ctr.bt & 0x1) && enable) {
|
||||
debug = test(tc, vaddr, el, ctr, true);
|
||||
}
|
||||
return debug;
|
||||
@@ -527,7 +526,6 @@ WatchPoint::compareAddress(ThreadContext *tc, Addr in_addr, uint8_t bas,
|
||||
uint8_t mask, unsigned size)
|
||||
{
|
||||
Addr addr_tocmp = getAddrfromReg(tc);
|
||||
int maxAddrSize = getMaxAddrSize();
|
||||
int maxbits = isDoubleAligned(addr_tocmp) ? 4: 8;
|
||||
int bottom = isDoubleAligned(addr_tocmp) ? 2: 3;
|
||||
Addr addr = bits(in_addr, maxAddrSize, 0);
|
||||
|
||||
@@ -68,6 +68,8 @@ class BrkPoint
|
||||
bool onUse;
|
||||
|
||||
public:
|
||||
friend class SelfDebug;
|
||||
|
||||
BrkPoint(MiscRegIndex _ctrlIndex, MiscRegIndex _valIndex,
|
||||
MiscRegIndex _xIndex, SelfDebug* _conf, bool _ctxAw, bool lva,
|
||||
bool vmid16, bool aarch32):
|
||||
@@ -77,20 +79,9 @@ class BrkPoint
|
||||
{
|
||||
maxAddrSize = lva ? 52: 48 ;
|
||||
maxAddrSize = aarch32 ? 31 : maxAddrSize;
|
||||
onUse=false;
|
||||
}
|
||||
void setOnUse()
|
||||
{
|
||||
onUse = true;
|
||||
}
|
||||
void unsetOnUse()
|
||||
{
|
||||
onUse = false;
|
||||
}
|
||||
bool isSet()
|
||||
{
|
||||
return onUse;
|
||||
}
|
||||
|
||||
bool testLinkedBk(ThreadContext *tc, Addr vaddr, ExceptionLevel el);
|
||||
bool test(ThreadContext *tc, Addr pc, ExceptionLevel el, DBGBCR ctr,
|
||||
bool from_link);
|
||||
@@ -138,11 +129,6 @@ class BrkPoint
|
||||
{
|
||||
enable = val.e == 0x1;
|
||||
}
|
||||
bool getEnable()
|
||||
{
|
||||
return enable;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
class WatchPoint
|
||||
@@ -154,13 +140,9 @@ class WatchPoint
|
||||
bool enable;
|
||||
int maxAddrSize;
|
||||
|
||||
inline int getMaxAddrSize()
|
||||
{
|
||||
return maxAddrSize;
|
||||
}
|
||||
|
||||
|
||||
public:
|
||||
friend class SelfDebug;
|
||||
|
||||
WatchPoint(MiscRegIndex _ctrlIndex, MiscRegIndex _valIndex,
|
||||
SelfDebug* _conf, bool lva, bool aarch32):
|
||||
ctrlRegIndex(_ctrlIndex),
|
||||
@@ -188,10 +170,6 @@ class WatchPoint
|
||||
{
|
||||
enable = val.e == 0x1;
|
||||
}
|
||||
bool getEnable()
|
||||
{
|
||||
return enable;
|
||||
}
|
||||
|
||||
bool isEnabled(ThreadContext* tc, ExceptionLevel el, bool hmc,
|
||||
uint8_t ssc, uint8_t pac);
|
||||
@@ -368,7 +346,7 @@ class SelfDebug
|
||||
void activateDebug()
|
||||
{
|
||||
for (auto &p: arBrkPoints){
|
||||
p.unsetOnUse();
|
||||
p.onUse = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -432,10 +410,6 @@ class SelfDebug
|
||||
return aarch32;
|
||||
}
|
||||
|
||||
inline bool isTo32()
|
||||
{
|
||||
return to32;
|
||||
}
|
||||
inline void setAArch32(ThreadContext * tc)
|
||||
{
|
||||
ExceptionLevel fromEL = (ExceptionLevel) currEL(tc);
|
||||
@@ -445,6 +419,7 @@ class SelfDebug
|
||||
aarch32 = ELIs32(tc, fromEL);
|
||||
return;
|
||||
}
|
||||
|
||||
SoftwareStep * getSstep()
|
||||
{
|
||||
return softStep;
|
||||
|
||||
Reference in New Issue
Block a user