2014-09-12 19:15:04 +02:00
|
|
|
// See LICENSE for license details.
|
|
|
|
|
2014-09-01 05:26:55 +02:00
|
|
|
package rocketchip
|
2012-10-09 22:05:56 +02:00
|
|
|
|
|
|
|
import Chisel._
|
2015-10-22 03:23:58 +02:00
|
|
|
import cde.{Parameters, Field}
|
2015-07-30 02:56:19 +02:00
|
|
|
import junctions._
|
2012-10-09 22:05:56 +02:00
|
|
|
import uncore._
|
|
|
|
import rocket._
|
2013-01-25 08:56:45 +01:00
|
|
|
import rocket.Util._
|
2012-10-09 22:05:56 +02:00
|
|
|
|
2015-06-26 08:17:35 +02:00
|
|
|
/** Top-level parameters of RocketChip, values set in e.g. PublicConfigs.scala */
|
|
|
|
|
|
|
|
/** Number of tiles */
|
2014-08-08 21:27:47 +02:00
|
|
|
case object NTiles extends Field[Int]
|
2015-06-26 08:17:35 +02:00
|
|
|
/** Number of memory channels */
|
|
|
|
case object NMemoryChannels extends Field[Int]
|
|
|
|
/** Number of banks per memory channel */
|
|
|
|
case object NBanksPerMemoryChannel extends Field[Int]
|
|
|
|
/** Least significant bit of address used for bank partitioning */
|
2014-08-08 21:27:47 +02:00
|
|
|
case object BankIdLSB extends Field[Int]
|
2015-06-26 08:17:35 +02:00
|
|
|
/** Number of outstanding memory requests */
|
|
|
|
case object NOutstandingMemReqsPerChannel extends Field[Int]
|
|
|
|
/** Whether to use the slow backup memory port [VLSI] */
|
2014-08-25 04:30:53 +02:00
|
|
|
case object UseBackupMemoryPort extends Field[Boolean]
|
2015-06-26 08:17:35 +02:00
|
|
|
/** Function for building some kind of coherence manager agent */
|
2015-11-22 01:11:22 +01:00
|
|
|
case object BuildL2CoherenceManager extends Field[(Int, Parameters) => CoherenceAgent]
|
2015-06-26 08:17:35 +02:00
|
|
|
/** Function for building some kind of tile connected to a reset signal */
|
2015-10-06 19:47:38 +02:00
|
|
|
case object BuildTiles extends Field[Seq[(Bool, Parameters) => Tile]]
|
2015-11-18 03:21:52 +01:00
|
|
|
/** Enable DMA engine */
|
|
|
|
case object UseDma extends Field[Boolean]
|
2015-06-26 08:17:35 +02:00
|
|
|
|
2016-01-07 06:38:35 +01:00
|
|
|
case object UseStreamLoopback extends Field[Boolean]
|
|
|
|
case object StreamLoopbackSize extends Field[Int]
|
|
|
|
case object StreamLoopbackWidth extends Field[Int]
|
|
|
|
|
2015-06-26 08:17:35 +02:00
|
|
|
/** Utility trait for quick access to some relevant parameters */
|
2015-10-14 08:44:05 +02:00
|
|
|
trait HasTopLevelParameters {
|
|
|
|
implicit val p: Parameters
|
2015-11-18 03:21:52 +01:00
|
|
|
lazy val useDma = p(UseDma)
|
2015-10-02 23:23:42 +02:00
|
|
|
lazy val nTiles = p(NTiles)
|
2015-10-21 00:04:39 +02:00
|
|
|
lazy val nCachedTilePorts = p(TLKey("L1toL2")).nCachingClients
|
2015-11-18 03:21:52 +01:00
|
|
|
lazy val nUncachedTilePorts =
|
|
|
|
p(TLKey("L1toL2")).nCachelessClients - (if (useDma) 2 else 1)
|
2015-10-14 08:44:05 +02:00
|
|
|
lazy val htifW = p(HtifKey).width
|
2015-10-06 19:47:38 +02:00
|
|
|
lazy val csrAddrBits = 12
|
2015-10-02 23:23:42 +02:00
|
|
|
lazy val nMemChannels = p(NMemoryChannels)
|
|
|
|
lazy val nBanksPerMemChannel = p(NBanksPerMemoryChannel)
|
|
|
|
lazy val nBanks = nMemChannels*nBanksPerMemChannel
|
|
|
|
lazy val lsb = p(BankIdLSB)
|
|
|
|
lazy val nMemReqs = p(NOutstandingMemReqsPerChannel)
|
|
|
|
lazy val mifAddrBits = p(MIFAddrBits)
|
|
|
|
lazy val mifDataBeats = p(MIFDataBeats)
|
|
|
|
lazy val xLen = p(XLen)
|
2015-10-14 08:44:05 +02:00
|
|
|
lazy val nSCR = p(HtifKey).nSCR
|
|
|
|
lazy val scrAddrBits = log2Up(nSCR)
|
|
|
|
lazy val scrDataBits = 64
|
|
|
|
lazy val scrDataBytes = scrDataBits / 8
|
2015-10-02 23:23:42 +02:00
|
|
|
//require(lsb + log2Up(nBanks) < mifAddrBits)
|
2014-08-25 04:30:53 +02:00
|
|
|
}
|
2014-09-24 22:08:45 +02:00
|
|
|
|
2015-06-26 08:17:35 +02:00
|
|
|
class MemBackupCtrlIO extends Bundle {
|
|
|
|
val en = Bool(INPUT)
|
|
|
|
val in_valid = Bool(INPUT)
|
|
|
|
val out_ready = Bool(INPUT)
|
|
|
|
val out_valid = Bool(OUTPUT)
|
|
|
|
}
|
2012-10-09 22:05:56 +02:00
|
|
|
|
2015-06-26 08:17:35 +02:00
|
|
|
/** Top-level io for the chip */
|
2015-10-06 19:47:38 +02:00
|
|
|
class BasicTopIO(implicit val p: Parameters) extends ParameterizedBundle()(p)
|
|
|
|
with HasTopLevelParameters {
|
2015-10-14 08:44:05 +02:00
|
|
|
val host = new HostIO(htifW)
|
2015-06-26 08:17:35 +02:00
|
|
|
val mem_backup_ctrl = new MemBackupCtrlIO
|
|
|
|
}
|
2012-10-09 22:05:56 +02:00
|
|
|
|
2015-10-06 19:47:38 +02:00
|
|
|
class TopIO(implicit p: Parameters) extends BasicTopIO()(p) {
|
2016-01-15 00:06:30 +01:00
|
|
|
val mem = Vec(nMemChannels, new NastiIO)
|
2015-06-26 08:17:35 +02:00
|
|
|
}
|
|
|
|
|
2015-10-26 22:11:49 +01:00
|
|
|
object TopUtils {
|
|
|
|
// Connect two Nasti interfaces with queues in-between
|
|
|
|
def connectNasti(outer: NastiIO, inner: NastiIO)(implicit p: Parameters) {
|
|
|
|
val mifDataBeats = p(MIFDataBeats)
|
|
|
|
outer.ar <> Queue(inner.ar)
|
|
|
|
outer.aw <> Queue(inner.aw)
|
|
|
|
outer.w <> Queue(inner.w, mifDataBeats)
|
|
|
|
inner.r <> Queue(outer.r, mifDataBeats)
|
|
|
|
inner.b <> Queue(outer.b)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-06-26 08:17:35 +02:00
|
|
|
/** Top-level module for the chip */
|
|
|
|
//TODO: Remove this wrapper once multichannel DRAM controller is provided
|
2015-10-22 03:23:58 +02:00
|
|
|
class Top(topParams: Parameters) extends Module with HasTopLevelParameters {
|
|
|
|
implicit val p = topParams
|
2015-06-26 08:17:35 +02:00
|
|
|
val io = new TopIO
|
2015-08-06 21:51:18 +02:00
|
|
|
|
2015-06-26 08:17:35 +02:00
|
|
|
// Build an Uncore and a set of Tiles
|
2015-10-14 08:44:05 +02:00
|
|
|
val innerTLParams = p.alterPartial({case TLId => "L1toL2" })
|
2015-10-06 19:47:38 +02:00
|
|
|
val uncore = Module(new Uncore()(innerTLParams))
|
|
|
|
val tileList = uncore.io.htif zip p(BuildTiles) map { case(hl, bt) => bt(hl.reset, p) }
|
2015-06-26 08:17:35 +02:00
|
|
|
|
|
|
|
// Connect each tile to the HTIF
|
|
|
|
uncore.io.htif.zip(tileList).zipWithIndex.foreach {
|
|
|
|
case ((hl, tile), i) =>
|
|
|
|
tile.io.host.id := UInt(i)
|
|
|
|
tile.io.host.reset := Reg(next=Reg(next=hl.reset))
|
2015-10-06 19:47:38 +02:00
|
|
|
tile.io.host.csr.req <> Queue(hl.csr.req)
|
|
|
|
hl.csr.resp <> Queue(tile.io.host.csr.resp)
|
|
|
|
hl.debug_stats_csr := tile.io.host.debug_stats_csr
|
2014-08-25 04:30:53 +02:00
|
|
|
}
|
2015-06-26 08:17:35 +02:00
|
|
|
|
|
|
|
// Connect the uncore to the tile memory ports, HostIO and MemIO
|
2015-10-21 00:04:39 +02:00
|
|
|
uncore.io.tiles_cached <> tileList.map(_.io.cached).flatten
|
|
|
|
uncore.io.tiles_uncached <> tileList.map(_.io.uncached).flatten
|
2015-08-04 03:54:56 +02:00
|
|
|
io.host <> uncore.io.host
|
2015-10-31 05:14:33 +01:00
|
|
|
if (p(UseBackupMemoryPort)) { io.mem_backup_ctrl <> uncore.io.mem_backup_ctrl }
|
|
|
|
|
2015-11-03 02:01:28 +01:00
|
|
|
io.mem.zip(uncore.io.mem).foreach { case (outer, inner) =>
|
|
|
|
TopUtils.connectNasti(outer, inner)
|
|
|
|
// Memory cache type should be normal non-cacheable bufferable
|
|
|
|
outer.ar.bits.cache := UInt("b0011")
|
|
|
|
outer.aw.bits.cache := UInt("b0011")
|
|
|
|
}
|
2012-10-09 22:05:56 +02:00
|
|
|
}
|
|
|
|
|
2015-06-26 08:17:35 +02:00
|
|
|
/** Wrapper around everything that isn't a Tile.
|
|
|
|
*
|
|
|
|
* Usually this is clocked and/or place-and-routed separately from the Tiles.
|
|
|
|
* Contains the Host-Target InterFace module (HTIF).
|
|
|
|
*/
|
2015-10-21 00:04:39 +02:00
|
|
|
class Uncore(implicit val p: Parameters) extends Module
|
|
|
|
with HasTopLevelParameters {
|
2012-10-09 22:05:56 +02:00
|
|
|
val io = new Bundle {
|
2015-10-14 08:44:05 +02:00
|
|
|
val host = new HostIO(htifW)
|
2016-01-15 00:06:30 +01:00
|
|
|
val mem = Vec(nMemChannels, new NastiIO)
|
2015-10-21 00:04:39 +02:00
|
|
|
val tiles_cached = Vec(nCachedTilePorts, new ClientTileLinkIO).flip
|
|
|
|
val tiles_uncached = Vec(nUncachedTilePorts, new ClientUncachedTileLinkIO).flip
|
2016-01-15 00:06:30 +01:00
|
|
|
val htif = Vec(nTiles, new HtifIO).flip
|
2015-06-26 08:17:35 +02:00
|
|
|
val mem_backup_ctrl = new MemBackupCtrlIO
|
2015-10-02 23:23:42 +02:00
|
|
|
val mmio = new NastiIO
|
2013-04-23 02:38:13 +02:00
|
|
|
}
|
|
|
|
|
2015-10-06 19:47:38 +02:00
|
|
|
val htif = Module(new Htif(CSRs.mreset)) // One HTIF module per chip
|
2014-08-25 04:30:53 +02:00
|
|
|
val outmemsys = Module(new OuterMemorySystem) // NoC, LLC and SerDes
|
2015-06-26 08:17:35 +02:00
|
|
|
outmemsys.io.incoherent := htif.io.cpu.map(_.reset)
|
|
|
|
outmemsys.io.htif_uncached <> htif.io.mem
|
|
|
|
outmemsys.io.tiles_uncached <> io.tiles_uncached
|
|
|
|
outmemsys.io.tiles_cached <> io.tiles_cached
|
2013-09-25 10:21:41 +02:00
|
|
|
|
2015-08-06 21:51:18 +02:00
|
|
|
for (i <- 0 until nTiles) {
|
|
|
|
io.htif(i).reset := htif.io.cpu(i).reset
|
|
|
|
io.htif(i).id := htif.io.cpu(i).id
|
2015-10-06 19:47:38 +02:00
|
|
|
htif.io.cpu(i).debug_stats_csr <> io.htif(i).debug_stats_csr
|
2015-08-06 21:51:18 +02:00
|
|
|
|
2016-01-12 01:19:21 +01:00
|
|
|
val csr_arb = Module(new SmiArbiter(2, xLen, csrAddrBits))
|
2015-10-06 19:47:38 +02:00
|
|
|
csr_arb.io.in(0) <> htif.io.cpu(i).csr
|
|
|
|
csr_arb.io.in(1) <> outmemsys.io.csr(i)
|
|
|
|
io.htif(i).csr <> csr_arb.io.out
|
2015-08-06 21:51:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Arbitrate SCR access between MMIO and HTIF
|
2016-02-18 00:23:18 +01:00
|
|
|
val scrFile = Module(new SCRFile("UNCORE_SCR"))
|
2016-01-12 01:19:21 +01:00
|
|
|
val scrArb = Module(new SmiArbiter(2, scrDataBits, scrAddrBits))
|
2015-08-06 21:51:18 +02:00
|
|
|
scrArb.io.in(0) <> htif.io.scr
|
|
|
|
scrArb.io.in(1) <> outmemsys.io.scr
|
|
|
|
scrFile.io.smi <> scrArb.io.out
|
|
|
|
// scrFile.io.scr <> (... your SCR connections ...)
|
|
|
|
|
2015-11-26 06:10:09 +01:00
|
|
|
val deviceTree = Module(new NastiROM(p(DeviceTree).toSeq))
|
|
|
|
deviceTree.io <> outmemsys.io.deviceTree
|
|
|
|
|
2014-08-25 04:30:53 +02:00
|
|
|
// Wire the htif to the memory port(s) and host interface
|
2015-10-06 19:47:38 +02:00
|
|
|
io.host.debug_stats_csr := htif.io.host.debug_stats_csr
|
2015-08-04 03:54:56 +02:00
|
|
|
io.mem <> outmemsys.io.mem
|
2015-10-02 23:23:42 +02:00
|
|
|
if(p(UseBackupMemoryPort)) {
|
2015-06-26 08:17:35 +02:00
|
|
|
outmemsys.io.mem_backup_en := io.mem_backup_ctrl.en
|
2015-08-06 21:51:18 +02:00
|
|
|
VLSIUtils.padOutHTIFWithDividedClock(htif.io.host, scrFile.io.scr,
|
|
|
|
outmemsys.io.mem_backup, io.mem_backup_ctrl, io.host, htifW)
|
2014-08-25 04:30:53 +02:00
|
|
|
} else {
|
|
|
|
htif.io.host.out <> io.host.out
|
|
|
|
htif.io.host.in <> io.host.in
|
|
|
|
}
|
2012-10-09 22:05:56 +02:00
|
|
|
}
|
|
|
|
|
2015-06-26 08:17:35 +02:00
|
|
|
/** The whole outer memory hierarchy, including a NoC, some kind of coherence
|
|
|
|
* manager agent, and a converter from TileLink to MemIO.
|
|
|
|
*/
|
2015-10-06 19:47:38 +02:00
|
|
|
class OuterMemorySystem(implicit val p: Parameters) extends Module with HasTopLevelParameters {
|
2015-06-26 08:17:35 +02:00
|
|
|
val io = new Bundle {
|
2015-10-21 00:04:39 +02:00
|
|
|
val tiles_cached = Vec(nCachedTilePorts, new ClientTileLinkIO).flip
|
|
|
|
val tiles_uncached = Vec(nUncachedTilePorts, new ClientUncachedTileLinkIO).flip
|
2015-06-26 08:17:35 +02:00
|
|
|
val htif_uncached = (new ClientUncachedTileLinkIO).flip
|
2016-01-15 00:06:30 +01:00
|
|
|
val incoherent = Vec(nTiles, Bool()).asInput
|
|
|
|
val mem = Vec(nMemChannels, new NastiIO)
|
2015-06-26 08:17:35 +02:00
|
|
|
val mem_backup = new MemSerializedIO(htifW)
|
|
|
|
val mem_backup_en = Bool(INPUT)
|
2016-01-15 00:06:30 +01:00
|
|
|
val csr = Vec(nTiles, new SmiIO(xLen, csrAddrBits))
|
2016-01-12 01:19:21 +01:00
|
|
|
val scr = new SmiIO(xLen, scrAddrBits)
|
2015-11-26 06:10:09 +01:00
|
|
|
val deviceTree = new NastiIO
|
2012-10-09 22:05:56 +02:00
|
|
|
}
|
|
|
|
|
2016-01-15 00:10:40 +01:00
|
|
|
val dmaOpt = if (p(UseDma))
|
|
|
|
Some(Module(new DmaEngine(
|
|
|
|
DmaCtrlRegNumbers.CSR_BASE + DmaCtrlRegNumbers.OUTSTANDING)))
|
|
|
|
else None
|
|
|
|
val mmioBase = p(MMIOBase)
|
2015-11-18 03:21:52 +01:00
|
|
|
|
2015-06-26 08:17:35 +02:00
|
|
|
// Create a simple L1toL2 NoC between the tiles+htif and the banks of outer memory
|
|
|
|
// Cached ports are first in client list, making sharerToClientId just an indentity function
|
|
|
|
// addrToBank is sed to hash physical addresses (of cache blocks) to banks (and thereby memory channels)
|
2015-11-18 03:21:52 +01:00
|
|
|
val ordered_clients = (io.tiles_cached ++
|
2016-01-15 00:10:40 +01:00
|
|
|
(io.tiles_uncached ++ dmaOpt.map(_.io.mem) :+ io.htif_uncached)
|
2015-11-18 03:21:52 +01:00
|
|
|
.map(TileLinkIOWrapper(_)))
|
2015-06-26 08:17:35 +02:00
|
|
|
def sharerToClientId(sharerId: UInt) = sharerId
|
2016-01-15 00:10:40 +01:00
|
|
|
def addrToBank(addr: Bits): UInt = {
|
|
|
|
Mux(addr.toUInt < UInt(mmioBase >> log2Up(p(CacheBlockBytes))),
|
|
|
|
if (nBanks > 1) addr(lsb + log2Up(nBanks) - 1, lsb) else UInt(0),
|
|
|
|
UInt(nBanks))
|
|
|
|
}
|
2015-06-26 08:17:35 +02:00
|
|
|
val preBuffering = TileLinkDepths(2,2,2,2,2)
|
|
|
|
val postBuffering = TileLinkDepths(0,0,1,0,0) //TODO: had EOS24 crit path on inner.release
|
2016-01-15 00:10:40 +01:00
|
|
|
val l1tol2net = Module(new RocketChipTileLinkCrossbar(addrToBank, sharerToClientId, preBuffering, postBuffering))
|
2015-06-26 08:17:35 +02:00
|
|
|
|
|
|
|
// Create point(s) of coherence serialization
|
2016-01-15 00:10:40 +01:00
|
|
|
val managerEndpoints = List.tabulate(nBanks){id => p(BuildL2CoherenceManager)(id, p)}
|
2015-08-06 21:51:18 +02:00
|
|
|
managerEndpoints.foreach { _.incoherent := io.incoherent }
|
2015-06-26 08:17:35 +02:00
|
|
|
|
2016-01-15 00:10:40 +01:00
|
|
|
val mmioManager = Module(new MMIOTileLinkManager()(p.alterPartial({
|
|
|
|
case TLId => "L1toL2"
|
|
|
|
case InnerTLId => "L1toL2"
|
|
|
|
case OuterTLId => "L2toMC"
|
|
|
|
})))
|
|
|
|
|
2015-06-26 08:17:35 +02:00
|
|
|
// Wire the tiles and htif to the TileLink client ports of the L1toL2 network,
|
|
|
|
// and coherence manager(s) to the other side
|
|
|
|
l1tol2net.io.clients <> ordered_clients
|
2016-01-15 00:10:40 +01:00
|
|
|
l1tol2net.io.managers <> managerEndpoints.map(_.innerTL) :+ mmioManager.io.inner
|
2015-06-26 08:17:35 +02:00
|
|
|
|
|
|
|
// Create a converter between TileLinkIO and MemIO for each channel
|
2015-10-14 08:44:05 +02:00
|
|
|
val outerTLParams = p.alterPartial({ case TLId => "L2toMC" })
|
2015-10-21 06:10:54 +02:00
|
|
|
val outermostTLParams = p.alterPartial({case TLId => "Outermost"})
|
2015-06-26 08:17:35 +02:00
|
|
|
val backendBuffering = TileLinkDepths(0,0,0,0,0)
|
2015-08-06 21:51:18 +02:00
|
|
|
|
2015-10-07 03:24:08 +02:00
|
|
|
val addrMap = p(GlobalAddrMap)
|
2016-01-15 00:10:40 +01:00
|
|
|
val addrHashMap = new AddrHashMap(addrMap, mmioBase)
|
|
|
|
val nMasters = (if (dmaOpt.isEmpty) 2 else 3)
|
2015-10-07 03:24:08 +02:00
|
|
|
val nSlaves = addrHashMap.nEntries
|
2015-08-06 21:51:18 +02:00
|
|
|
|
|
|
|
println("Generated Address Map")
|
2015-10-07 03:24:08 +02:00
|
|
|
for ((name, base, size, _) <- addrHashMap.sortedEntries) {
|
2015-08-06 21:51:18 +02:00
|
|
|
println(f"\t$name%s $base%x - ${base + size - 1}%x")
|
2015-06-26 08:17:35 +02:00
|
|
|
}
|
2014-08-25 04:30:53 +02:00
|
|
|
|
2016-01-15 00:10:40 +01:00
|
|
|
val mmio_ic = Module(new NastiRecursiveInterconnect(nMasters, nSlaves, addrMap, mmioBase))
|
|
|
|
val mem_ic = Module(new NastiMemoryInterconnect(nBanksPerMemChannel, nMemChannels))
|
2015-08-06 21:51:18 +02:00
|
|
|
|
|
|
|
for ((bank, i) <- managerEndpoints.zipWithIndex) {
|
2015-10-06 19:47:38 +02:00
|
|
|
val unwrap = Module(new ClientTileLinkIOUnwrapper()(outerTLParams))
|
2015-10-14 21:16:22 +02:00
|
|
|
val narrow = Module(new TileLinkIONarrower("L2toMC", "Outermost"))
|
|
|
|
val conv = Module(new NastiIOTileLinkIOConverter()(outermostTLParams))
|
2015-11-11 01:09:19 +01:00
|
|
|
unwrap.io.in <> ClientTileLinkEnqueuer(bank.outerTL, backendBuffering)(outerTLParams)
|
2015-10-13 21:46:23 +02:00
|
|
|
narrow.io.in <> unwrap.io.out
|
|
|
|
conv.io.tl <> narrow.io.out
|
2016-01-15 00:10:40 +01:00
|
|
|
TopUtils.connectNasti(mem_ic.io.masters(i), conv.io.nasti)
|
2015-08-06 21:51:18 +02:00
|
|
|
}
|
|
|
|
|
2016-01-15 00:10:40 +01:00
|
|
|
val mmio_narrow = Module(new TileLinkIONarrower("L2toMC", "Outermost"))
|
|
|
|
val mmio_conv = Module(new NastiIOTileLinkIOConverter()(outermostTLParams))
|
|
|
|
mmio_narrow.io.in <> mmioManager.io.outer
|
|
|
|
mmio_conv.io.tl <> mmio_narrow.io.out
|
|
|
|
TopUtils.connectNasti(mmio_ic.io.masters(0), mmio_conv.io.nasti)
|
|
|
|
|
2015-08-06 21:51:18 +02:00
|
|
|
val rtc = Module(new RTC(CSRs.mtime))
|
2016-01-15 00:10:40 +01:00
|
|
|
mmio_ic.io.masters(1) <> rtc.io
|
2015-08-06 21:51:18 +02:00
|
|
|
|
2016-01-07 06:38:35 +01:00
|
|
|
dmaOpt.foreach { dma =>
|
2016-01-15 00:10:40 +01:00
|
|
|
mmio_ic.io.masters(2) <> dma.io.mmio
|
|
|
|
dma.io.ctrl <> mmio_ic.io.slaves(addrHashMap("devices:dma").port)
|
2016-01-07 06:38:35 +01:00
|
|
|
}
|
|
|
|
|
2015-08-06 21:51:18 +02:00
|
|
|
for (i <- 0 until nTiles) {
|
|
|
|
val csrName = s"conf:csr$i"
|
2015-10-07 03:24:08 +02:00
|
|
|
val csrPort = addrHashMap(csrName).port
|
2016-01-12 01:19:21 +01:00
|
|
|
val conv = Module(new SmiIONastiIOConverter(xLen, csrAddrBits))
|
2016-01-15 00:10:40 +01:00
|
|
|
conv.io.nasti <> mmio_ic.io.slaves(csrPort)
|
2015-10-06 19:47:38 +02:00
|
|
|
io.csr(i) <> conv.io.smi
|
2015-08-06 21:51:18 +02:00
|
|
|
}
|
|
|
|
|
2016-01-15 00:10:40 +01:00
|
|
|
val scr_conv = Module(new SmiIONastiIOConverter(scrDataBits, scrAddrBits))
|
|
|
|
scr_conv.io.nasti <> mmio_ic.io.slaves(addrHashMap("conf:scr").port)
|
|
|
|
io.scr <> scr_conv.io.smi
|
2016-01-07 06:38:35 +01:00
|
|
|
|
|
|
|
if (p(UseStreamLoopback)) {
|
|
|
|
val lo_width = p(StreamLoopbackWidth)
|
|
|
|
val lo_size = p(StreamLoopbackSize)
|
|
|
|
val lo_conv = Module(new NastiIOStreamIOConverter(lo_width))
|
2016-01-15 00:10:40 +01:00
|
|
|
lo_conv.io.nasti <> mmio_ic.io.slaves(addrHashMap("devices:loopback").port)
|
2016-01-07 06:38:35 +01:00
|
|
|
lo_conv.io.stream.in <> Queue(lo_conv.io.stream.out, lo_size)
|
|
|
|
}
|
2015-08-06 21:51:18 +02:00
|
|
|
|
2016-01-15 00:10:40 +01:00
|
|
|
io.deviceTree <> mmio_ic.io.slaves(addrHashMap("conf:devicetree").port)
|
2015-08-06 21:51:18 +02:00
|
|
|
|
2016-01-15 00:10:40 +01:00
|
|
|
val mem_channels = mem_ic.io.slaves
|
2015-06-26 08:17:35 +02:00
|
|
|
// Create a SerDes for backup memory port
|
2015-10-02 23:23:42 +02:00
|
|
|
if(p(UseBackupMemoryPort)) {
|
2015-08-06 21:51:18 +02:00
|
|
|
VLSIUtils.doOuterMemorySystemSerdes(
|
|
|
|
mem_channels, io.mem, io.mem_backup, io.mem_backup_en,
|
2015-10-06 19:47:38 +02:00
|
|
|
nMemChannels, htifW, p(CacheBlockOffsetBits))
|
2015-06-26 08:17:35 +02:00
|
|
|
} else { io.mem <> mem_channels }
|
2012-10-09 22:05:56 +02:00
|
|
|
}
|