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

Protect Const from having its value modified #486

Open
mkorbel1 opened this issue May 30, 2024 · 0 comments
Open

Protect Const from having its value modified #486

mkorbel1 opened this issue May 30, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@mkorbel1
Copy link
Contributor

Motivation

Currently, Const is just a Logic that initializes itself with a specific value. Technically, the value could be changed later via a put directly on the Const or on another Logic which shares an underlying _Wire. This can be confusing for debug, and worse, could cause synthesized outputs (e.g. SystemVerilog) to have constant values which do not match the requested value at the time of Const creation.

Desired solution

Some ideas:

  • Have a way to flag/throw an exception when the value of a Const is attempted to be changed
  • Have a way to ensure synthesized outputs have the intended constant value

Alternatives considered

No response

Additional details

Somewhat related to #429

@mkorbel1 mkorbel1 added the enhancement New feature or request label May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant