O3: Send instruction back to fetch on squash to seed predecoder correctly.
This commit is contained in:
parent
30143baf7e
commit
799c3da8d0
|
@ -76,6 +76,12 @@ class Predecoder
|
||||||
emiIsReady = false;
|
emiIsReady = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
reset(const ExtMachInst &old_emi)
|
||||||
|
{
|
||||||
|
reset();
|
||||||
|
}
|
||||||
|
|
||||||
// Use this to give data to the predecoder. This should be used
|
// Use this to give data to the predecoder. This should be used
|
||||||
// when there is control flow.
|
// when there is control flow.
|
||||||
void
|
void
|
||||||
|
|
|
@ -83,6 +83,12 @@ namespace ArmISA
|
||||||
predAddrValid = false;
|
predAddrValid = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void reset(const ExtMachInst &old_emi)
|
||||||
|
{
|
||||||
|
reset();
|
||||||
|
itstate = old_emi.newItstate;
|
||||||
|
}
|
||||||
|
|
||||||
Predecoder(ThreadContext * _tc) :
|
Predecoder(ThreadContext * _tc) :
|
||||||
tc(_tc), data(0)
|
tc(_tc), data(0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -75,6 +75,12 @@ class Predecoder
|
||||||
emiIsReady = false;
|
emiIsReady = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
reset(const ExtMachInst &old_emi)
|
||||||
|
{
|
||||||
|
reset();
|
||||||
|
}
|
||||||
|
|
||||||
//Use this to give data to the predecoder. This should be used
|
//Use this to give data to the predecoder. This should be used
|
||||||
//when there is control flow.
|
//when there is control flow.
|
||||||
void
|
void
|
||||||
|
|
|
@ -82,6 +82,12 @@ class Predecoder
|
||||||
emiIsReady = false;
|
emiIsReady = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
reset(const ExtMachInst &old_emi)
|
||||||
|
{
|
||||||
|
reset();
|
||||||
|
}
|
||||||
|
|
||||||
// Use this to give data to the predecoder. This should be used
|
// Use this to give data to the predecoder. This should be used
|
||||||
// when there is control flow.
|
// when there is control flow.
|
||||||
void
|
void
|
||||||
|
|
|
@ -68,12 +68,19 @@ class Predecoder
|
||||||
}
|
}
|
||||||
|
|
||||||
void process() {}
|
void process() {}
|
||||||
|
|
||||||
void
|
void
|
||||||
reset()
|
reset()
|
||||||
{
|
{
|
||||||
emiIsReady = false;
|
emiIsReady = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
reset(const ExtMachInst &old_emi)
|
||||||
|
{
|
||||||
|
reset();
|
||||||
|
}
|
||||||
|
|
||||||
// Use this to give data to the predecoder. This should be used
|
// Use this to give data to the predecoder. This should be used
|
||||||
// when there is control flow.
|
// when there is control flow.
|
||||||
void
|
void
|
||||||
|
|
|
@ -174,6 +174,12 @@ namespace X86ISA
|
||||||
state = ResetState;
|
state = ResetState;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
reset(const ExtMachInst &old_emi)
|
||||||
|
{
|
||||||
|
reset();
|
||||||
|
}
|
||||||
|
|
||||||
ThreadContext * getTC()
|
ThreadContext * getTC()
|
||||||
{
|
{
|
||||||
return tc;
|
return tc;
|
||||||
|
|
|
@ -808,8 +808,9 @@ FullO3CPU<Impl>::removeThread(ThreadID tid)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Squash Throughout Pipeline
|
// Squash Throughout Pipeline
|
||||||
InstSeqNum squash_seq_num = commit.rob->readHeadInst(tid)->seqNum;
|
DynInstPtr inst = commit.rob->readHeadInst(tid);
|
||||||
fetch.squash(0, squash_seq_num, tid);
|
InstSeqNum squash_seq_num = inst->seqNum;
|
||||||
|
fetch.squash(0, squash_seq_num, inst, tid);
|
||||||
decode.squash(tid);
|
decode.squash(tid);
|
||||||
rename.squash(squash_seq_num, tid);
|
rename.squash(squash_seq_num, tid);
|
||||||
iew.squash(tid);
|
iew.squash(tid);
|
||||||
|
|
|
@ -312,8 +312,8 @@ class DefaultFetch
|
||||||
* remove any instructions that are not in the ROB. The source of this
|
* remove any instructions that are not in the ROB. The source of this
|
||||||
* squash should be the commit stage.
|
* squash should be the commit stage.
|
||||||
*/
|
*/
|
||||||
void squash(const TheISA::PCState &newPC,
|
void squash(const TheISA::PCState &newPC, const InstSeqNum &seq_num,
|
||||||
const InstSeqNum &seq_num, ThreadID tid);
|
DynInstPtr &squashInst, ThreadID tid);
|
||||||
|
|
||||||
/** Ticks the fetch stage, processing all inputs signals and fetching
|
/** Ticks the fetch stage, processing all inputs signals and fetching
|
||||||
* as many instructions as possible.
|
* as many instructions as possible.
|
||||||
|
|
|
@ -815,11 +815,14 @@ DefaultFetch<Impl>::updateFetchStatus()
|
||||||
template <class Impl>
|
template <class Impl>
|
||||||
void
|
void
|
||||||
DefaultFetch<Impl>::squash(const TheISA::PCState &newPC,
|
DefaultFetch<Impl>::squash(const TheISA::PCState &newPC,
|
||||||
const InstSeqNum &seq_num, ThreadID tid)
|
const InstSeqNum &seq_num, DynInstPtr &squashInst,
|
||||||
|
ThreadID tid)
|
||||||
{
|
{
|
||||||
DPRINTF(Fetch, "[tid:%u]: Squash from commit.\n", tid);
|
DPRINTF(Fetch, "[tid:%u]: Squash from commit.\n", tid);
|
||||||
|
|
||||||
doSquash(newPC, tid);
|
doSquash(newPC, tid);
|
||||||
|
if (squashInst)
|
||||||
|
predecoder.reset(squashInst->staticInst->machInst);
|
||||||
|
|
||||||
// Tell the CPU to remove any instructions that are not in the ROB.
|
// Tell the CPU to remove any instructions that are not in the ROB.
|
||||||
cpu->removeInstsNotInROB(tid);
|
cpu->removeInstsNotInROB(tid);
|
||||||
|
|
|
@ -1,4 +1,16 @@
|
||||||
/*
|
/*
|
||||||
|
* Copyright (c) 2011 ARM Limited
|
||||||
|
* All rights reserved
|
||||||
|
*
|
||||||
|
* The license below extends only to copyright in the software and shall
|
||||||
|
* not be construed as granting a license to any other intellectual
|
||||||
|
* property including but not limited to intellectual property relating
|
||||||
|
* to a hardware implementation of the functionality of the software
|
||||||
|
* licensed hereunder. You may use the software subject to the license
|
||||||
|
* terms below provided that you ensure that this notice is replicated
|
||||||
|
* unmodified and in its entirety in all distributions of the software,
|
||||||
|
* modified or unmodified, in source code or in binary form.
|
||||||
|
*
|
||||||
* Copyright (c) 2004-2006 The Regents of The University of Michigan
|
* Copyright (c) 2004-2006 The Regents of The University of Michigan
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in a new issue