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

Support for generated clock constraints #498

Closed
jfng opened this issue Sep 14, 2020 · 3 comments
Closed

Support for generated clock constraints #498

jfng opened this issue Sep 14, 2020 · 3 comments

Comments

@jfng
Copy link
Member

jfng commented Sep 14, 2020

We currently do not have a way to define an explicit relationship between a clock and another user-generated clock, derived from the former. The relationship would be expressed in terms of frequency division/multiplication, phase shift, and duty cycle.

Support would vary between toolchains:

  • Vivado, Diamond, iCECube2 and Quartus have a create_generated_clock XDC/SDC constraint.
  • nextpnr-{ice40,ecp5} doesn't seem to implement generated clock constraints.

Also, unlike platform-level clocks, a generated clock could be local to a submodule and therefore not propagated to the top-level. We would need a way to retrieve its name in order to pass it as a constraint parameter.

@mithro
Copy link

mithro commented Sep 14, 2020

FYI - We are working on making Yosys (through plugins -> https://github.com/SymbiFlow/yosys-symbiflow-plugins and chipsalliance/yosys-f4pga-plugins#18) propagate SDC timing constraints through clock buffers (and generate derived timing constraints through things like PLLs) and then write out a new SDC file with the complete constraint set (against the generated json / blif names). As nextpnr uses Yosys as a front end, it might make it easier for nextpnr to support this type of thing?

@whitequark
Copy link
Member

Related to #425.

@whitequark
Copy link
Member

whitequark commented Feb 9, 2024

So actually, when you instantiate a PLL, the toolchain creates a generated clock automatically. create_generated_clock is useful primarily in one case: when you have a clock mux. The SDC files can quickly get extremely unwieldy however, if you start stacking the muxes.

The proposal as stated would require an RFC, but a much more practical solution is to add a platform function that both instantiates a BUFGMUX or whatever and adds the requisite constraints. This is a fairly niche use case though and it's a low priority to add something like that.

@whitequark whitequark closed this as not planned Won't fix, can't repro, duplicate, stale Feb 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants