1
0

Do some CSE by hand, per @terpstra

This commit is contained in:
Andrew Waterman 2017-04-10 18:40:49 -07:00 committed by Andrew Waterman
parent 71bf929505
commit 470c6711a7

View File

@ -479,7 +479,7 @@ class CSRFile(perfEventSets: EventSets = new EventSets(Seq()))(implicit p: Param
val base = Mux(delegate, reg_stvec.sextTo(vaddrBitsExtended), reg_mtvec) val base = Mux(delegate, reg_stvec.sextTo(vaddrBitsExtended), reg_mtvec)
val baseAlign = 2 val baseAlign = 2
val interruptAlign = log2Ceil(new MIP().getWidth) val interruptAlign = log2Ceil(new MIP().getWidth)
val interruptOffset = cause(log2Ceil(new MIP().getWidth)-1, 0) << baseAlign val interruptOffset = cause(interruptAlign-1, 0) << baseAlign
val interruptVec = Cat(base >> (interruptAlign + baseAlign), interruptOffset) val interruptVec = Cat(base >> (interruptAlign + baseAlign), interruptOffset)
Mux(base(0) && cause(cause.getWidth-1), interruptVec, base) Mux(base(0) && cause(cause.getWidth-1), interruptVec, base)
} }