Skip to content

Suggestion: DomainRenamer taking ClockDomains #762

Open
@galibert

Description

@galibert

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.

Activity

whitequark

whitequark commented on Mar 7, 2023

@whitequark
Member

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.

galibert

galibert commented on Mar 7, 2023

@galibert
ContributorAuthor

Ah nice, is cd.reset available too?

whitequark

whitequark commented on Mar 7, 2023

@whitequark
Member

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.

galibert

galibert commented on Mar 7, 2023

@galibert
ContributorAuthor

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @whitequark@galibert

        Issue actions

          Suggestion: DomainRenamer taking ClockDomains · Issue #762 · amaranth-lang/amaranth