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

pure simulation signals should be supported #262

Closed
sbourdeauducq opened this issue Oct 28, 2019 · 0 comments
Closed

pure simulation signals should be supported #262

sbourdeauducq opened this issue Oct 28, 2019 · 0 comments

Comments

@sbourdeauducq
Copy link
Member

sbourdeauducq commented Oct 28, 2019

from nmigen import *
from nmigen.back.pysim import *

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

     def elaborate(self, platform):
        return Module()

if __name__ == "__main__":
     dummy = Dummy()
     with Simulator(dummy) as sim:
        def process():
            yield dummy.x.eq(1)
            print((yield dummy.x))
            yield dummy.x.eq(0)
            print((yield dummy.x))
        sim.add_process(process)
        sim.run()

prints:

ValueError: Process 'test.py:16' sent a request to set signal '(sig x)', which is not a part of simulation

Not supporting this case makes it impossible to have several pure simulation processes communicating with each other through signals. For example, one may want to be able to replace certain modules e.g. in a dataflow system with simulation equivalents, and the interfaces (signals) should stay the same.

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

No branches or pull requests

2 participants