Revamp the config system for Top/Harness (#347)
* Refactor how Configs parameterize the Top and TestHarnesses * Bump sha3, testchipip, icenet, firesim
This commit is contained in:
@@ -10,7 +10,7 @@ import freechips.rocketchip.devices.debug.HasPeripheryDebugModuleImp
|
||||
import freechips.rocketchip.subsystem.{CanHaveMasterAXI4MemPortModuleImp}
|
||||
import sifive.blocks.devices.uart.HasPeripheryUARTModuleImp
|
||||
|
||||
import testchipip.{HasPeripherySerialModuleImp, HasPeripheryBlockDeviceModuleImp}
|
||||
import testchipip.{CanHavePeripherySerialModuleImp, CanHavePeripheryBlockDeviceModuleImp}
|
||||
import icenet.HasPeripheryIceNICModuleImpValidOnly
|
||||
|
||||
import junctions.{NastiKey, NastiParameters}
|
||||
@@ -32,19 +32,19 @@ class WithTiedOffDebug extends RegisterBridgeBinder({ case target: HasPeripheryD
|
||||
})
|
||||
|
||||
class WithSerialBridge extends RegisterBridgeBinder({
|
||||
case target: HasPeripherySerialModuleImp => Seq(SerialBridge(target.serial)(target.p))
|
||||
case target: CanHavePeripherySerialModuleImp => Seq(SerialBridge(target.serial.get)(target.p))
|
||||
})
|
||||
|
||||
class WithNICBridge extends RegisterBridgeBinder({
|
||||
case target: HasPeripheryIceNICModuleImpValidOnly => Seq(NICBridge(target.net)(target.p))
|
||||
case target: HasPeripheryIceNICModuleImpValidOnly => Seq(NICBridge(target.net)(target.p))
|
||||
})
|
||||
|
||||
class WithUARTBridge extends RegisterBridgeBinder({
|
||||
case target: HasPeripheryUARTModuleImp => target.uart.map(u => UARTBridge(u)(target.p))
|
||||
case target: HasPeripheryUARTModuleImp => target.uart.map(u => UARTBridge(u)(target.p))
|
||||
})
|
||||
|
||||
class WithBlockDeviceBridge extends RegisterBridgeBinder({
|
||||
case target: HasPeripheryBlockDeviceModuleImp => Seq(BlockDevBridge(target.bdev, target.reset.toBool)(target.p))
|
||||
case target: CanHavePeripheryBlockDeviceModuleImp => Seq(BlockDevBridge(target.bdev.get, target.reset.toBool)(target.p))
|
||||
})
|
||||
|
||||
class WithFASEDBridge extends RegisterBridgeBinder({
|
||||
|
||||
@@ -12,7 +12,7 @@ import freechips.rocketchip.subsystem._
|
||||
import freechips.rocketchip.devices.tilelink.BootROMParams
|
||||
import freechips.rocketchip.devices.debug.{DebugModuleParams, DebugModuleKey}
|
||||
import boom.common.BoomTilesKey
|
||||
import testchipip.{BlockDeviceKey, BlockDeviceConfig}
|
||||
import testchipip.{BlockDeviceKey, BlockDeviceConfig, SerialKey}
|
||||
import sifive.blocks.devices.uart.{PeripheryUARTKey, UARTParams}
|
||||
import scala.math.{min, max}
|
||||
import tracegen.TraceGenKey
|
||||
@@ -47,13 +47,17 @@ class WithUARTKey extends Config((site, here, up) => {
|
||||
nRxEntries = 256))
|
||||
})
|
||||
|
||||
class WithSerial extends Config((site, here, up) => {
|
||||
case SerialKey => true
|
||||
})
|
||||
|
||||
class WithBlockDevice extends Config(new testchipip.WithBlockDevice)
|
||||
|
||||
class WithNICKey extends Config((site, here, up) => {
|
||||
case NICKey => NICConfig(
|
||||
case NICKey => Some(NICConfig(
|
||||
inBufFlits = 8192,
|
||||
ctrlQueueDepth = 64,
|
||||
checksumOffload = true)
|
||||
checksumOffload = true))
|
||||
})
|
||||
|
||||
class WithRocketL2TLBs(entries: Int) extends Config((site, here, up) => {
|
||||
@@ -112,6 +116,7 @@ class FireSimRocketChipConfig extends Config(
|
||||
new WithoutTLMonitors ++
|
||||
new WithUARTKey ++
|
||||
new WithNICKey ++
|
||||
new WithSerial ++
|
||||
new WithBlockDevice ++
|
||||
new WithRocketL2TLBs(1024) ++
|
||||
new WithPerfCounters ++
|
||||
@@ -169,6 +174,7 @@ class FireSimBoomConfig extends Config(
|
||||
new WithoutTLMonitors ++
|
||||
new WithUARTKey ++
|
||||
new WithNICKey ++
|
||||
new WithSerial ++
|
||||
new WithBlockDevice ++
|
||||
new WithBoomL2TLBs(1024) ++
|
||||
new WithoutClockGating ++
|
||||
|
||||
@@ -42,10 +42,10 @@ class FireSimDUT(implicit p: Parameters) extends Subsystem
|
||||
with HasHierarchicalBusTopology
|
||||
with CanHaveMasterAXI4MemPort
|
||||
with HasPeripheryBootROM
|
||||
with HasPeripherySerial
|
||||
with CanHavePeripherySerial
|
||||
with HasPeripheryUART
|
||||
with HasPeripheryIceNIC
|
||||
with HasPeripheryBlockDevice
|
||||
with CanHavePeripheryIceNIC
|
||||
with CanHavePeripheryBlockDevice
|
||||
with HasTraceIO
|
||||
{
|
||||
override lazy val module = new FireSimModuleImp(this)
|
||||
@@ -55,10 +55,10 @@ class FireSimModuleImp[+L <: FireSimDUT](l: L) extends SubsystemModuleImp(l)
|
||||
with HasRTCModuleImp
|
||||
with CanHaveMasterAXI4MemPortModuleImp
|
||||
with HasPeripheryBootROMModuleImp
|
||||
with HasPeripherySerialModuleImp
|
||||
with CanHavePeripherySerialModuleImp
|
||||
with HasPeripheryUARTModuleImp
|
||||
with HasPeripheryIceNICModuleImpValidOnly
|
||||
with HasPeripheryBlockDeviceModuleImp
|
||||
with CanHavePeripheryBlockDeviceModuleImp
|
||||
with HasTraceIOImp
|
||||
with CanHaveMultiCycleRegfileImp
|
||||
|
||||
@@ -68,9 +68,9 @@ class FireSimNoNICDUT(implicit p: Parameters) extends Subsystem
|
||||
with HasHierarchicalBusTopology
|
||||
with CanHaveMasterAXI4MemPort
|
||||
with HasPeripheryBootROM
|
||||
with HasPeripherySerial
|
||||
with CanHavePeripherySerial
|
||||
with HasPeripheryUART
|
||||
with HasPeripheryBlockDevice
|
||||
with CanHavePeripheryBlockDevice
|
||||
with HasTraceIO
|
||||
{
|
||||
override lazy val module = new FireSimNoNICModuleImp(this)
|
||||
@@ -80,9 +80,9 @@ class FireSimNoNICModuleImp[+L <: FireSimNoNICDUT](l: L) extends SubsystemModule
|
||||
with HasRTCModuleImp
|
||||
with CanHaveMasterAXI4MemPortModuleImp
|
||||
with HasPeripheryBootROMModuleImp
|
||||
with HasPeripherySerialModuleImp
|
||||
with CanHavePeripherySerialModuleImp
|
||||
with HasPeripheryUARTModuleImp
|
||||
with HasPeripheryBlockDeviceModuleImp
|
||||
with CanHavePeripheryBlockDeviceModuleImp
|
||||
with HasTraceIOImp
|
||||
with CanHaveMultiCycleRegfileImp
|
||||
|
||||
@@ -107,12 +107,11 @@ class FireSimSupernode(implicit p: Parameters) extends DefaultFireSimHarness(()
|
||||
|
||||
// Verilog blackbox integration demo
|
||||
class FireSimVerilogGCDDUT(implicit p: Parameters) extends FireSimDUT
|
||||
with example.HasPeripheryGCD
|
||||
with example.CanHavePeripheryGCD
|
||||
{
|
||||
override lazy val module = new FireSimVerilogGCDModuleImp(this)
|
||||
}
|
||||
|
||||
class FireSimVerilogGCDModuleImp[+L <: FireSimVerilogGCDDUT](l: L) extends FireSimModuleImp(l)
|
||||
with example.HasPeripheryGCDModuleImp
|
||||
|
||||
class FireSimVerilogGCD(implicit p: Parameters) extends DefaultFireSimHarness(() => new FireSimVerilogGCDDUT)
|
||||
|
||||
Reference in New Issue
Block a user