2012-03-25 00:56:59 +01:00
|
|
|
package rocket
|
|
|
|
|
|
|
|
import Chisel._
|
|
|
|
import Node._
|
|
|
|
import Constants._
|
2012-10-02 01:08:41 +02:00
|
|
|
import uncore._
|
2012-03-25 00:56:59 +01:00
|
|
|
|
2012-11-05 01:59:36 +01:00
|
|
|
case class RocketConfiguration(ntiles: Int, co: CoherencePolicyWithUncached,
|
2012-11-16 11:39:33 +01:00
|
|
|
icache: ICacheConfig, dcache: DCacheConfig,
|
|
|
|
fastLoadByte: Boolean = false)
|
2012-11-06 08:52:32 +01:00
|
|
|
{
|
|
|
|
val dcacheReqTagBits = 9 // enforce compliance with require()
|
|
|
|
}
|
2012-11-05 01:59:36 +01:00
|
|
|
|
2012-11-06 08:52:32 +01:00
|
|
|
class Tile(resetSignal: Bool = null)(confIn: RocketConfiguration) extends Component(resetSignal)
|
2012-03-25 00:56:59 +01:00
|
|
|
{
|
2012-11-06 17:13:44 +01:00
|
|
|
val memPorts = if (HAVE_VEC) 3 else 2
|
|
|
|
implicit val dcConf = confIn.dcache.copy(reqtagbits = confIn.dcacheReqTagBits + log2Up(memPorts))
|
2012-11-06 08:52:32 +01:00
|
|
|
implicit val conf = confIn.copy(dcache = dcConf)
|
|
|
|
|
2012-03-25 00:56:59 +01:00
|
|
|
val io = new Bundle {
|
|
|
|
val tilelink = new ioTileLink
|
2012-10-19 02:26:03 +02:00
|
|
|
val host = new ioHTIF(conf.ntiles)
|
2012-03-25 00:56:59 +01:00
|
|
|
}
|
2012-11-06 08:52:32 +01:00
|
|
|
|
2012-11-06 17:13:44 +01:00
|
|
|
val core = new Core
|
2012-11-06 08:52:32 +01:00
|
|
|
val icache = new Frontend()(confIn.icache)
|
2012-10-08 07:37:29 +02:00
|
|
|
val dcache = new HellaCache
|
2012-03-25 00:56:59 +01:00
|
|
|
|
2012-11-06 17:13:44 +01:00
|
|
|
val arbiter = new MemArbiter(memPorts)
|
|
|
|
arbiter.io.requestor(0) <> dcache.io.mem
|
|
|
|
arbiter.io.requestor(1) <> icache.io.mem
|
2012-03-25 00:56:59 +01:00
|
|
|
|
2012-07-18 07:55:00 +02:00
|
|
|
io.tilelink.xact_init <> arbiter.io.mem.xact_init
|
|
|
|
io.tilelink.xact_init_data <> dcache.io.mem.xact_init_data
|
|
|
|
arbiter.io.mem.xact_abort <> io.tilelink.xact_abort
|
|
|
|
arbiter.io.mem.xact_rep <> io.tilelink.xact_rep
|
|
|
|
io.tilelink.xact_finish <> arbiter.io.mem.xact_finish
|
|
|
|
dcache.io.mem.probe_req <> io.tilelink.probe_req
|
|
|
|
io.tilelink.probe_rep <> dcache.io.mem.probe_rep
|
|
|
|
io.tilelink.probe_rep_data <> dcache.io.mem.probe_rep_data
|
2012-03-25 00:56:59 +01:00
|
|
|
|
2012-11-06 17:13:44 +01:00
|
|
|
if (HAVE_VEC) {
|
2012-11-06 08:52:32 +01:00
|
|
|
val vicache = new Frontend()(ICacheConfig(128, 1, conf.co)) // 128 sets x 1 ways (8KB)
|
2012-11-06 17:13:44 +01:00
|
|
|
arbiter.io.requestor(2) <> vicache.io.mem
|
|
|
|
core.io.vimem <> vicache.io.cpu
|
2012-03-25 00:56:59 +01:00
|
|
|
}
|
|
|
|
|
2012-11-06 17:13:44 +01:00
|
|
|
core.io.host <> io.host
|
|
|
|
core.io.imem <> icache.io.cpu
|
|
|
|
core.io.dmem <> dcache.io.cpu
|
2012-03-25 00:56:59 +01:00
|
|
|
}
|