forked from SpinalHDL/SpinalHDL
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
69 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package spinal.lib.bus.bmb | ||
|
||
import spinal.core._ | ||
import spinal.lib._ | ||
|
||
case class BmbCcFifo(p: BmbParameter, | ||
cmdDepth : Int, | ||
rspDepth : Int, | ||
inputCd: ClockDomain, | ||
outputCd: ClockDomain) extends Component{ | ||
val io = new Bundle { | ||
val input = slave(Bmb(p)) | ||
val output = master(Bmb(p)) | ||
} | ||
|
||
io.output.cmd << io.input.cmd.queue(cmdDepth, inputCd, outputCd) | ||
io.input.rsp << io.output.rsp.queue(rspDepth, outputCd, inputCd) | ||
} |
33 changes: 33 additions & 0 deletions
33
lib/src/main/scala/spinal/lib/com/spi/xdr/BmbSpiXdrMasterCtrl.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package spinal.lib.com.spi.ddr | ||
|
||
import spinal.core._ | ||
import spinal.lib.bus.bmb.{Bmb, BmbAccessParameter, BmbParameter, BmbSlaveFactory} | ||
import spinal.lib.com.spi.ddr.SpiXdrMasterCtrl.{Cmd, Config, Rsp} | ||
import spinal.lib.{Flow, Stream, master, slave} | ||
|
||
|
||
|
||
object BmbSpiXdrMasterCtrl{ | ||
def getBmbCapabilities(accessSource : BmbAccessParameter) = BmbSlaveFactory.getBmbCapabilities( | ||
accessSource, | ||
addressWidth = addressWidth, | ||
dataWidth = 32 | ||
) | ||
def addressWidth = 12 | ||
} | ||
|
||
|
||
case class BmbSpiXdrMasterCtrl(p : SpiXdrMasterCtrl.MemoryMappingParameters, ctrlParameter : BmbParameter) extends Component{ | ||
val io = new Bundle { | ||
val ctrl = slave(Bmb(ctrlParameter)) | ||
val xip = ifGen(p.xip != null) (slave(SpiXdrMasterCtrl.XipBus(p.xip))) | ||
val spi = master(SpiXdrMaster(p.ctrl.spi)) | ||
val interrupt = out Bool() | ||
} | ||
|
||
val ctrl = SpiXdrMasterCtrl(p.ctrl) | ||
val mapping = SpiXdrMasterCtrl.driveFrom(ctrl, BmbSlaveFactory(io.ctrl))(p) | ||
if(p.xip != null) io.xip <> mapping.xip.xipBus | ||
io.spi <> ctrl.io.spi | ||
io.interrupt <> mapping.interruptCtrl.interrupt | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters