amaranth icon indicating copy to clipboard operation
amaranth copied to clipboard

Suggestion: DomainRenamer taking ClockDomains

Open galibert opened this issue 2 years ago • 4 comments

I hate repeating strings, because typos happen. And with the global-by-default of clock domains, typos can hit something existing. So it would be nice that where a DomainRenamer takes the name of an existing domain, it can alternatively take a ClockDomain object.

That's probably a valid request for ClockSignal/ResetSignal too.

galibert avatar Mar 07 '23 13:03 galibert

That's probably a valid request for ClockSignal/ResetSignal too.

If you have the domain, you don't need ClockSignal, since you can use cd.clk.

whitequark avatar Mar 07 '23 13:03 whitequark

Ah nice, is cd.reset available too?

galibert avatar Mar 07 '23 14:03 galibert

Ah nice, is cd.reset available too?

Yes. Also, now that I think about it: can you use cd.name instead of passing cd directly to DomainRenamer?

DomainRenamer is often used in cases where you don't have the clock domain yet, which is why it takes a name.

whitequark avatar Mar 07 '23 14:03 whitequark

Oh sure, I can do that. In my case I create the domains and a pll which generates their clocks, then rename then as sync for a couple of submodules (hdmi video and audio).

galibert avatar Mar 07 '23 14:03 galibert