using namespace ArmISA;
using namespace std;
+Fault
+SelfDebug::testDebug(ThreadContext *tc, const RequestPtr &req,
+ BaseTLB::Mode mode)
+{
+ Fault fault = NoFault;
+
+ if (mode == BaseTLB::Execute) {
+ const bool d_step = softStep->advanceSS(tc);
+ if (!d_step) {
+ fault = testVectorCatch(tc, req->getVaddr(), nullptr);
+ if (fault == NoFault)
+ fault = testBreakPoints(tc, req->getVaddr());
+ }
+ } else if (!req->isCacheMaintenance() ||
+ (req->isCacheInvalidate() && !req->isCacheClean())) {
+ bool md = mode == BaseTLB::Write ? true: false;
+ fault = testWatchPoints(tc, req->getVaddr(), md,
+ req->isAtomic(),
+ req->getSize(),
+ req->isCacheMaintenance());
+ }
+
+ return fault;
+}
+
Fault
SelfDebug::testBreakPoints(ThreadContext *tc, Addr vaddr)
{
#include "arch/arm/system.hh"
#include "arch/arm/types.hh"
#include "arch/arm/utility.hh"
+#include "arch/generic/tlb.hh"
#include "cpu/thread_context.hh"
class ThreadContext;
delete vcExcpt;
}
+ Fault testDebug(ThreadContext *tc, const RequestPtr &req,
+ BaseTLB::Mode mode);
+
+ protected:
Fault testBreakPoints(ThreadContext *tc, Addr vaddr);
Fault testWatchPoints(ThreadContext *tc, Addr vaddr, bool write,
bool atomic, unsigned size, bool cm);
- Fault testVectorCatch(ThreadContext *tc, Addr addr, ArmFault* flt);
Fault triggerException(ThreadContext * tc, Addr vaddr);
Fault triggerWatchpointException(ThreadContext *tc, Addr vaddr,
bool write, bool cm);
+ public:
+ Fault testVectorCatch(ThreadContext *tc, Addr addr, ArmFault* flt);
inline BrkPoint* getBrkPoint(uint8_t index)
{
//Check for Debug Exceptions
if (fault == NoFault) {
auto *isa = static_cast<ArmISA::ISA *>(tc->getIsaPtr());
- SelfDebug * sd = isa->getSelfDebug();
- if (mode == Execute)
- {
- const bool d_step = sd->getSstep()->advanceSS(tc);
- if (!d_step) {
- fault = sd->testVectorCatch(tc, req->getVaddr(), nullptr);
- if (fault == NoFault)
- fault = sd->testBreakPoints(tc, req->getVaddr());
- }
- }
- else if (!req->isCacheMaintenance() ||
- (req->isCacheInvalidate() && !req->isCacheClean())) {
- bool md = mode == Write ? true: false;
- fault = sd->testWatchPoints(tc, req->getVaddr(), md,
- req->isAtomic(),
- req->getSize(),
- req->isCacheMaintenance());
- }
+ SelfDebug *sd = isa->getSelfDebug();
+
+ fault = sd->testDebug(tc, req, mode);
}
return fault;