amaranth icon indicating copy to clipboard operation
amaranth copied to clipboard

Deprecate `signal.attrs[x] = y`, use `platform.add_signal_attribute(signal, x, y)` instead

Open whitequark opened this issue 1 year ago • 0 comments

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.)

whitequark avatar Jul 29 '24 09:07 whitequark