1
0

Merge pull request #917 from freechipsproject/fuzzer_order

TLFuzzer: Allow Ordered clients to be created as well by the fuzzer
This commit is contained in:
Megan Wachs 2017-08-02 18:39:59 -07:00 committed by GitHub
commit 3fc7100048

View File

@ -84,11 +84,27 @@ class TLFuzzer(
LFSRNoiseMaker(wide=wide, increment=increment) LFSRNoiseMaker(wide=wide, increment=increment)
}, },
noModify: Boolean = false, noModify: Boolean = false,
overrideAddress: Option[AddressSet] = None)(implicit p: Parameters) extends LazyModule overrideAddress: Option[AddressSet] = None,
nOrdered: Option[Int] = None)(implicit p: Parameters) extends LazyModule
{ {
val node = TLClientNode(TLClientParameters(
val clientParams = if (nOrdered.isDefined) {
val n = nOrdered.get
require(n > 0, s"nOrdered must be > 0, not $n")
require((inFlight % n) == 0, s"inFlight (${inFlight}) must be evenly divisible by nOrdered (${nOrdered}).")
Seq.tabulate(n) {i =>
TLClientParameters(name =s"OrderedFuzzer$i",
sourceId = IdRange(i * (inFlight/n), (i + 1)*(inFlight/n)),
requestFifo = true)
}
} else {
Seq(TLClientParameters(
name = "Fuzzer", name = "Fuzzer",
sourceId = IdRange(0,inFlight))) sourceId = IdRange(0,inFlight)
))
}
val node = TLClientNode(Seq(TLClientPortParameters(clientParams)))
lazy val module = new LazyModuleImp(this) { lazy val module = new LazyModuleImp(this) {
val io = new Bundle { val io = new Bundle {