lambdaconcept / lambdasoc

BSD 2-Clause "Simplified" License
43 stars 27 forks source link

Peripheral constructor breaks when a DomainRenamer is used #5

Open jeanthom opened 4 years ago

jeanthom commented 4 years ago

This is the kind of error message you get when instantiating a Peripheral inside a DomainRenamer:

Traceback (most recent call last):
  File "headless-ecpix5.py", line 241, in <module>
    soc = DDR3SoC(clk_freq=int(platform.default_clk_frequency),
  File "headless-ecpix5.py", line 204, in __init__
    self.dramcore = DomainRenamer("dramsync")(gramCore(
  File "/home/jeanthomas/.local/lib/python3.8/site-packages/gram-0.0.0-py3.8.egg/gram/core/__init__.py", line 14, in __init__
  File "/home/jeanthomas/.local/lib/python3.8/site-packages/lambdasoc/periph/base.py", line 64, in __init__
    self.name      = name or tracer.get_var_name(depth=2 + src_loc_at).lstrip("_")
  File "/home/jeanthomas/.local/lib/python3.8/site-packages/nmigen/tracer.py", line 45, in get_var_name
    raise NameNotFound
nmigen.tracer.NameNotFound

As a workaround, you can manually define the peripheral name.