Skip to content

Resolve implicit-width-truncation warnings - #278

Open
tynan-jdwk wants to merge 1 commit into
ucb-bar:masterfrom
tynan-jdwk:fix-width-truncation
Open

Resolve implicit-width-truncation warnings#278
tynan-jdwk wants to merge 1 commit into
ucb-bar:masterfrom
tynan-jdwk:fix-width-truncation

Conversation

@tynan-jdwk

Copy link
Copy Markdown

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 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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant