fix multi-tracker block device
This commit is contained in:
@@ -4,6 +4,18 @@ import config.{Parameters, Config}
|
||||
import example.DefaultExampleConfig
|
||||
import testchipip.{WithBlockDevice, WithNBlockDeviceTrackers}
|
||||
|
||||
class WithSimBlockDevice extends Config((site, here, up) => {
|
||||
case UseSimBlockDevice => true
|
||||
})
|
||||
|
||||
class WithBlockDeviceModel extends Config((site, here, up) => {
|
||||
case UseSimBlockDevice => false
|
||||
})
|
||||
|
||||
class BlockDeviceConfig extends Config(
|
||||
new WithSimBlockDevice ++
|
||||
new WithBlockDevice ++
|
||||
new DefaultExampleConfig)
|
||||
|
||||
class WithTwoTrackers extends WithNBlockDeviceTrackers(2)
|
||||
class WithFourTrackers extends WithNBlockDeviceTrackers(4)
|
||||
|
||||
@@ -2,10 +2,12 @@ package blkdev
|
||||
|
||||
import diplomacy.LazyModule
|
||||
import chisel3._
|
||||
import config.Parameters
|
||||
import config.{Parameters, Field}
|
||||
import testchipip.GeneratorApp
|
||||
import example._
|
||||
|
||||
case object UseSimBlockDevice extends Field[Boolean]
|
||||
|
||||
class TestHarness(implicit p: Parameters) extends Module {
|
||||
val io = IO(new Bundle {
|
||||
val success = Output(Bool())
|
||||
@@ -13,7 +15,10 @@ class TestHarness(implicit p: Parameters) extends Module {
|
||||
|
||||
val dut = Module(LazyModule(new ExampleTopWithBlockDevice).module)
|
||||
dut.connectSimAXIMem()
|
||||
dut.connectSimBlockDevice()
|
||||
if (p(UseSimBlockDevice))
|
||||
dut.connectSimBlockDevice()
|
||||
else
|
||||
dut.connectBlockDeviceModel()
|
||||
io.success := dut.connectSimSerial()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user