1
0

clint: don't ask for what you know (nTiles)

This commit is contained in:
Wesley W. Terpstra 2017-06-20 17:21:53 -07:00
parent 1c97a2a94c
commit 2f2fe0a973
2 changed files with 3 additions and 2 deletions

View File

@ -25,7 +25,7 @@ trait CoreplexRISCVPlatform extends CoreplexNetwork {
plic.node := TLFragmenter(pbusBeatBytes, pbusBlockBytes)(pbus.node)
plic.intnode := int_xbar.intnode
val clint = LazyModule(new CoreplexLocalInterrupter(nTiles, p(ClintKey)))
val clint = LazyModule(new CoreplexLocalInterrupter(p(ClintKey)))
clint.node := TLFragmenter(pbusBeatBytes, pbusBlockBytes)(pbus.node)
lazy val dts = DTS(bindingTree)

View File

@ -32,7 +32,7 @@ case class ClintParams(baseAddress: BigInt = 0x02000000)
def address = AddressSet(baseAddress, ClintConsts.size-1)
}
class CoreplexLocalInterrupter(nTiles: Int, params: ClintParams)(implicit p: Parameters) extends LazyModule
class CoreplexLocalInterrupter(params: ClintParams)(implicit p: Parameters) extends LazyModule
{
import ClintConsts._
@ -66,6 +66,7 @@ class CoreplexLocalInterrupter(nTiles: Int, params: ClintParams)(implicit p: Par
reg := newTime >> i
}
val nTiles = intnode.edgesOut.size
val timecmp = Seq.fill(nTiles) { Seq.fill(timeWidth/regWidth)(Reg(UInt(width = regWidth))) }
val ipi = Seq.fill(nTiles) { RegInit(UInt(0, width = 1)) }