amaranth
amaranth copied to clipboard
Deprecate `signal.attrs[x] = y`, use `platform.add_signal_attribute(signal, x, y)` instead
This removes the last major source of mutability in the core HDL, and makes it possible to use the same component hierarchy to build several bitstreams with different attributes without the hazards of reusing a mutable attribute array. This will also solve the issue of add_clock_constraint adding a keep attribute, mutating the passed signal.
Additionally, we could extend this to non-Signals but rather arbitrary Values, as NIR should be able to give them names as necessary. (Only allowing Signals is simpler though.)