Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove cake-pattern requirement for no-IO devices #2214

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions generators/chipyard/src/main/scala/DigitalTop.scala
Original file line number Diff line number Diff line change
@@ -17,10 +17,8 @@ class DigitalTop(implicit p: Parameters) extends ChipyardSystem
with tacit.CanHaveTraceSinkDMA
with testchipip.tsi.CanHavePeripheryUARTTSI // Enables optional UART-based TSI transport
with testchipip.boot.CanHavePeripheryCustomBootPin // Enables optional custom boot pin
with testchipip.boot.CanHavePeripheryBootAddrReg // Use programmable boot address register
with testchipip.cosim.CanHaveTraceIO // Enables optionally adding trace IO
with testchipip.soc.CanHaveSwitchableOffchipBus // Enables optional off-chip-bus with interface-switch
with testchipip.soc.CanHaveBankedScratchpad // Enables optionally adding a banked scratchpad
with testchipip.iceblk.CanHavePeripheryBlockDevice // Enables optionally adding the block device
with testchipip.serdes.CanHavePeripheryTLSerial // Enables optionally adding the tl-serial interface
with testchipip.serdes.old.CanHavePeripheryTLSerial // Enables optionally adding the DEPRECATED tl-serial interface
@@ -32,16 +30,10 @@ class DigitalTop(implicit p: Parameters) extends ChipyardSystem
with sifive.blocks.devices.gpio.HasPeripheryGPIO // Enables optionally adding the sifive GPIOs
with sifive.blocks.devices.spi.HasPeripherySPIFlash // Enables optionally adding the sifive SPI flash controller
with sifive.blocks.devices.spi.HasPeripherySPI // Enables optionally adding the sifive SPI port
with radiance.memory.CanHaveMemtraceCore // Enables memtrace core
with icenet.CanHavePeripheryIceNIC // Enables optionally adding the IceNIC for FireSim
with chipyard.example.CanHavePeripheryInitZero // Enables optionally adding the initzero example widget
with chipyard.example.CanHavePeripheryGCD // Enables optionally adding the GCD example widget
with chipyard.example.CanHavePeripheryStreamingFIR // Enables optionally adding the DSPTools FIR example widget
with chipyard.example.CanHavePeripheryStreamingPassthrough // Enables optionally adding the DSPTools streaming-passthrough example widget
with nvidia.blocks.dla.CanHavePeripheryNVDLA // Enables optionally having an NVDLA
with chipyard.clocking.HasChipyardPRCI // Use Chipyard reset/clock distribution
with chipyard.clocking.CanHaveClockTap // Enables optionally adding a clock tap output port
with fftgenerator.CanHavePeripheryFFT // Enables optionally having an MMIO-based FFT block
with constellation.soc.CanHaveGlobalNoC // Support instantiating a global NoC interconnect
with rerocc.CanHaveReRoCCTiles // Support tiles that instantiate rerocc-attached accelerators
{
12 changes: 6 additions & 6 deletions generators/chipyard/src/main/scala/example/InitZero.scala
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@ package chipyard.example

import chisel3._
import chisel3.util._
import freechips.rocketchip.subsystem.{BaseSubsystem, CacheBlockBytes, FBUS}
import freechips.rocketchip.subsystem._
import org.chipsalliance.cde.config.{Parameters, Field, Config}
import freechips.rocketchip.diplomacy.{LazyModule, LazyModuleImp, IdRange}
import freechips.rocketchip.tilelink._
@@ -57,19 +57,19 @@ class InitZeroModuleImp(outer: InitZero) extends LazyModuleImp(outer) {
}
}

trait CanHavePeripheryInitZero { this: BaseSubsystem =>
implicit val p: Parameters

case object InitZeroInjector extends SubsystemInjector((p, baseSubsystem) => {
p(InitZeroKey) .map { k =>
val fbus = locateTLBusWrapper(FBUS)
implicit val q: Parameters = p
val fbus = baseSubsystem.locateTLBusWrapper(FBUS)
val initZero = fbus { LazyModule(new InitZero()(p)) }
fbus.coupleFrom("init-zero") { _ := initZero.node }
}
}
})


