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

ResetSignal's allow_reset_less fails on renamed reset_less domains #400

Closed
adamgreig opened this issue Jun 5, 2020 · 0 comments
Closed

ResetSignal's allow_reset_less fails on renamed reset_less domains #400

adamgreig opened this issue Jun 5, 2020 · 0 comments
Labels
Milestone

Comments

@adamgreig
Copy link
Contributor

@adamgreig adamgreig commented Jun 5, 2020

If a module uses a ResetSignal(allow_reset_less=True) on a clock domain which is later renamed into a reset-less domain, the ResetSignal still refers to the now non-existent reset:

from nmigen import (Elaboratable, Module, Signal,
                    ResetSignal, ClockDomain, DomainRenamer)
from nmigen.back import verilog


class Mod(Elaboratable):
    def __init__(self):
        self.x = Signal()

    def elaborate(self, platform):
        m = Module()
        s = ResetSignal(domain="x", allow_reset_less=True)
        m.d.comb += self.x.eq(s)
        return m


class Top(Elaboratable):
    def elaborate(self, platform):
        m = Module()
        # Change reset_less=False to fix
        cd_y = ClockDomain("y", reset_less=True)
        m.domains += cd_y
        m.submodules += DomainRenamer({"x": "y"})(Mod())
        return m


if __name__ == "__main__":
    verilog.convert(Top())
<very long traceback snip>
nmigen.hdl.cd.DomainError: Signal (rst y) refers to reset of reset-less domain 'y'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants