spi: Make memory mapped interface depth a parameter
authorMegan Wachs <megan@sifive.com>
Sun, 20 Aug 2017 19:39:38 +0000 (12:39 -0700)
committerMegan Wachs <megan@sifive.com>
Sun, 20 Aug 2017 19:39:38 +0000 (12:39 -0700)
src/main/scala/devices/spi/SPIPeriphery.scala
src/main/scala/devices/spi/TLSPIFlash.scala

index 6e586473bb0c021819b07804f6944a204145ca19..595ffc3527e18b08ccd884b7d15ec349771fb4e5 100644 (file)
@@ -43,7 +43,7 @@ trait HasPeripherySPIFlash extends HasPeripheryBus with HasInterruptBus {
     qspi.rnode := pbus.toVariableWidthSlaves
     qspi.fnode :=
       TLFragmenter(1, pbus.blockBytes)(
-      TLBuffer(BufferParams(8), BufferParams.none)(
+      TLBuffer(BufferParams(params.fBufferDepth), BufferParams.none)(
       pbus.toFixedWidthSlaves))
     ibus.fromSync := qspi.intnode
     qspi
index bfec1d154f6acf84de3522ba634c85c667cea385..e433fec05e39f94701dd1bba76532faecad2c065 100644 (file)
@@ -11,6 +11,7 @@ import freechips.rocketchip.util.HeterogeneousBag
 trait SPIFlashParamsBase extends SPIParamsBase {
   val fAddress: BigInt
   val fSize: BigInt
+  val fBufferDepth: Int
 
   val insnAddrBytes: Int
   val insnPadLenBits: Int
@@ -22,6 +23,7 @@ trait SPIFlashParamsBase extends SPIParamsBase {
 case class SPIFlashParams(
     rAddress: BigInt,
     fAddress: BigInt,
+    fBufferDepth: Int = 0,
     rSize: BigInt = 0x1000,
     fSize: BigInt = 0x20000000,
     rxDepth: Int = 8,