2012-02-26 02:09:26 +01:00
|
|
|
package rocket
|
2011-10-26 08:02:47 +02:00
|
|
|
|
2012-10-08 07:37:29 +02:00
|
|
|
import Chisel._
|
2012-11-18 02:24:08 +01:00
|
|
|
import Util._
|
2013-11-08 00:42:03 +01:00
|
|
|
import uncore.HTIFIO
|
2011-10-26 08:02:47 +02:00
|
|
|
|
2014-08-02 03:01:08 +02:00
|
|
|
case object FPUParams extends Field[PF]
|
2014-08-08 21:23:02 +02:00
|
|
|
case object BuildFPU extends Field[Option[() => FPU]]
|
2014-08-02 03:01:08 +02:00
|
|
|
|
2014-08-08 21:23:02 +02:00
|
|
|
class RocketIO extends Bundle
|
2011-10-26 08:02:47 +02:00
|
|
|
{
|
2014-08-08 21:23:02 +02:00
|
|
|
val host = new HTIFIO
|
|
|
|
val imem = new CPUFrontendIO
|
|
|
|
val dmem = new HellaCacheIO
|
|
|
|
val ptw = new DatapathPTWIO().flip
|
2013-09-15 00:31:50 +02:00
|
|
|
val rocc = new RoCCInterface().flip
|
2011-10-26 08:02:47 +02:00
|
|
|
}
|
|
|
|
|
2014-08-08 21:23:02 +02:00
|
|
|
class Core extends Module
|
2011-10-26 08:02:47 +02:00
|
|
|
{
|
2014-08-08 21:23:02 +02:00
|
|
|
val io = new RocketIO
|
2011-11-09 23:52:17 +01:00
|
|
|
|
2014-08-08 21:23:02 +02:00
|
|
|
val ctrl = Module(new Control)
|
2013-08-12 19:39:11 +02:00
|
|
|
val dpath = Module(new Datapath)
|
2011-10-26 08:02:47 +02:00
|
|
|
|
2014-08-08 21:23:02 +02:00
|
|
|
if (!params(BuildFPU).isEmpty) {
|
2014-08-12 03:36:23 +02:00
|
|
|
val p = Some(params.alter(params(FPUParams)))
|
|
|
|
val fpu = Module(params(BuildFPU).get())(p)
|
2013-09-15 00:31:50 +02:00
|
|
|
dpath.io.fpu <> fpu.io.dpath
|
|
|
|
ctrl.io.fpu <> fpu.io.ctrl
|
2014-03-05 01:32:09 +01:00
|
|
|
}
|
2013-09-15 00:31:50 +02:00
|
|
|
|
2012-11-06 17:13:44 +01:00
|
|
|
ctrl.io.dpath <> dpath.io.ctrl
|
|
|
|
dpath.io.host <> io.host
|
|
|
|
|
|
|
|
ctrl.io.imem <> io.imem
|
|
|
|
dpath.io.imem <> io.imem
|
|
|
|
|
2013-09-13 07:34:38 +02:00
|
|
|
ctrl.io.dmem <> io.dmem
|
|
|
|
dpath.io.dmem <> io.dmem
|
2011-11-09 23:52:17 +01:00
|
|
|
|
2013-09-13 07:34:38 +02:00
|
|
|
dpath.io.ptw <> io.ptw
|
2012-11-06 17:13:44 +01:00
|
|
|
|
2013-09-15 00:31:50 +02:00
|
|
|
ctrl.io.rocc <> io.rocc
|
|
|
|
dpath.io.rocc <> io.rocc
|
2011-10-26 08:02:47 +02:00
|
|
|
}
|