Skip to content

Commit

Permalink
Merge pull request #2071 from chipsalliance/dev-null-transfers
Browse files Browse the repository at this point in the history
devices: allow error devs that only support tl-ul
  • Loading branch information
hcook authored Aug 12, 2019
2 parents 64b9299 + 3481b82 commit b0ed2be
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/main/scala/devices/tilelink/DevNull.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ case class DevNullParams(
executable: Boolean = true,
mayDenyGet: Boolean = true,
mayDenyPut: Boolean = true,
hint: Boolean = true
) {
require (1 <= maxAtomic, s"Atomic transfer size must be > 1 (was $maxAtomic)")
require (maxAtomic <= maxTransfer, s"Atomic transfer size must be <= max transfer (but $maxAtomic > $maxTransfer)")
require (maxTransfer <= 4096, s"Max transfer size must be <= 4096 (was $maxTransfer)")
def acquire: Boolean = region == RegionType.TRACKED
Expand All @@ -28,22 +28,24 @@ case class DevNullParams(
abstract class DevNullDevice(params: DevNullParams, beatBytes: Int, device: SimpleDevice)
(implicit p: Parameters)
extends LazyModule with HasClockDomainCrossing {
val xfer = TransferSizes(1, params.maxTransfer)
val atom = TransferSizes(1, params.maxAtomic)
val xfer = if (params.maxTransfer > 0) TransferSizes(1, params.maxTransfer) else TransferSizes.none
val atom = if (params.maxAtomic > 0) TransferSizes(1, params.maxAtomic) else TransferSizes.none
val acq = if (params.acquire) xfer else TransferSizes.none
val hint = if (params.hint) xfer else TransferSizes.none
val node = TLManagerNode(Seq(TLManagerPortParameters(
Seq(TLManagerParameters(
address = params.address,
resources = device.reg,
regionType = params.region,
executable = params.executable,
supportsAcquireT = if (params.acquire) xfer else TransferSizes.none,
supportsAcquireB = if (params.acquire) xfer else TransferSizes.none,
supportsAcquireT = acq,
supportsAcquireB = acq,
supportsGet = xfer,
supportsPutPartial = xfer,
supportsPutFull = xfer,
supportsArithmetic = atom,
supportsLogical = atom,
supportsHint = xfer,
supportsHint = hint,
fifoId = Some(0), // requests are handled in order
mayDenyGet = params.mayDenyGet,
mayDenyPut = params.mayDenyPut,
Expand Down

0 comments on commit b0ed2be

Please sign in to comment.