1
0
rocket-chip/rocket/src/main/scala/tile.scala

66 lines
2.5 KiB
Scala
Raw Normal View History

package rocket
import Chisel._
import uncore._
import Util._
case class RocketConfiguration(tl: TileLinkConfiguration,
icache: ICacheConfig, dcache: DCacheConfig,
fpu: Boolean, vec: Boolean,
2012-11-25 07:01:08 +01:00
fastLoadWord: Boolean = true,
fastLoadByte: Boolean = false,
fastMulDiv: Boolean = true)
2012-11-06 08:52:32 +01:00
{
val dcacheReqTagBits = 9 // enforce compliance with require()
val xprlen = 64
val nxpr = 32
val nxprbits = log2Up(nxpr)
2012-11-25 07:01:08 +01:00
if (fastLoadByte) require(fastLoadWord)
2012-11-06 08:52:32 +01:00
}
2012-11-05 01:59:36 +01:00
2013-08-13 05:51:54 +02:00
class Tile(resetSignal: Bool = null)(confIn: RocketConfiguration) extends Module(_reset = resetSignal) with ClientCoherenceAgent
{
val memPorts = 2 + confIn.vec
val dcachePortId = 0
val icachePortId = 1
val vicachePortId = 2
implicit val tlConf = confIn.tl
implicit val lnConf = confIn.tl.ln
2013-08-12 19:39:11 +02:00
implicit val icConf = confIn.icache
implicit val dcConf = confIn.dcache.copy(reqtagbits = confIn.dcacheReqTagBits + log2Up(memPorts), databits = confIn.xprlen)
2012-11-06 08:52:32 +01:00
implicit val conf = confIn.copy(dcache = dcConf)
val io = new Bundle {
2013-01-07 22:38:59 +01:00
val tilelink = new TileLinkIO
val host = new HTIFIO(lnConf.nClients)
}
2012-11-06 08:52:32 +01:00
2013-08-12 19:39:11 +02:00
val core = Module(new Core)
val icache = Module(new Frontend)
val dcache = Module(new HellaCache)
2013-08-12 19:39:11 +02:00
val arbiter = Module(new UncachedTileLinkIOArbiterThatAppendsArbiterId(memPorts))
arbiter.io.in(dcachePortId) <> dcache.io.mem
arbiter.io.in(icachePortId) <> icache.io.mem
io.tilelink.acquire <> arbiter.io.out.acquire
arbiter.io.out.grant <> io.tilelink.grant
io.tilelink.grant_ack <> arbiter.io.out.grant_ack
2013-01-22 02:18:23 +01:00
dcache.io.mem.probe <> io.tilelink.probe
io.tilelink.release.data <> dcache.io.mem.release.data
io.tilelink.release.meta.valid := dcache.io.mem.release.meta.valid
dcache.io.mem.release.meta.ready := io.tilelink.release.meta.ready
io.tilelink.release.meta.bits := dcache.io.mem.release.meta.bits
2013-08-12 19:39:11 +02:00
io.tilelink.release.meta.bits.payload.client_xact_id := Cat(dcache.io.mem.release.meta.bits.payload.client_xact_id, UInt(dcachePortId, log2Up(memPorts))) // Mimic client id extension done by UncachedTileLinkIOArbiter for Acquires from either client)
if (conf.vec) {
2013-08-12 19:39:11 +02:00
val vicache = Module(new Frontend()(ICacheConfig(128, 1), tlConf)) // 128 sets x 1 ways (8KB)
arbiter.io.in(vicachePortId) <> vicache.io.mem
core.io.vimem <> vicache.io.cpu
}
core.io.host <> io.host
core.io.imem <> icache.io.cpu
core.io.dmem <> dcache.io.cpu
}