Skip to content

Just some idea #855

@curliph

Description

@curliph

Firstly, I really like the syntax of amaranth (compare to migen...:)

But when I saw the code like " m.d.sync/comb += self.name.eq(...)"
I used to though that seems a little not elegance.
If we have to assign logic to sync/comb block of module, why not follow idea of sv:

self.count = Signal(width, logic="sync") // always_ff
self.count = Signal(width, logic="comb") // always_comb
self.count = Signal(width); // compatible with current design

we can use "with" clousuare here

   with m.d.sync(domain = default):
        self.count.eq(self.count + 1)   // can do logic type check as sv
        If (self.reload):         // "with m.If/Else" can be implicity here
            self.count.eq(self.reload_value)
        Else If(self.count == TOP):
            self.count.eq(0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions