Closed
Description
With Python 3.7.3 (shipped with Debian stable) and 3.8.2 (via pyenv), I encountered the following error when simulating a design with a couple of memory banks:
File "/path/to/nmigen/back/pysim.py", line 765, in __call__
exec(emitter.flush(), exec_locals)
RecursionError: maximum recursion depth exceeded during compilation
Here's a minimal reproduction:
import unittest
from nmigen import *
from nmigen.back.pysim import *
class MemTest(unittest.TestCase):
def test_mem(self):
m = Module()
mem = Memory(width=1, depth=0xC00)
m.submodules.rport = mem.read_port()
m.submodules.wport = mem.write_port()
sim = Simulator(m)
sim.run()
Reducing the depth of the memory (width doesn't seem to matter) makes the failure go away. For the time being that workaround works for me, but it would be nice to use the same design parameters for simulation and synthesis.