No more Fetcher flush() API as it can now be done via the decoder.flushNext

This commit is contained in:
Charles Papon 2020-02-21 13:28:29 +01:00
parent 32fade50e5
commit befc54a444
4 changed files with 8 additions and 11 deletions

View File

@ -13,7 +13,6 @@ trait JumpService{
trait IBusFetcher{ trait IBusFetcher{
def haltIt() : Unit def haltIt() : Unit
def flushIt() : Unit
def incoming() : Bool def incoming() : Bool
def pcValid(stage : Stage) : Bool def pcValid(stage : Stage) : Bool
def getInjectionPort() : Stream[Bits] def getInjectionPort() : Stream[Bits]

View File

@ -114,7 +114,7 @@ case class InstructionCacheCpuFetch(p : InstructionCacheConfig) extends Bundle w
val mmuBus = MemoryTranslatorBus() val mmuBus = MemoryTranslatorBus()
val physicalAddress = UInt(p.addressWidth bits) val physicalAddress = UInt(p.addressWidth bits)
val cacheMiss, error, mmuRefilling, mmuException, isUser = ifGen(!p.twoCycleCache)(Bool) val cacheMiss, error, mmuRefilling, mmuException, isUser = ifGen(!p.twoCycleCache)(Bool)
val haltIt = Bool val haltIt = Bool() //Used to wait on the MMU rsp busy
override def asMaster(): Unit = { override def asMaster(): Unit = {
out(isValid, isStuck, isRemoved, pc) out(isValid, isStuck, isRemoved, pc)

View File

@ -201,7 +201,6 @@ class DebugPlugin(val debugClockDomain : ClockDomain, hardwareBreakpointCount :
execute.arbitration.haltByOther := True execute.arbitration.haltByOther := True
busReadDataReg := execute.input(PC).asBits busReadDataReg := execute.input(PC).asBits
when(stagesFromExecute.tail.map(_.arbitration.isValid).orR === False){ when(stagesFromExecute.tail.map(_.arbitration.isValid).orR === False){
iBusFetcher.flushIt()
iBusFetcher.haltIt() iBusFetcher.haltIt()
execute.arbitration.flushIt := True execute.arbitration.flushIt := True
execute.arbitration.flushNext := True execute.arbitration.flushNext := True

View File

@ -32,7 +32,6 @@ abstract class IBusFetcherImpl(val resetVector : BigInt,
// assert(!(cmdToRspStageCount == 1 && !injectorStage)) // assert(!(cmdToRspStageCount == 1 && !injectorStage))
assert(!(compressedGen && !decodePcGen)) assert(!(compressedGen && !decodePcGen))
var fetcherHalt : Bool = null var fetcherHalt : Bool = null
var fetcherflushIt : Bool = null
var pcValids : Vec[Bool] = null var pcValids : Vec[Bool] = null
def pcValid(stage : Stage) = pcValids(pipeline.indexOf(stage)) def pcValid(stage : Stage) = pcValids(pipeline.indexOf(stage))
var incomingInstruction : Bool = null var incomingInstruction : Bool = null
@ -47,8 +46,6 @@ abstract class IBusFetcherImpl(val resetVector : BigInt,
var predictionJumpInterface : Flow[UInt] = null var predictionJumpInterface : Flow[UInt] = null
override def haltIt(): Unit = fetcherHalt := True override def haltIt(): Unit = fetcherHalt := True
override def flushIt(): Unit = fetcherflushIt := True
case class JumpInfo(interface : Flow[UInt], stage: Stage, priority : Int) case class JumpInfo(interface : Flow[UInt], stage: Stage, priority : Int)
val jumpInfos = ArrayBuffer[JumpInfo]() val jumpInfos = ArrayBuffer[JumpInfo]()
override def createJumpInterface(stage: Stage, priority : Int = 0): Flow[UInt] = { override def createJumpInterface(stage: Stage, priority : Int = 0): Flow[UInt] = {
@ -62,7 +59,6 @@ abstract class IBusFetcherImpl(val resetVector : BigInt,
// var decodeExceptionPort : Flow[ExceptionCause] = null // var decodeExceptionPort : Flow[ExceptionCause] = null
override def setup(pipeline: VexRiscv): Unit = { override def setup(pipeline: VexRiscv): Unit = {
fetcherHalt = False fetcherHalt = False
fetcherflushIt = False
incomingInstruction = False incomingInstruction = False
if(resetVector == null) externalResetVector = in(UInt(32 bits).setName("externalResetVector")) if(resetVector == null) externalResetVector = in(UInt(32 bits).setName("externalResetVector"))
@ -91,13 +87,16 @@ abstract class IBusFetcherImpl(val resetVector : BigInt,
s == IBUS_RSP || s == DECOMPRESSOR s == IBUS_RSP || s == DECOMPRESSOR
} }
def getFlushAt(s : Any, lastCond : Boolean = true): Bool = {
if(isDrivingDecode(s) && lastCond) pipeline.decode.arbitration.isRemoved else fetcherflushIt
}
class FetchArea(pipeline : VexRiscv) extends Area { class FetchArea(pipeline : VexRiscv) extends Area {
import pipeline._ import pipeline._
import pipeline.config._ import pipeline.config._
val fetcherflushIt = stages.map(_.arbitration.flushNext).orR
def getFlushAt(s : Any, lastCond : Boolean = true): Bool = {
if(isDrivingDecode(s) && lastCond) pipeline.decode.arbitration.isRemoved else fetcherflushIt
}
//Arbitrate jump requests into pcLoad //Arbitrate jump requests into pcLoad
val jump = new Area { val jump = new Area {
@ -113,7 +112,7 @@ abstract class IBusFetcherImpl(val resetVector : BigInt,
pcLoad.payload := MuxOH(OHMasking.first(valids.asBits), pcs) pcLoad.payload := MuxOH(OHMasking.first(valids.asBits), pcs)
} }
fetcherflushIt setWhen(stages.map(_.arbitration.flushNext).orR)
//The fetchPC pcReg can also be use for the second stage of the fetch //The fetchPC pcReg can also be use for the second stage of the fetch
//When the fetcherHalt is set and the pipeline isn't stalled,, the pc is propagated to to the pcReg, which allow //When the fetcherHalt is set and the pipeline isn't stalled,, the pc is propagated to to the pcReg, which allow