summaryrefslogtreecommitdiff
path: root/cpu/checker/cpu.hh
diff options
context:
space:
mode:
authorKevin Lim <ktlim@umich.edu>2006-08-02 12:06:59 -0400
committerKevin Lim <ktlim@umich.edu>2006-08-02 12:06:59 -0400
commit5be592f870d1d59cffe9a5d1eebac66b225ff8ef (patch)
tree96542462dec9a6b760fb9723c58241ee2a58e69d /cpu/checker/cpu.hh
parentcbfbb7bc56630ddefb95625a6da87b3c1da9599d (diff)
downloadgem5-5be592f870d1d59cffe9a5d1eebac66b225ff8ef.tar.xz
Make checker handle not executing the same instruction as the main CPU a little better.
Also add the option for the checker to update itself with the main CPU's state if it executes an instruction differently (so it will handle DMA timing errors properly). --HG-- extra : convert_revision : 760d11ec1a249bc75e2807d320866b5d08c2b6f2
Diffstat (limited to 'cpu/checker/cpu.hh')
-rw-r--r--cpu/checker/cpu.hh23
1 files changed, 17 insertions, 6 deletions
diff --git a/cpu/checker/cpu.hh b/cpu/checker/cpu.hh
index 9fcd1037f..f48d1135a 100644
--- a/cpu/checker/cpu.hh
+++ b/cpu/checker/cpu.hh
@@ -98,6 +98,7 @@ class CheckerCPU : public BaseCPU
Process *process;
#endif
bool exitOnError;
+ bool updateOnError;
};
public:
@@ -294,11 +295,8 @@ class CheckerCPU : public BaseCPU
void syscall() { }
#endif
- void handleError()
- {
- if (exitOnError)
- panic("Checker found error!");
- }
+ virtual void handleError() = 0;
+
bool checkFlags(MemReqPtr &req);
ExecContext *xcBase() { return xcProxy; }
@@ -312,6 +310,7 @@ class CheckerCPU : public BaseCPU
uint64_t newPC;
bool changedNextPC;
bool exitOnError;
+ bool updateOnError;
InstSeqNum youngestSN;
};
@@ -327,7 +326,7 @@ class Checker : public CheckerCPU
{
public:
Checker(Params *p)
- : CheckerCPU(p)
+ : CheckerCPU(p), updateThisCycle(false), unverifiedInst(NULL)
{ }
void switchOut(Sampler *s);
@@ -339,6 +338,18 @@ class Checker : public CheckerCPU
void validateExecution(DynInstPtr &inst);
void validateState();
+ virtual void handleError()
+ {
+ if (exitOnError)
+ panic("Checker found error!");
+ else if (updateOnError)
+ updateThisCycle = true;
+ }
+
+ bool updateThisCycle;
+
+ DynInstPtr unverifiedInst;
+
std::list<DynInstPtr> instList;
typedef typename std::list<DynInstPtr>::iterator InstListIt;
void dumpInsts();