SPIFlash: make it listable
This commit is contained in:
		@@ -37,23 +37,30 @@ trait HasPeripherySPIModule extends HasTopLevelNetworksModule {
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
case object PeripherySPIFlashKey extends Field[SPIFlashParams]
 | 
					case object PeripherySPIFlashKey extends Field[Seq[SPIFlashParams]]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
trait HasPeripherySPIFlash extends HasTopLevelNetworks {
 | 
					trait HasPeripherySPIFlash extends HasTopLevelNetworks {
 | 
				
			||||||
  val spiFlashParams = p(PeripherySPIFlashKey)  
 | 
					  val spiFlashParams = p(PeripherySPIFlashKey)  
 | 
				
			||||||
  val qspi = LazyModule(new TLSPIFlash(peripheryBusBytes, spiFlashParams))
 | 
					  val qspi = spiFlashParams map { params =>
 | 
				
			||||||
  qspi.rnode := TLFragmenter(peripheryBusBytes, cacheBlockBytes)(peripheryBus.node)
 | 
					    val qspi = LazyModule(new TLSPIFlash(peripheryBusBytes, params))
 | 
				
			||||||
  qspi.fnode := TLFragmenter(1, cacheBlockBytes)(TLWidthWidget(peripheryBusBytes)(peripheryBus.node))
 | 
					    qspi.rnode := TLFragmenter(peripheryBusBytes, cacheBlockBytes)(peripheryBus.node)
 | 
				
			||||||
  intBus.intnode := qspi.intnode
 | 
					    qspi.fnode := TLFragmenter(1, cacheBlockBytes)(TLWidthWidget(peripheryBusBytes)(peripheryBus.node))
 | 
				
			||||||
 | 
					    intBus.intnode := qspi.intnode
 | 
				
			||||||
 | 
					    qspi
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
trait HasPeripherySPIFlashBundle extends HasTopLevelNetworksBundle {
 | 
					trait HasPeripherySPIFlashBundle extends HasTopLevelNetworksBundle {
 | 
				
			||||||
  val outer: HasPeripherySPIFlash 
 | 
					  val outer: HasPeripherySPIFlash 
 | 
				
			||||||
  val qspi = new SPIPortIO(outer.spiFlashParams)
 | 
					  val qspi = HeterogenousBag(outer.spiFlashParams.map(new SPIPortIO(_)))
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
trait HasPeripherySPIFlashModule extends HasTopLevelNetworksModule {
 | 
					trait HasPeripherySPIFlashModule extends HasTopLevelNetworksModule {
 | 
				
			||||||
  val outer: HasPeripherySPIFlash
 | 
					  val outer: HasPeripherySPIFlash
 | 
				
			||||||
  val io: HasPeripherySPIFlashBundle
 | 
					  val io: HasPeripherySPIFlashBundle
 | 
				
			||||||
  io.qspi <> outer.qspi.module.io.port
 | 
					
 | 
				
			||||||
 | 
					  (io.qspi zip outer.qspi) foreach { case (io, device) => 
 | 
				
			||||||
 | 
					    io.qspi <> device.module.io.port
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user