2014-09-13 03:06:41 +02:00
|
|
|
// See LICENSE for license details.
|
|
|
|
|
2012-03-25 00:56:59 +01:00
|
|
|
package rocket
|
|
|
|
|
|
|
|
import Chisel._
|
2012-10-02 01:08:41 +02:00
|
|
|
import uncore._
|
2012-11-18 02:24:08 +01:00
|
|
|
import Util._
|
2012-03-25 00:56:59 +01:00
|
|
|
|
2014-09-08 02:54:41 +02:00
|
|
|
case object CoreName extends Field[String]
|
2014-08-08 21:23:02 +02:00
|
|
|
case object NDCachePorts extends Field[Int]
|
2014-09-01 22:28:58 +02:00
|
|
|
case object NPTWPorts extends Field[Int]
|
2014-08-08 21:23:02 +02:00
|
|
|
case object BuildRoCC extends Field[Option[() => RoCC]]
|
|
|
|
|
2015-10-06 06:48:05 +02:00
|
|
|
abstract class Tile(resetSignal: Bool = null)
|
|
|
|
(implicit p: Parameters) extends Module(_reset = resetSignal) {
|
2012-03-25 00:56:59 +01:00
|
|
|
val io = new Bundle {
|
2015-04-18 01:56:53 +02:00
|
|
|
val cached = new ClientTileLinkIO
|
|
|
|
val uncached = new ClientUncachedTileLinkIO
|
2015-10-06 06:48:05 +02:00
|
|
|
val host = new HtifIO
|
2012-03-25 00:56:59 +01:00
|
|
|
}
|
2014-09-24 22:04:20 +02:00
|
|
|
}
|
|
|
|
|
2015-10-06 06:48:05 +02:00
|
|
|
class RocketTile(resetSignal: Bool = null)(implicit p: Parameters) extends Tile(resetSignal)(p) {
|
|
|
|
//TODO
|
|
|
|
val dcacheParams = p.alterPartial({ case CacheName => "L1D" })
|
|
|
|
val icache = Module(new Frontend()(p.alterPartial({
|
|
|
|
case CacheName => "L1I"
|
|
|
|
case CoreName => "Rocket" })))
|
|
|
|
val dcache = Module(new HellaCache()(dcacheParams))
|
|
|
|
val ptw = Module(new PTW(p(NPTWPorts))(dcacheParams))
|
|
|
|
val core = Module(new Rocket()(p.alterPartial({ case CoreName => "Rocket" })))
|
2014-08-08 21:23:02 +02:00
|
|
|
|
2015-04-11 11:26:33 +02:00
|
|
|
dcache.io.cpu.invalidate_lr := core.io.dmem.invalidate_lr // Bypass signal to dcache
|
2015-10-06 06:48:05 +02:00
|
|
|
val dcArb = Module(new HellaCacheArbiter(p(NDCachePorts))(dcacheParams))
|
2014-08-08 21:23:02 +02:00
|
|
|
dcArb.io.requestor(0) <> ptw.io.mem
|
|
|
|
dcArb.io.requestor(1) <> core.io.dmem
|
2015-08-02 06:11:25 +02:00
|
|
|
dcache.io.cpu <> dcArb.io.mem
|
2012-03-25 00:56:59 +01:00
|
|
|
|
2015-03-04 01:40:39 +01:00
|
|
|
ptw.io.requestor(0) <> icache.io.ptw
|
|
|
|
ptw.io.requestor(1) <> dcache.io.ptw
|
2013-09-13 07:34:38 +02:00
|
|
|
|
2015-08-02 06:11:25 +02:00
|
|
|
io.host <> core.io.host
|
|
|
|
icache.io.cpu <> core.io.imem
|
2013-09-15 07:34:53 +02:00
|
|
|
core.io.ptw <> ptw.io.dpath
|
|
|
|
|
2015-07-22 02:10:56 +02:00
|
|
|
//If so specified, build an FPU module and wire it in
|
2015-10-06 06:48:05 +02:00
|
|
|
p(BuildFPU) foreach { fpu => core.io.fpu <> fpu(p).io }
|
2015-07-22 02:10:56 +02:00
|
|
|
|
2015-03-13 00:27:40 +01:00
|
|
|
// Connect the caches and ROCC to the outer memory system
|
|
|
|
io.cached <> dcache.io.mem
|
|
|
|
// If so specified, build an RoCC module and wire it in
|
|
|
|
// otherwise, just hookup the icache
|
2015-10-06 06:48:05 +02:00
|
|
|
io.uncached <> p(BuildRoCC).map { buildItHere =>
|
2015-03-13 00:27:40 +01:00
|
|
|
val rocc = buildItHere()
|
2015-04-18 01:56:53 +02:00
|
|
|
val memArb = Module(new ClientTileLinkIOArbiter(3))
|
2015-10-06 06:48:05 +02:00
|
|
|
val dcIF = Module(new SimpleHellaCacheIF()(dcacheParams))
|
2015-03-13 00:27:40 +01:00
|
|
|
core.io.rocc <> rocc.io
|
|
|
|
dcIF.io.requestor <> rocc.io.mem
|
|
|
|
dcArb.io.requestor(2) <> dcIF.io.cache
|
|
|
|
memArb.io.in(0) <> icache.io.mem
|
|
|
|
memArb.io.in(1) <> rocc.io.imem
|
|
|
|
memArb.io.in(2) <> rocc.io.dmem
|
|
|
|
ptw.io.requestor(2) <> rocc.io.iptw
|
|
|
|
ptw.io.requestor(3) <> rocc.io.dptw
|
|
|
|
ptw.io.requestor(4) <> rocc.io.pptw
|
|
|
|
memArb.io.out
|
|
|
|
}.getOrElse(icache.io.mem)
|
2012-03-25 00:56:59 +01:00
|
|
|
}
|