-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Copy pathGroundTestSubsystem.scala
39 lines (30 loc) · 1.46 KB
/
GroundTestSubsystem.scala
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// See LICENSE.SiFive for license details.
package freechips.rocketchip.groundtest
import chisel3._
import org.chipsalliance.cde.config.{Parameters}
import freechips.rocketchip.diplomacy.{AddressSet, LazyModule}
import freechips.rocketchip.interrupts.{IntSinkNode, IntSinkPortSimple}
import freechips.rocketchip.subsystem.{BaseSubsystem, BaseSubsystemModuleImp, HasTiles, CanHaveMasterAXI4MemPort}
import freechips.rocketchip.tilelink.{TLRAM, TLFragmenter}
import freechips.rocketchip.interrupts.{NullIntSyncSource}
class GroundTestSubsystem(implicit p: Parameters)
extends BaseSubsystem
with HasTiles
with CanHaveMasterAXI4MemPort
{
val testram = LazyModule(new TLRAM(AddressSet(0x52000000, 0xfff), beatBytes=pbus.beatBytes))
pbus.coupleTo("TestRAM") { testram.node := TLFragmenter(pbus) := _ }
// No cores to monitor
def coreMonitorBundles = Nil
// No PLIC in ground test; so just sink the interrupts to nowhere
IntSinkNode(IntSinkPortSimple()) :=* ibus.toPLIC
val tileStatusNodes = tiles.collect { case t: GroundTestTile => t.statusNode.makeSink() }
// no debug module
val debugNode = NullIntSyncSource()
override lazy val module = new GroundTestSubsystemModuleImp(this)
}
class GroundTestSubsystemModuleImp[+L <: GroundTestSubsystem](_outer: L) extends BaseSubsystemModuleImp(_outer) {
val success = IO(Output(Bool()))
val status = dontTouch(DebugCombiner(outer.tileStatusNodes.map(_.bundle)))
success := outer.tileCeaseSinkNode.in.head._1.asUInt.andR
}