From c5a854dcb77e8e0159f79db74340742ab00431b7 Mon Sep 17 00:00:00 2001 From: Casper Cromjongh Date: Wed, 20 Mar 2024 12:47:48 +0100 Subject: [PATCH 1/2] Add support for 0-bit logic types. This can happen when the direct child structure e.g. only consists of sub-streams. --- src/main/scala/nl/tudelft/tydi_chisel/TydiLib.scala | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/scala/nl/tudelft/tydi_chisel/TydiLib.scala b/src/main/scala/nl/tudelft/tydi_chisel/TydiLib.scala index 85c91f5..71f4385 100644 --- a/src/main/scala/nl/tudelft/tydi_chisel/TydiLib.scala +++ b/src/main/scala/nl/tudelft/tydi_chisel/TydiLib.scala @@ -380,8 +380,16 @@ class PhysicalStream(private val e: TydiEl, n: Int = 1, d: Int = 0, c: Int, priv this.last := bundle.last.asUInt this.valid := bundle.valid bundle.ready := this.ready - this.data := bundle.getDataConcat - this.user := bundle.getUserConcat + if (elWidth > 0) { + this.data := bundle.getDataConcat + } else { + this.data := DontCare + } + if (userElWidth > 0) { + this.user := bundle.getUserConcat + } else { + this.user := DontCare + } } def :=(bundle: PhysicalStream): Unit = { From b0733289a489f9be4844ac9eec1f10fc78696cd2 Mon Sep 17 00:00:00 2001 From: Casper Cromjongh Date: Wed, 20 Mar 2024 12:48:02 +0100 Subject: [PATCH 2/2] Fix TimestampedMessage while we're at it. --- .../timestamped_message/TimestampedMessage.scala | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/scala/nl/tudelft/tydi_chisel/examples/timestamped_message/TimestampedMessage.scala b/src/main/scala/nl/tudelft/tydi_chisel/examples/timestamped_message/TimestampedMessage.scala index 01b6e1d..a52b039 100644 --- a/src/main/scala/nl/tudelft/tydi_chisel/examples/timestamped_message/TimestampedMessage.scala +++ b/src/main/scala/nl/tudelft/tydi_chisel/examples/timestamped_message/TimestampedMessage.scala @@ -54,18 +54,18 @@ class TimestampedMessageModuleOut extends TydiModule { // We have 1 lane in this case // Top stream - stream.valid := true.B - stream.strb := 1.U - stream.stai := 0.U - stream.endi := 1.U - stream.last := 0.U + stream.valid := true.B + stream.strb := 1.U + stream.stai := 0.U + stream.endi := 1.U + stream.last(0) := 0.U // Child stream stream.el.message.valid := true.B stream.el.message.strb := 1.U stream.el.message.stai := 0.U stream.el.message.endi := 1.U - stream.el.message.last := 0.U + stream.el.message.last.foreach(_ := 0.U) } class TimestampedMessageModuleIn extends TydiModule {