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

Reinstate connection width mismatch exception #311

Closed
mkorbel1 opened this issue Mar 13, 2023 · 0 comments · Fixed by #375
Closed

Reinstate connection width mismatch exception #311

mkorbel1 opened this issue Mar 13, 2023 · 0 comments · Fixed by #375
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@mkorbel1
Copy link
Contributor

Describe the bug

When _Wires were added to ROHD Logics (#199), an exception was mistakenly removed which clearly explained why signals could not be connected when signals are different widths:

rohd/lib/src/logic.dart

Lines 261 to 264 in bae662c

if (other.width != width) {
throw Exception('Bus widths must match.'
' Cannot connect $this to $other which have different widths.');
}

We should add it back. Probably we should add a test to make sure it doesn't get removed, and also make it a unique type of exception instead of Exception. Perhaps some rewording is needed as well.

To Reproduce

Example from: #308 (reply in thread)

Expected behavior

An error something like this:

Exception: Bus widths must match. Cannot connect Logic(11): f to Logic(10): _swizzled which have different widths.

Actual behavior

Uncaught Error: Failed to put value on signal (f): Updated value width mismatch. The width of 10'bzzzz00111z should be 11

Additional: Dart SDK info

No response

Additional: pubspec.yaml

No response

Additional: Context

Present in v0.4.2

@mkorbel1 mkorbel1 added bug Something isn't working good first issue Good for newcomers labels Mar 13, 2023
@mkorbel1 mkorbel1 self-assigned this Jun 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant