-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add RFC for a GPIO peripheral. #49
Conversation
* Fix SVG diagrams. * Add open-drain mode. * Remove ISync register. * Remove pin count limit. * Rename module to `amaranth_soc.gpio`.
Also, add white backgrounds to SVG diagrams.
I have a few questions and comments:
|
It would have been set-over-clear, for consistency with the CSR API. Though in the case of
Given that the
Zero.
In my prototype, they use
Yes, this would be consistent with |
I've edited my comment to add an idea for allocating the |
Having an |
One more comment:
|
Comment:
|
Some minor questions/comments:
The major concern that this raises to me is a lot of questions surrounding the balance of flexibility vs documentability. I think the CSR machinery provides excellent flexibility that this peripheral could take advantage of, but actually using that may create a peripheral that's too difficult to explain, and so the peripheral should be designed in this light and excessively complex configurations be prohibited. For context, I am familiar with microcontroller peripherals, where the system has a specific bus width (8, 16, or 32) and peripheral registers are always exactly this width. Some specific questions related to the above:
|
In my proposal, selecting
The entire register is always accessed simultaneously. In general, on a 32-bit MCU, I will recommend using a 32-bit CSR bus unless otherwise needed. In this case every access is guaranteed to be 1-cycle, 0-latency. Otherwise the bridge will take 4 cycles to do a register write, which is rarely worth it if you can spend the area. It is common for peripherals to support e.g. only word accesses, but return undefined data on half or byte accesses. (STM32 does this for example.) |
…nth meeting. - Add support for an ALTERNATE mode. - Use interleaved set/clear bits in the SetClr register. - Remove upper bound on the input_stage parameter. - Add hints towards a policy for backward-compatible peripheral extensions.
Three of the register diagrams are unreadable on black background again. |
@jfng You have not clarified the behavior on writing to both Also, I'm not sure if we can use that naming--won't it be |
My bad.
Correct. Each register should only need a field array, where each item is associated to a pin. |
Right, so I guess the diagram should be amended for that? |
We have discussed this RFC on the 2024-03-08 SoC meeting. The disposition was to merge. |
Rendered