Skip to content

Commit

Permalink
Add GCD IOBinders examples
Browse files Browse the repository at this point in the history
  • Loading branch information
jerryz123 committed May 23, 2024
1 parent 3a6677b commit 3c31fae
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class AbstractConfig extends Config(
new chipyard.iobinders.WithNICIOPunchthrough ++
new chipyard.iobinders.WithTraceIOPunchthrough ++
new chipyard.iobinders.WithUARTTSIPunchthrough ++
new chipyard.iobinders.WithGCDBusyPunchthrough ++
new chipyard.iobinders.WithNMITiedOff ++


Expand Down
9 changes: 9 additions & 0 deletions generators/chipyard/src/main/scala/iobinders/IOBinders.scala
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import testchipip.cosim.{CanHaveTraceIO, TraceOutputTop, SpikeCosimConfig}
import testchipip.tsi.{CanHavePeripheryUARTTSI, UARTTSIIO}
import icenet.{CanHavePeripheryIceNIC, SimNetwork, NicLoopback, NICKey, NICIOvonly}
import chipyard.{CanHaveMasterTLMemPort, ChipyardSystem, ChipyardSystemModule}
import chipyard.example.{CanHavePeripheryGCD}

import scala.reflect.{ClassTag}

Expand Down Expand Up @@ -540,3 +541,11 @@ class WithNMITiedOff extends ComposeIOBinder({
(Nil, Nil)
}
})

class WithGCDBusyPunchthrough extends OverrideIOBinder({
(system: CanHavePeripheryGCD) => system.gcd_busy.map { busy =>
val io_gcd_busy = IO(Output(Bool()))
io_gcd_busy := busy
(Seq(GCDBusyPort(() => io_gcd_busy)), Nil)
}.getOrElse((Nil, Nil))
})
2 changes: 2 additions & 0 deletions generators/chipyard/src/main/scala/iobinders/Ports.scala
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,5 @@ case class JTAGResetPort (val getIO: () => Reset)
case class TLMemPort (val getIO: () => HeterogeneousBag[TLBundle])
extends Port[HeterogeneousBag[TLBundle]]

case class GCDBusyPort (val getIO: () => Bool)
extends Port[Bool]

0 comments on commit 3c31fae

Please sign in to comment.