rohd icon indicating copy to clipboard operation
rohd copied to clipboard

Protect `Const` from having its value modified

Open mkorbel1 opened this issue 1 year ago • 0 comments
trafficstars

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 avatar May 30 '24 19:05 mkorbel1