1
0

fix cloneType in nasti.scala (#14)

This commit is contained in:
Donggyu 2016-05-24 17:10:17 -07:00 committed by Andrew Waterman
parent 5bc78aba99
commit a9599302bd

View File

@ -262,12 +262,16 @@ class MemIONastiIOConverter(cacheBlockOffsetBits: Int)(implicit p: Parameters) e
io.mem.resp.ready := io.nasti.r.ready io.mem.resp.ready := io.nasti.r.ready
} }
class NastiArbiterIO(arbN: Int)(implicit p: Parameters) extends Bundle {
val master = Vec(arbN, new NastiIO).flip
val slave = new NastiIO
override def cloneType =
new NastiArbiterIO(arbN).asInstanceOf[this.type]
}
/** Arbitrate among arbN masters requesting to a single slave */ /** Arbitrate among arbN masters requesting to a single slave */
class NastiArbiter(val arbN: Int)(implicit p: Parameters) extends NastiModule { class NastiArbiter(val arbN: Int)(implicit p: Parameters) extends NastiModule {
val io = new Bundle { val io = new NastiArbiterIO(arbN)
val master = Vec(arbN, new NastiIO).flip
val slave = new NastiIO
}
if (arbN > 1) { if (arbN > 1) {
val arbIdBits = log2Up(arbN) val arbIdBits = log2Up(arbN)
@ -381,6 +385,13 @@ class NastiErrorSlave(implicit p: Parameters) extends NastiModule {
b_queue.io.deq.ready := io.b.ready && !draining b_queue.io.deq.ready := io.b.ready && !draining
} }
class NastiRouterIO(nSlaves: Int)(implicit p: Parameters) extends Bundle {
val master = (new NastiIO).flip
val slave = Vec(nSlaves, new NastiIO)
override def cloneType =
new NastiRouterIO(nSlaves).asInstanceOf[this.type]
}
/** Take a single Nasti master and route its requests to various slaves /** Take a single Nasti master and route its requests to various slaves
* @param nSlaves the number of slaves * @param nSlaves the number of slaves
* @param routeSel a function which takes an address and produces * @param routeSel a function which takes an address and produces
@ -388,10 +399,7 @@ class NastiErrorSlave(implicit p: Parameters) extends NastiModule {
class NastiRouter(nSlaves: Int, routeSel: UInt => UInt)(implicit p: Parameters) class NastiRouter(nSlaves: Int, routeSel: UInt => UInt)(implicit p: Parameters)
extends NastiModule { extends NastiModule {
val io = new Bundle { val io = new NastiRouterIO(nSlaves)
val master = (new NastiIO).flip
val slave = Vec(nSlaves, new NastiIO)
}
val ar_route = routeSel(io.master.ar.bits.addr) val ar_route = routeSel(io.master.ar.bits.addr)
val aw_route = routeSel(io.master.aw.bits.addr) val aw_route = routeSel(io.master.aw.bits.addr)