// DOC include start: WithInitZero
class WithInitZero(base: BigInt, size: BigInt) extends Config((site, here, up) => {
case InitZeroKey => Some(InitZeroConfig(base, size))
case SubsystemInjectorKey => up(SubsystemInjectorKey) + InitZeroInjector
})
// DOC include end: WithInitZero
Original file line number Diff line number Diff line change
@@ -196,10 +196,11 @@ class TLGenericFIRChain[T<:Data:Ring] (genIn: T, genOut: T, coeffs: => Seq[T], p
// DOC include end: TLGenericFIRChain chisel

// DOC include start: CanHavePeripheryStreamingFIR chisel
trait CanHavePeripheryStreamingFIR extends BaseSubsystem {
case object StreamingFIRInjector extends SubsystemInjector((p, baseSubsystem) => {
val streamingFIR = p(GenericFIRKey) match {
case Some(params) => {
val pbus = locateTLBusWrapper(PBUS)
implicit val q: Parameters = p
val pbus = baseSubsystem.locateTLBusWrapper(PBUS)
val domain = pbus.generateSynchronousDomain.suggestName("fir_domain")
val streamingFIR = domain { LazyModule(new TLGenericFIRChain(
genIn = FixedPoint(8.W, 3.BP),
@@ -211,7 +212,7 @@ trait CanHavePeripheryStreamingFIR extends BaseSubsystem {
}
case None => None
}
}
})
// DOC include end: CanHavePeripheryStreamingFIR chisel

/**
@@ -220,5 +221,6 @@ trait CanHavePeripheryStreamingFIR extends BaseSubsystem {
// DOC include start: WithStreamingFIR
class WithStreamingFIR extends Config((site, here, up) => {
case GenericFIRKey => Some(GenericFIRParams(depth = 8))
case SubsystemInjectorKey => up(SubsystemInjectorKey) + StreamingFIRInjector
})
// DOC include end: WithStreamingFIR
Original file line number Diff line number Diff line change
@@ -128,22 +128,24 @@ class TLStreamingPassthroughChain[T<:Data:Ring](params: StreamingPassthroughPara
TLReadQueue(params.depth, AddressSet(params.readAddress, 0xff))(_)
))

trait CanHavePeripheryStreamingPassthrough { this: BaseSubsystem =>
case object StreamingPassthroughInjector extends SubsystemInjector((p, baseSubsystem) => {
val passthrough = p(StreamingPassthroughKey) match {
case Some(params) => {
val pbus = locateTLBusWrapper(PBUS)
implicit val q: Parameters = p
val pbus = baseSubsystem.locateTLBusWrapper(PBUS)
val domain = pbus.generateSynchronousDomain.suggestName("streaming_passthrough_domain")
val streamingPassthroughChain = domain { LazyModule(new TLStreamingPassthroughChain(params, UInt(32.W))) }
pbus.coupleTo("streamingPassthrough") { domain { streamingPassthroughChain.mem.get := TLFIFOFixer() := TLFragmenter(pbus.beatBytes, pbus.blockBytes)} := _ }
Some(streamingPassthroughChain)
}
case None => None
}
}
})

/**
* Mixin to add passthrough to rocket config
*/
class WithStreamingPassthrough extends Config((site, here, up) => {
case StreamingPassthroughKey => Some(StreamingPassthroughParams(depth = 8))
case SubsystemInjectorKey => up(SubsystemInjectorKey) + StreamingPassthroughInjector
})
2 changes: 1 addition & 1 deletion generators/fft-generator
2 changes: 1 addition & 1 deletion generators/nvdla
2 changes: 1 addition & 1 deletion generators/rocket-chip