1
0

Fix null pointer exception when HAS_FPU=false

This commit is contained in:
Andrew Waterman 2014-03-04 16:32:09 -08:00
parent c7110c8389
commit fa75f6e81e

View File

@ -21,12 +21,13 @@ class Core(implicit conf: RocketConfiguration) extends Module
val ctrl = Module(new Control) val ctrl = Module(new Control)
val dpath = Module(new Datapath) val dpath = Module(new Datapath)
val fpu: FPU = if (!conf.fpu.isEmpty) { if (!conf.fpu.isEmpty) {
val fpu = Module(new FPU(conf.fpu.get)) val fpu = Module(new FPU(conf.fpu.get))
dpath.io.fpu <> fpu.io.dpath dpath.io.fpu <> fpu.io.dpath
ctrl.io.fpu <> fpu.io.ctrl ctrl.io.fpu <> fpu.io.ctrl
fpu fpu.io.sfma.valid := Bool(false)
} else null fpu.io.dfma.valid := Bool(false)
}
ctrl.io.dpath <> dpath.io.ctrl ctrl.io.dpath <> dpath.io.ctrl
dpath.io.host <> io.host dpath.io.host <> io.host
@ -41,7 +42,4 @@ class Core(implicit conf: RocketConfiguration) extends Module
ctrl.io.rocc <> io.rocc ctrl.io.rocc <> io.rocc
dpath.io.rocc <> io.rocc dpath.io.rocc <> io.rocc
fpu.io.sfma.valid := Bool(false)
fpu.io.dfma.valid := Bool(false)
} }