spi: put a request buffer infront of SPI
This will prevent SPI from blocking other pbus requests.
This commit is contained in:
		@@ -4,8 +4,8 @@ package sifive.blocks.devices.spi
 | 
				
			|||||||
import Chisel._
 | 
					import Chisel._
 | 
				
			||||||
import freechips.rocketchip.config.Field
 | 
					import freechips.rocketchip.config.Field
 | 
				
			||||||
import freechips.rocketchip.coreplex.{HasPeripheryBus, HasInterruptBus}
 | 
					import freechips.rocketchip.coreplex.{HasPeripheryBus, HasInterruptBus}
 | 
				
			||||||
import freechips.rocketchip.diplomacy.{LazyModule,LazyMultiIOModuleImp}
 | 
					import freechips.rocketchip.diplomacy.{LazyModule,LazyMultiIOModuleImp,BufferParams}
 | 
				
			||||||
import freechips.rocketchip.tilelink.{TLFragmenter}
 | 
					import freechips.rocketchip.tilelink.{TLFragmenter,TLBuffer}
 | 
				
			||||||
import freechips.rocketchip.util.HeterogeneousBag
 | 
					import freechips.rocketchip.util.HeterogeneousBag
 | 
				
			||||||
 | 
					
 | 
				
			||||||
case object PeripherySPIKey extends Field[Seq[SPIParams]]
 | 
					case object PeripherySPIKey extends Field[Seq[SPIParams]]
 | 
				
			||||||
@@ -41,7 +41,10 @@ trait HasPeripherySPIFlash extends HasPeripheryBus with HasInterruptBus {
 | 
				
			|||||||
  val qspis = spiFlashParams map { params =>
 | 
					  val qspis = spiFlashParams map { params =>
 | 
				
			||||||
    val qspi = LazyModule(new TLSPIFlash(pbus.beatBytes, params))
 | 
					    val qspi = LazyModule(new TLSPIFlash(pbus.beatBytes, params))
 | 
				
			||||||
    qspi.rnode := pbus.toVariableWidthSlaves
 | 
					    qspi.rnode := pbus.toVariableWidthSlaves
 | 
				
			||||||
    qspi.fnode := TLFragmenter(1, pbus.blockBytes)(pbus.toFixedWidthSlaves)
 | 
					    qspi.fnode :=
 | 
				
			||||||
 | 
					      TLFragmenter(1, pbus.blockBytes)(
 | 
				
			||||||
 | 
					      TLBuffer(BufferParams(8), BufferParams.none)(
 | 
				
			||||||
 | 
					      pbus.toFixedWidthSlaves))
 | 
				
			||||||
    ibus.fromSync := qspi.intnode
 | 
					    ibus.fromSync := qspi.intnode
 | 
				
			||||||
    qspi
 | 
					    qspi
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user