Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BundleBridge: preserve width; don't use RegNext #2520

Merged
merged 1 commit into from
Jun 13, 2020

Conversation

terpstra
Copy link
Contributor

RegNext erases the width of a UInt.
This leads to:

java.lang.IllegalArgumentException: requirement failed: hartPrefixNode.node (A nexus node with parent 'hartPrefixNode/topMod/topDesign/gen' at (BundleBridge.scala:144:31)) requires all outputs have equivalent Chisel Data types, but got
UInt<10>(Wire in BundleBridgeNexus)
vs
UInt(Reg in BundleBridgeNexus)

Using safeRegNext, we can keep the useful requirement check and still have
BundleBridgeNexus work when registered=true with a UInt.

@jackkoenig FYI

Type of change: bug report
Impact: no functional change
Development Phase: implementation

RegNext erases the width of a UInt.
This leads to:

java.lang.IllegalArgumentException: requirement failed: hartPrefixNode.node (A nexus node with parent 'hartPrefixNode/topMod/topDesign/gen' at  (BundleBridge.scala:144:31)) requires all outputs have equivalent Chisel Data types, but got
UInt<10>(Wire in BundleBridgeNexus)
vs
UInt(Reg in BundleBridgeNexus)

Using safeRegNext, we can keep the useful requirement check and still have
BundleBridgeNexus work when registered=true with a UInt.
@terpstra terpstra requested a review from hcook June 12, 2020 22:40
@mwachs5
Copy link
Contributor

mwachs5 commented Jun 12, 2020

Is there a chisel issue for "RegNext erases width of UInt"?

@aswaterman
Copy link
Member

@mwachs5 IIRC, it has been discussed, and both the current and alternate behaviors are controversial, but since a change would break existing code that relies on this behavior, it remains as-is. cc @jackkoenig

@seldridge
Copy link
Member

seldridge commented Jun 12, 2020

Upstream Chisel discussion about RegNext having UnknownWidth: freechipsproject/rfcs#10

This is complicated and the current solution was to just document the behavior in chipsalliance/chisel#1318.

@terpstra terpstra merged commit 1349bad into master Jun 13, 2020
@terpstra terpstra deleted the bb-type-safe-regnext branch June 13, 2020 00:32
hcook pushed a commit that referenced this pull request Jun 13, 2020
RegNext erases the width of a UInt.
This leads to:

java.lang.IllegalArgumentException: requirement failed: hartPrefixNode.node (A nexus node with parent 'hartPrefixNode/topMod/topDesign/gen' at  (BundleBridge.scala:144:31)) requires all outputs have equivalent Chisel Data types, but got
UInt<10>(Wire in BundleBridgeNexus)
vs
UInt(Reg in BundleBridgeNexus)

Using safeRegNext, we can keep the useful requirement check and still have
BundleBridgeNexus work when registered=true with a UInt.
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.

5 participants