Skip to content
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

Better definition of clock domains #12

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

galibert
Copy link

@galibert galibert commented Apr 12, 2023

@galibert galibert changed the title rfc: Better definition of block domains rfc: Better definition of clock domains Apr 12, 2023
@josuah
Copy link

josuah commented May 12, 2023

The new syntax, in particular the new ClockDomain constructor, makes it a whole lot easier to read!

To have an insight on who used the existing API:
https://github.com/search?q=enableinserter+language%3APython&type=code&l=Python

@whitequark
Copy link
Member

This all is broadly reasonable and in line with what I've been planning already. It is a very large change however, and I think we won't get around to it particularly soon. Ultimately something like this needs to be done before 1.0, and probably this year.

@whitequark whitequark changed the title rfc: Better definition of clock domains Better definition of clock domains May 12, 2023
@jevinskie
Copy link

Has anybody thought about adding clock frequency information to ClockDomains?

I opened enjoy-digital/litex#1310 because I wanted build-time assertions to ensure that a hard IP block wasn’t being overclocked.

Perhaps freq, freq_min, freq_max and maybe a freq_margin (for PLL outputs that have guaranteed tolerances) could be useful? Or would that be better served by a new RFC?

@whitequark
Copy link
Member

whitequark commented Jul 21, 2023

Has anybody thought about adding clock frequency information to ClockDomains?

Yes. This is a rather complex problem in situations where frequency can change at runtime. It should not be a part of this RFC.

(In addition the assertions probably need to run post-elaboration, which isn't something we currently have at all.)

@whitequark whitequark added the area:core RFC affecting APIs in amaranth-lang/amaranth label Aug 21, 2023
@galibert galibert closed this Oct 9, 2023
@whitequark whitequark reopened this Nov 22, 2023
@whitequark
Copy link
Member

Reopened as requested by the author.

@whitequark whitequark added the meta:nominated Nominated for discussion on the next relevant meeting label Jan 8, 2024
@whitequark
Copy link
Member

I've listed the challenges associated with the current clock domain system in this conversation. To move this proposal forward, it will have to give an answer to these challenges, especially the interaction of sync reset, async reset, and enable.

More broadly, I think that the domain scoping and the domain control set semantics are topics that can probably be addressed separately. Given how troublesome domain scoping is for both understanding the language and for implementing it (NIR and the platform layer struggle with it) this may be worth addressing separately.

@whitequark whitequark removed the meta:nominated Nominated for discussion on the next relevant meeting label Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:core RFC affecting APIs in amaranth-lang/amaranth
4 participants