From 84145959e15f08c8d2153fdad57859405b0909eb Mon Sep 17 00:00:00 2001 From: "Wesley W. Terpstra" Date: Tue, 31 Oct 2017 17:34:46 -0700 Subject: [PATCH] tilelink: fix error fragmentation from multibeat to multibeat (#1082) Unfortunately, dLast is not actually correct for AccessAckData. dFragnum is 0 for all the subbeats in the multibeat=>multibeat case. --- src/main/scala/tilelink/Fragmenter.scala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/scala/tilelink/Fragmenter.scala b/src/main/scala/tilelink/Fragmenter.scala index d79af257..c9555c2a 100644 --- a/src/main/scala/tilelink/Fragmenter.scala +++ b/src/main/scala/tilelink/Fragmenter.scala @@ -156,7 +156,7 @@ class TLFragmenter(val minSize: Int, val maxSize: Int, val alwaysMin: Boolean = val dToggle = RegInit(Bool(false)) val dFragnum = out.d.bits.source(fragmentBits-1, 0) val dFirst = acknum === UInt(0) - val dLast = dFragnum === UInt(0) + val dLast = dFragnum === UInt(0) // only for AccessAck (!Data) val dsizeOH = UIntToOH (out.d.bits.size, log2Ceil(maxDownSize)+1) val dsizeOH1 = UIntToOH1(out.d.bits.size, log2Up(maxDownSize)) val dHasData = edgeOut.hasData(out.d.bits) @@ -188,9 +188,9 @@ class TLFragmenter(val minSize: Int, val maxSize: Int, val alwaysMin: Boolean = // The specification requires that error transition LOW=>HIGH only once per burst. // Since we fragmented a big burst into mulitple little bursts, we need to OR them. - val r_error = RegInit(Bool(false)) - val d_error = r_error || out.d.bits.error - when (out.d.fire()) { r_error := !dLast && d_error } + val r_error = Reg(Bool()) + val d_error = (!dFirst && r_error) || out.d.bits.error + when (out.d.fire()) { r_error := d_error } in.d.bits.error := d_error if (earlyAck) {