mulsimpleplugin: fix build for short pipelines

Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
Sean Cross 2019-09-20 08:35:23 +08:00
parent b91df10b21
commit 0b79c637b6
1 changed files with 6 additions and 4 deletions

View File

@ -66,14 +66,16 @@ class MulSimplePlugin extends Plugin[VexRiscv]{
insert(MUL_OPB) := ((bSigned ? b.msb | False) ## b).asSInt insert(MUL_OPB) := ((bSigned ? b.msb | False) ## b).asSInt
} }
memory plug new Area { val injectionStage = if(pipeline.memory != null) pipeline.memory else pipeline.execute
import memory._ injectionStage plug new Area {
import injectionStage._
insert(MUL) := (input(MUL_OPA) * input(MUL_OPB))(63 downto 0).asBits insert(MUL) := (input(MUL_OPA) * input(MUL_OPB))(63 downto 0).asBits
} }
writeBack plug new Area { val memStage = stages.last
import writeBack._ memStage plug new Area {
import memStage._
when(arbitration.isValid && input(IS_MUL)){ when(arbitration.isValid && input(IS_MUL)){
switch(input(INSTRUCTION)(13 downto 12)){ switch(input(INSTRUCTION)(13 downto 12)){