diff options
author | Iru Cai <mytbk920423@gmail.com> | 2019-02-28 17:07:16 +0800 |
---|---|---|
committer | Iru Cai <mytbk920423@gmail.com> | 2019-03-18 15:46:57 +0800 |
commit | 970e6b3f8313c5ffc10b5cd84d2d471746b15999 (patch) | |
tree | aa3b4a369675d9c4fb019db3a0882652204cf63b /src/cpu/o3/lsq_impl.hh | |
parent | 497ebfe98578b71d22f979b848c4b873f05ec6ee (diff) | |
download | gem5-970e6b3f8313c5ffc10b5cd84d2d471746b15999.tar.xz |
invisispec-1.0 source
Diffstat (limited to 'src/cpu/o3/lsq_impl.hh')
-rw-r--r-- | src/cpu/o3/lsq_impl.hh | 55 |
1 files changed, 54 insertions, 1 deletions
diff --git a/src/cpu/o3/lsq_impl.hh b/src/cpu/o3/lsq_impl.hh index 9080907fe..d227f36ad 100644 --- a/src/cpu/o3/lsq_impl.hh +++ b/src/cpu/o3/lsq_impl.hh @@ -310,6 +310,44 @@ LSQ<Impl>::writebackStores() } } +// [mengjia] +template<class Impl> +int +LSQ<Impl>::exposeLoads() +{ + list<ThreadID>::iterator threads = activeThreads->begin(); + list<ThreadID>::iterator end = activeThreads->end(); + + int exposedLoads = 0; + while (threads != end) { + ThreadID tid = *threads++; + + if (numLoadsToVLD(tid) > 0) { + DPRINTF(Writeback,"[tid:%i] Validate loads. %i loads " + "available for Validate.\n", tid, numLoadsToVLD(tid)); + } + + exposedLoads += thread[tid].exposeLoads(); + } + return exposedLoads; +} + + +// [mengjia] +template<class Impl> +void +LSQ<Impl>::updateVisibleState() +{ + list<ThreadID>::iterator threads = activeThreads->begin(); + list<ThreadID>::iterator end = activeThreads->end(); + + while (threads != end) { + ThreadID tid = *threads++; + + thread[tid].updateVisibleState(); + } +} + template<class Impl> bool LSQ<Impl>::violation() @@ -339,6 +377,7 @@ LSQ<Impl>::recvReqRetry() } } +// [InvisiSpec] Callback function for receiving a response template <class Impl> bool LSQ<Impl>::recvTimingResp(PacketPtr pkt) @@ -347,6 +386,17 @@ LSQ<Impl>::recvTimingResp(PacketPtr pkt) DPRINTF(LSQ, "Got error packet back for address: %#X\n", pkt->getAddr()); + // for expose or validate request, + // if the instruction is squashed, maybe the req has been deleted + if (pkt->isValidate() || pkt->isExpose()){ + if (!pkt->req){ + delete pkt; + return true; + } + DPRINTF(LSQ, "Receive an expose/validate response, idx=%d\n", + pkt->reqIdx); + } + thread[cpu->contextToThread(pkt->req->contextId())] .completeDataAccess(pkt); @@ -370,7 +420,10 @@ LSQ<Impl>::recvTimingResp(PacketPtr pkt) } } - delete pkt->req; + //TODO: also not validation + if (!pkt->isExpose() && !pkt->isValidate()){ + delete pkt->req; + } delete pkt; return true; } |