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-08-08 21:23:02 +02:00
|
|
|
case object NDCachePorts extends Field[Int]
|
|
|
|
case object NTilePorts extends Field[Int]
|
|
|
|
case object BuildRoCC extends Field[Option[() => RoCC]]
|
|
|
|
case object RetireWidth extends Field[Int]
|
|
|
|
case object UseVM extends Field[Boolean]
|
|
|
|
case object FastLoadWord extends Field[Boolean]
|
|
|
|
case object FastLoadByte extends Field[Boolean]
|
|
|
|
case object FastMulDiv extends Field[Boolean]
|
|
|
|
case object DcacheReqTagBits extends Field[Int]
|
|
|
|
case object XprLen extends Field[Int]
|
|
|
|
case object NXpr extends Field[Int]
|
|
|
|
case object NXprBits extends Field[Int]
|
|
|
|
case object RocketDCacheParams extends Field[PF]
|
|
|
|
case object RocketFrontendParams extends Field[PF]
|
|
|
|
|
|
|
|
class Tile(resetSignal: Bool = null) extends Module(_reset = resetSignal) {
|
2012-11-05 01:59:36 +01:00
|
|
|
|
2014-08-08 21:23:02 +02:00
|
|
|
if(params(FastLoadByte)) require(params(FastLoadWord))
|
|
|
|
require(params(RetireWidth) == 1) // for now...
|
2012-11-06 08:52:32 +01:00
|
|
|
|
2012-03-25 00:56:59 +01:00
|
|
|
val io = new Bundle {
|
2013-01-07 22:38:59 +01:00
|
|
|
val tilelink = new TileLinkIO
|
2014-08-08 21:23:02 +02:00
|
|
|
val host = new HTIFIO
|
2012-03-25 00:56:59 +01:00
|
|
|
}
|
2014-08-08 21:23:02 +02:00
|
|
|
// Mimic client id extension done by UncachedTileLinkIOArbiter for Acquires from either client)
|
2012-11-06 08:52:32 +01:00
|
|
|
|
2014-08-08 21:23:02 +02:00
|
|
|
val optionalRoCC = params(BuildRoCC)
|
|
|
|
|
|
|
|
params.alter(params(RocketFrontendParams)) // Used in icache, Core
|
2013-08-12 19:39:11 +02:00
|
|
|
val icache = Module(new Frontend)
|
2014-08-08 21:23:02 +02:00
|
|
|
params.alter(params(RocketDCacheParams)) // Used in dcache, PTW, RoCCm Core
|
2013-08-12 19:39:11 +02:00
|
|
|
val dcache = Module(new HellaCache)
|
2014-08-08 21:23:02 +02:00
|
|
|
val ptw = Module(new PTW(if(optionalRoCC.isEmpty) 2 else 5))
|
|
|
|
// 2 ports, 1 from I$, 1 from D$, maybe 3 from RoCC
|
|
|
|
val core = Module(new Core)
|
2012-03-25 00:56:59 +01:00
|
|
|
|
2014-08-08 21:23:02 +02:00
|
|
|
val dcArb = Module(new HellaCacheArbiter(params(NDCachePorts)))
|
|
|
|
dcArb.io.requestor(0) <> ptw.io.mem
|
|
|
|
dcArb.io.requestor(1) <> core.io.dmem
|
|
|
|
dcArb.io.mem <> dcache.io.cpu
|
2012-03-25 00:56:59 +01:00
|
|
|
|
2013-09-13 07:34:38 +02:00
|
|
|
ptw.io.requestor(0) <> icache.io.cpu.ptw
|
|
|
|
ptw.io.requestor(1) <> dcache.io.cpu.ptw
|
|
|
|
|
2013-09-15 07:34:53 +02:00
|
|
|
core.io.host <> io.host
|
|
|
|
core.io.imem <> icache.io.cpu
|
|
|
|
core.io.ptw <> ptw.io.dpath
|
|
|
|
|
2014-08-08 21:23:02 +02:00
|
|
|
val memArb = Module(new UncachedTileLinkIOArbiterThatAppendsArbiterId(params(NTilePorts)))
|
|
|
|
val dcPortId = 0
|
|
|
|
memArb.io.in(dcPortId) <> dcache.io.mem
|
|
|
|
memArb.io.in(1) <> icache.io.mem
|
2013-09-13 07:34:38 +02:00
|
|
|
|
2014-08-08 21:23:02 +02:00
|
|
|
if(!optionalRoCC.isEmpty) {
|
|
|
|
val rocc = Module(optionalRoCC.get())
|
2014-01-17 01:01:41 +01:00
|
|
|
val dcIF = Module(new SimpleHellaCacheIF)
|
|
|
|
dcIF.io.requestor <> rocc.io.mem
|
2013-11-06 02:12:09 +01:00
|
|
|
core.io.rocc <> rocc.io
|
2014-08-08 21:23:02 +02:00
|
|
|
dcArb.io.requestor(2) <> dcIF.io.cache
|
|
|
|
memArb.io.in(2) <> rocc.io.imem
|
2013-11-06 02:12:09 +01:00
|
|
|
ptw.io.requestor(2) <> rocc.io.iptw
|
|
|
|
ptw.io.requestor(3) <> rocc.io.dptw
|
|
|
|
ptw.io.requestor(4) <> rocc.io.pptw
|
|
|
|
}
|
2014-08-08 21:23:02 +02:00
|
|
|
|
2013-09-13 07:34:38 +02:00
|
|
|
io.tilelink.acquire <> memArb.io.out.acquire
|
2014-08-08 21:23:02 +02:00
|
|
|
io.tilelink.grant <> memArb.io.out.grant
|
2014-04-27 00:18:21 +02:00
|
|
|
io.tilelink.finish <> memArb.io.out.finish
|
2014-08-08 21:23:02 +02:00
|
|
|
// Probes and releases routed directly to coherent dcache
|
|
|
|
io.tilelink.probe <> dcache.io.mem.probe
|
|
|
|
// Mimic client id extension done by UncachedTileLinkIOArbiter for Acquires from either client)
|
2014-03-29 18:59:07 +01:00
|
|
|
io.tilelink.release.valid := dcache.io.mem.release.valid
|
|
|
|
dcache.io.mem.release.ready := io.tilelink.release.ready
|
|
|
|
io.tilelink.release.bits := dcache.io.mem.release.bits
|
2014-08-08 21:23:02 +02:00
|
|
|
io.tilelink.release.bits.payload.client_xact_id := Cat(dcache.io.mem.release.bits.payload.client_xact_id, UInt(dcPortId, log2Up(params(NTilePorts))))
|
2012-03-25 00:56:59 +01:00
|
|
|
}
|