Fix Fragmenter to ensure logical operations must be sent out atomically.
Edited Fuzzer so that it can generate infinite operations when nOperations is net to 0
This commit is contained in:
parent
9ac78a0d37
commit
54cc071a64
@ -31,7 +31,7 @@ class TLFragmenter(val minSize: Int, val maxSize: Int, val alwaysMin: Boolean =
|
|||||||
TransferSizes.none
|
TransferSizes.none
|
||||||
def mapManager(m: TLManagerParameters) = m.copy(
|
def mapManager(m: TLManagerParameters) = m.copy(
|
||||||
supportsArithmetic = shrinkTransfer(m.supportsArithmetic),
|
supportsArithmetic = shrinkTransfer(m.supportsArithmetic),
|
||||||
supportsLogical = expandTransfer(m.supportsLogical),
|
supportsLogical = shrinkTransfer(m.supportsLogical),
|
||||||
supportsGet = expandTransfer(m.supportsGet),
|
supportsGet = expandTransfer(m.supportsGet),
|
||||||
supportsPutFull = expandTransfer(m.supportsPutFull),
|
supportsPutFull = expandTransfer(m.supportsPutFull),
|
||||||
supportsPutPartial = expandTransfer(m.supportsPutPartial),
|
supportsPutPartial = expandTransfer(m.supportsPutPartial),
|
||||||
|
@ -108,9 +108,13 @@ class TLFuzzer(
|
|||||||
val dataBits = edge.bundle.dataBits
|
val dataBits = edge.bundle.dataBits
|
||||||
|
|
||||||
// Progress through operations
|
// Progress through operations
|
||||||
val num_reqs = Reg(init = UInt(nOperations-1, log2Up(nOperations)))
|
val num_reqs = Reg(init = UInt(nOperations, log2Up(nOperations)))
|
||||||
val num_resps = Reg(init = UInt(nOperations-1, log2Up(nOperations)))
|
val num_resps = Reg(init = UInt(nOperations, log2Up(nOperations)))
|
||||||
|
if (nOperations>0) {
|
||||||
io.finished := num_resps === UInt(0)
|
io.finished := num_resps === UInt(0)
|
||||||
|
} else {
|
||||||
|
io.finished := Bool(false)
|
||||||
|
}
|
||||||
|
|
||||||
// Progress within each operation
|
// Progress within each operation
|
||||||
val a = out.a.bits
|
val a = out.a.bits
|
||||||
@ -179,7 +183,11 @@ class TLFuzzer(
|
|||||||
UInt("b101") -> hbits))
|
UInt("b101") -> hbits))
|
||||||
|
|
||||||
// Wire both the used and un-used channel signals
|
// Wire both the used and un-used channel signals
|
||||||
|
if (nOperations>0) {
|
||||||
out.a.valid := legal && alloc.valid && num_reqs =/= UInt(0)
|
out.a.valid := legal && alloc.valid && num_reqs =/= UInt(0)
|
||||||
|
} else {
|
||||||
|
out.a.valid := legal && alloc.valid
|
||||||
|
}
|
||||||
out.a.bits := bits
|
out.a.bits := bits
|
||||||
out.b.ready := Bool(true)
|
out.b.ready := Bool(true)
|
||||||
out.c.valid := Bool(false)
|
out.c.valid := Bool(false)
|
||||||
@ -190,6 +198,7 @@ class TLFuzzer(
|
|||||||
inc := !legal || req_done
|
inc := !legal || req_done
|
||||||
inc_beat := !legal || out.a.fire()
|
inc_beat := !legal || out.a.fire()
|
||||||
|
|
||||||
|
if (nOperations>0) {
|
||||||
when (out.a.fire() && a_last) {
|
when (out.a.fire() && a_last) {
|
||||||
num_reqs := num_reqs - UInt(1)
|
num_reqs := num_reqs - UInt(1)
|
||||||
}
|
}
|
||||||
@ -198,6 +207,7 @@ class TLFuzzer(
|
|||||||
num_resps := num_resps - UInt(1)
|
num_resps := num_resps - UInt(1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Synthesizeable integration test */
|
/** Synthesizeable integration test */
|
||||||
|
Loading…
Reference in New Issue
Block a user