-
Notifications
You must be signed in to change notification settings - Fork 178
vendor, io: fix missing i_domain
and o_domain
arguments when specializing
#1347
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
vendor, io: fix missing i_domain
and o_domain
arguments when specializing
#1347
Conversation
Arguably this method should also be implemented on |
I've taken a quick look at your PR. Offhand, there are two concerns:
I think this PR should probably be a blocker for the 0.5 release, but other than that we'll need more discussion of the direction first. I'll only be able to get around to that after handling some of the other release blockers first. |
Indeed this was a sharp edge on the existing API (as viewed from the vendor implementation) that I have sanded down with this PR, but it may be that a different solution avoids this completely. I can also write this up as an issue (without the solution) if that is easier for the triage process? |
The PR is fine. |
Having conditionally-present attributes causes more problems than it's worth (see amaranth-lang#1347). Just make them contain `None` when irrelevant.
Having conditionally-present attributes causes more problems than it's worth (see amaranth-lang#1347). Just make them contain `None` when irrelevant.
Having conditionally-present attributes causes more problems than it's worth (see #1347). Just make them contain `None` when irrelevant.
Awesome that this is fixed now 🎉 |
Platforms implement the
get_io_buffer
method to provide vendor-specific implementations ofio.Buffer
,io.FFBuffer
andio.DDRBuffer
. Currently several platforms useisinstance
to match the type of buffer, then construct a child class of the relevant buffer and return this object. Unfortunately these platforms miss the optionali_domain
ando_domain
arguments when calling the constructor, thus placing the vendor-specific specialisations in the defaultsync
domain even if an different domain is specified in user code. This is the bug.Only
io.FFBuffer
andio.DDRBuffer
are affected as these are currently the only buffers with optional arguments in the constructor signature.This could be fixed by modifying each vendor implementation to pass the optional arguments as required. That might look like this:
However this pushes more complexity into the vendor implementation and requires maintenance across an ever increasing number of vendor files.
This PR implements a factory method called
create_from
on the base class. This method is used in the vendor implementations to correctly create the specialised classes.This is a fix for the new
lib.io
components, so mentioning the tracking issue here #1210