Distinguish LHS/RHS in connect/bulkConnect hardware error - #5491
Merged
jackkoenig merged 1 commit intoSep 21, 2026
Merged
Conversation
Data.connect and Data.bulkConnect both called requireIsHardware(this, ...)
and requireIsHardware(that, ...) with the exact same message on both
sides ("data to be connected" / "data to be bulk-connected"). When one
operand was a bare Chisel type instead of hardware, the resulting error
gave no way to tell whether it was the left-hand or right-hand side that
needed to be wrapped in Wire(_)/IO(_).
Give each side its own message so the error names which one is at
fault, for both := (connect) and <> (bulkConnect).
Add four cases to the existing "Connect error messages should have
meaningful information" test in ConnectSpec: a bare LHS and a bare RHS,
for both connect and bulkConnect.
Closes chipsalliance#1170.
|
|
jackkoenig
approved these changes
Sep 21, 2026
jackkoenig
left a comment
Contributor
There was a problem hiding this comment.
This is great, thank you for the improvement!
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.
Summary
Data.connectandData.bulkConnectboth calledrequireIsHardware(this, ...)andrequireIsHardware(that, ...)with the exact same message on both sides ("data to be connected" / "data to be bulk-connected"). When one operand was a bare Chisel type instead of hardware, the resulting error gave no way to tell whether it was the left-hand or right-hand side that needed to be wrapped inWire(_)/IO(_).This gives each side its own message so the error names which one is at fault, for both
:=(connect) and<>(bulkConnect). Added four cases to the existing "Connect error messages should have meaningful information" test inConnectSpec: a bare LHS and a bare RHS, for bothconnectandbulkConnect.Closes #1170.
Release Notes
Error messages for connecting a non-hardware (bare Chisel type) operand via
:=or<>now specify whether the left-hand or right-hand side was the problem, instead of an ambiguous message that didn't distinguish the two.