Skip to content

Commit

Permalink
Merge commit '50adbdb' into ifv
Browse files Browse the repository at this point in the history
  • Loading branch information
jerryz123 committed Dec 27, 2023
2 parents 9dc08fe + 50adbdb commit 80dffc8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/main/scala/devices/tilelink/Plic.scala
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,14 @@ class TLPLIC(params: PLICParams, beatBytes: Int)(implicit p: Parameters) extends

val maxDevs = Reg(Vec(nHarts, UInt(log2Ceil(nDevices+1).W)))
val pendingUInt = Cat(pending.reverse)
for (hart <- 0 until nHarts) {
val fanin = Module(new PLICFanIn(nDevices, prioBits))
fanin.io.prio := priority
fanin.io.ip := enableVec(hart) & pendingUInt
maxDevs(hart) := fanin.io.dev
harts(hart) := ShiftRegister(RegNext(fanin.io.max) > threshold(hart), params.intStages)
if(nDevices > 0) {
for (hart <- 0 until nHarts) {
val fanin = Module(new PLICFanIn(nDevices, prioBits))
fanin.io.prio := priority
fanin.io.ip := enableVec(hart) & pendingUInt
maxDevs(hart) := fanin.io.dev
harts(hart) := ShiftRegister(RegNext(fanin.io.max) > threshold(hart), params.intStages)
}
}

// Priority registers are 32-bit aligned so treat each as its own group.
Expand Down
11 changes: 11 additions & 0 deletions src/main/scala/subsystem/Configs.scala
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,17 @@ class WithNoSlavePort extends Config((site, here, up) => {
case ExtIn => None
})

class WithScratchpadsBaseAddress(address: BigInt) extends Config((site, here, up) => {
case TilesLocated(InSubsystem) => up(TilesLocated(InSubsystem), site) map {
case tp: RocketTileAttachParams => tp.copy(tileParams = tp.tileParams.copy(
dcache = tp.tileParams.dcache.map(
_.copy(scratch = Some(address))
)
))
case t => t
}
})

class WithScratchpadsOnly extends Config((site, here, up) => {
case TilesLocated(InSubsystem) => up(TilesLocated(InSubsystem), site) map {
case tp: RocketTileAttachParams => tp.copy(tileParams = tp.tileParams.copy(
Expand Down

0 comments on commit 80dffc8

Please sign in to comment.