Add optional shape positional arg to IRQLine #19
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Recently (May 23), amaranth changed the way Signals are initialized. There is now a metaclass that is hooked in, which is responsible for calling the actual concrete class's initializer. Currently it does so, like this:
signal = super().__call__(shape, **kwargs, src_loc_at=src_loc_at + 1)
.So, all Signals and Signal subclasses now need to accept a shape positional arg. This causes a problem for IRQLine in lambdasoc, which defines its initializer as
def __init__(self, *, name=None, src_loc_at=0):
. So, if you try to use IRQLine with a newer amaranth checkout, you will get a somewhat confusing error like this (taken from a LUNA example SoC):Fortunately, all we need to do is accept that shape positional arg, and discard it or pass it on to the superclass initializer. We can even make it totally optional at the same time. As far as I know, IRQLine is the only class in lambdasoc that needs this change.
Thanks!