1
0

IntNodes: moved from tilelink to their own package

This commit is contained in:
Wesley W. Terpstra
2017-10-19 20:44:54 -07:00
parent 6bc9c9fc6c
commit c6f95570df
23 changed files with 208 additions and 130 deletions

View File

@ -0,0 +1,23 @@
// See LICENSE.SiFive for license details.
package freechips.rocketchip.interrupts
import Chisel._
import freechips.rocketchip.config.Parameters
import freechips.rocketchip.diplomacy._
class IntXbar()(implicit p: Parameters) extends LazyModule
{
val intnode = IntNexusNode(
sinkFn = { _ => IntSinkPortParameters(Seq(IntSinkParameters())) },
sourceFn = { seq =>
IntSourcePortParameters((seq zip seq.map(_.num).scanLeft(0)(_+_).init).map {
case (s, o) => s.sources.map(z => z.copy(range = z.range.offset(o)))
}.flatten)
})
lazy val module = new LazyModuleImp(this) {
val cat = intnode.in.map { case (i, e) => i.take(e.source.num) }.flatten
intnode.out.foreach { case (o, _) => o := cat }
}
}