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

SystemVerilog synthesizer assumes undriven signals with valid values are constants during generation #254

Closed
mkorbel1 opened this issue Feb 1, 2023 · 0 comments · Fixed by #375
Assignees
Labels
bug Something isn't working

Comments

@mkorbel1
Copy link
Contributor

mkorbel1 commented Feb 1, 2023

Describe the bug

Code like this exists in "systemverilog.dart":

      } else if (driver == null && receiver.value.isValid) {
        assignments.add(_SynthAssignment(receiver.value, synthReceiver));
      } else if (driver == null && !receiver.value.isFloating) {
        // this is a signal that is *partially* invalid (e.g. 0b1z1x0)
        assignments.add(_SynthAssignment(receiver.value, synthReceiver));
      }

This appears to indicate that if a signal has no driver, yet has valid (or partially valid) values, then the generation of SystemVeriog will conclude that it must be a constant value. This means non-synthesizable signal deposition like put could affect the constant values present in generated outputs. The checks for constants need to be more significant, such as checking for Const, unassignable, etc.

To Reproduce

Make a design with an undriven signal which has a valid value deposited via put and check generated SystemVerilog of the design.

Expected behavior

An undriven signal remains undriven in generated outputs.

Actual behavior

An undriven signal, with a value deposited on it, becomes a constant value in generated outputs.

Additional: Dart SDK info

No response

Additional: pubspec.yaml

No response

Additional: Context

No response

@mkorbel1 mkorbel1 added the bug Something isn't working label Feb 1, 2023
@mkorbel1 mkorbel1 self-assigned this May 4, 2023
mkorbel1 added a commit to mkorbel1/rohd that referenced this issue Jun 1, 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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant