summaryrefslogtreecommitdiff
path: root/src/cpu/simple/timing.hh
diff options
context:
space:
mode:
authorNathan Binkert <nate@binkert.org>2009-04-08 22:21:27 -0700
committerNathan Binkert <nate@binkert.org>2009-04-08 22:21:27 -0700
commite0de2c34433be76eac7798e58e1ae02f5bffb732 (patch)
tree120f809cf3feb35e6b42e83a9896b8ae673c5445 /src/cpu/simple/timing.hh
parent7b5a96f06b530db35637aca6f9d0f7a2ddfa6e60 (diff)
downloadgem5-e0de2c34433be76eac7798e58e1ae02f5bffb732.tar.xz
tlb: More fixing of unified TLB
Diffstat (limited to 'src/cpu/simple/timing.hh')
-rw-r--r--src/cpu/simple/timing.hh45
1 files changed, 26 insertions, 19 deletions
diff --git a/src/cpu/simple/timing.hh b/src/cpu/simple/timing.hh
index 731eeeefc..6f6b02bb7 100644
--- a/src/cpu/simple/timing.hh
+++ b/src/cpu/simple/timing.hh
@@ -102,11 +102,13 @@ class TimingSimpleCPU : public BaseSimpleCPU
TimingSimpleCPU *cpu;
public:
- FetchTranslation(TimingSimpleCPU *_cpu) : cpu(_cpu)
+ FetchTranslation(TimingSimpleCPU *_cpu)
+ : cpu(_cpu)
{}
- void finish(Fault fault, RequestPtr req,
- ThreadContext *tc, bool write, bool execute)
+ void
+ finish(Fault fault, RequestPtr req, ThreadContext *tc,
+ BaseTLB::Mode mode)
{
cpu->sendFetch(fault, req, tc);
}
@@ -119,19 +121,22 @@ class TimingSimpleCPU : public BaseSimpleCPU
TimingSimpleCPU *cpu;
uint8_t *data;
uint64_t *res;
- bool read;
+ BaseTLB::Mode mode;
public:
DataTranslation(TimingSimpleCPU *_cpu,
- uint8_t *_data, uint64_t *_res, bool _read) :
- cpu(_cpu), data(_data), res(_res), read(_read)
- {}
+ uint8_t *_data, uint64_t *_res, BaseTLB::Mode _mode)
+ : cpu(_cpu), data(_data), res(_res), mode(_mode)
+ {
+ assert(mode == BaseTLB::Read || mode == BaseTLB::Write);
+ }
void
- finish(Fault fault, RequestPtr req,
- ThreadContext *tc, bool write, bool execute)
+ finish(Fault fault, RequestPtr req, ThreadContext *tc,
+ BaseTLB::Mode mode)
{
- cpu->sendData(fault, req, data, res, read);
+ assert(mode == this->mode);
+ cpu->sendData(fault, req, data, res, mode == BaseTLB::Read);
delete this;
}
};
@@ -147,18 +152,20 @@ class TimingSimpleCPU : public BaseSimpleCPU
RequestPtr mainReq;
Fault faults[2];
uint8_t *data;
- bool read;
+ BaseTLB::Mode mode;
WholeTranslationState(RequestPtr req1, RequestPtr req2,
- RequestPtr main, uint8_t *_data, bool _read)
+ RequestPtr main, uint8_t *data, BaseTLB::Mode mode)
{
+ assert(mode == BaseTLB::Read || mode == BaseTLB::Write);
+
outstanding = 2;
requests[0] = req1;
requests[1] = req2;
mainReq = main;
faults[0] = faults[1] = NoFault;
- data = _data;
- read = _read;
+ this->data = data;
+ this->mode = mode;
}
};
@@ -167,13 +174,13 @@ class TimingSimpleCPU : public BaseSimpleCPU
WholeTranslationState *state;
SplitDataTranslation(TimingSimpleCPU *_cpu, int _index,
- WholeTranslationState *_state) :
- cpu(_cpu), index(_index), state(_state)
+ WholeTranslationState *_state)
+ : cpu(_cpu), index(_index), state(_state)
{}
void
- finish(Fault fault, RequestPtr req,
- ThreadContext *tc, bool write, bool execute)
+ finish(Fault fault, RequestPtr req, ThreadContext *tc,
+ BaseTLB::Mode mode)
{
assert(state);
assert(state->outstanding);
@@ -185,7 +192,7 @@ class TimingSimpleCPU : public BaseSimpleCPU
state->requests[1],
state->mainReq,
state->data,
- state->read);
+ state->mode == BaseTLB::Read);
delete state;
}
delete this;