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

Running simulate without specifying a VCD file yields an unhelpful error message (AttributeError: 'NoneType' object has no attribute 'register_var') #319

the6p4c opened this issue Feb 11, 2020 · 1 comment


Copy link

the6p4c commented Feb 11, 2020

This isn't hard to reproduce with any of the provided examples, say Running python simulate -c 10, for example, produces a Python traceback rather than a friendly error message.

Traceback (most recent call last):
  File "", line 19, in <module>
    main(ctr, ports=[ctr.o])
  File "/path-to-python/site-packages/nmigen/", line 76, in main
    main_runner(parser, parser.parse_args(), *args, **kwargs)
  File "/path-to-python/site-packages/nmigen/", line 69, in main_runner
    traces=ports) as sim:
  File "/path-to-python/site-packages/nmigen/back/", line 915, in __init__
    self._state.start_waveform(_VCDWaveformWriter(self._signal_names, **kwargs))
  File "/path-to-python/nmigen/back/", line 115, in __init__
    vcd_var = self.vcd_writer.register_var(
AttributeError: 'NoneType' object has no attribute 'register_var'

I can only assume it's down to this line (

self.vcd_writer = vcd_file and VCDWriter(self.vcd_file,
            timescale="100 ps", comment="Generated by nMigen")

Expected behaviour
Either VCD_FILE is a required parameter, a default is specified or a more user-friendly error message is generated.

@whitequark whitequark added the bug label Feb 11, 2020
Copy link

(A broader question is, is nmigen.cli even useful beyond example code?)

@whitequark whitequark added this to the 0.2 milestone Apr 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

No branches or pull requests

2 participants