Resolve implicit-width-truncation warnings - #278
Open
tynan-jdwk wants to merge 1 commit into
Open
Conversation
firtool-1.154.0 and later warn on all implicit width truncations. These width truncations were flagged in stock Chipyard builds. For all width truncations, use the equivalent `Connectable` operator (`:<=` or `:<>=`), along with `.squeeze`/`.squeezeAll`. This has the same behavior as the original `:=`/`<>` connections, since those truncate when the producer in a connection is wider than the consumer. Note that in `TLSerdes.scala`, we needed the `wireProtocol` helper function. The Connectable operators require that the types being connected are structurally type-equivalent. When the five different TL bundles were placed in the `Seq`, their types were erased inside the iteration over `in_channels`. So we connect the `io.protocol` output to the appropriate TL bundle with `wireProtocol` before those types get erased.
tynan-jdwk
force-pushed
the
fix-width-truncation
branch
from
August 17, 2026 18:00
0cbc39b to
67e957a
Compare
16 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
firtool-1.154.0 and later warn on all implicit width truncations (llvm/circt#10621). These width truncations were flagged in stock Chipyard builds.
For all width truncations, use the equivalent
Connectableoperator (:<=or:<>=), along with.squeeze/.squeezeAll. This has the same behavior as the original:=/<>connections, since those truncate when the producer in a connection is wider than the consumer.Note that in
TLSerdes.scala, we needed thewireProtocolhelper function. The Connectable operators require that the types being connected are structurally type-equivalent. When the five different TL bundles were placed in theSeq, their types were erased inside the iteration overin_channels. So we connect theio.protocoloutput to the appropriate TL bundle withwireProtocolbefore those types get erased.