amaranth
amaranth copied to clipboard
Suggestion: DomainRenamer taking ClockDomains
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.
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.
Ah nice, is cd.reset available too?
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.
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).