Very Basic: PyMTL3 problems with dump-vcd argument

109 views
Skip to first unread message

Sebastian

unread,
Oct 25, 2020, 5:18:32 PM10/25/20
to pymtl-users
Hello,

Had a lot of fun playing with PyMTL2 and managed to get some non-trivial stuff going with it a couple of years ago.  Would like to give PyMTL3 a spin, but am having a pretty basic problem.

Some "quick start" stuff works ( e.g.  >>> from pymtl3 import * / >>> a = Bits4(4) Bits4(0x4) )

But, 
• when I try (using rtl_language='pymtl' option)
pytest ../regincr/RegIncrRTL_test.py

I get the message: 
argparse.ArgumentError: argument --dump-vcd: conflicting option string: --dump-vcd 
(full traceback below sign-off).

Any suggestions regarding my problem?  I'm running on OS X Catalina, Verilator 4.036 installed, using virtual environment as suggested in https://github.com/pymtl/pymtl3

Thanks,

Sebastian

% pytest ../regincr/RegIncrRTL_test.py

Traceback (most recent call last):

  File "/usr/local/bin/py.test", line 8, in <module>

    sys.exit(console_main())

  File "/usr/local/lib/python3.7/site-packages/_pytest/config/__init__.py", line 187, in console_main

    code = main()

  File "/usr/local/lib/python3.7/site-packages/_pytest/config/__init__.py", line 143, in main

    config = _prepareconfig(args, plugins)

  File "/usr/local/lib/python3.7/site-packages/_pytest/config/__init__.py", line 319, in _prepareconfig

    pluginmanager=pluginmanager, args=args

  File "/usr/local/lib/python3.7/site-packages/pluggy/hooks.py", line 286, in __call__

    return self._hookexec(self, self.get_hookimpls(), kwargs)

  File "/usr/local/lib/python3.7/site-packages/pluggy/manager.py", line 93, in _hookexec

    return self._inner_hookexec(hook, methods, kwargs)

  File "/usr/local/lib/python3.7/site-packages/pluggy/manager.py", line 87, in <lambda>

    firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,

  File "/usr/local/lib/python3.7/site-packages/pluggy/callers.py", line 203, in _multicall

    gen.send(outcome)

  File "/usr/local/lib/python3.7/site-packages/_pytest/helpconfig.py", line 100, in pytest_cmdline_parse

    config = outcome.get_result()  # type: Config

  File "/usr/local/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result

    raise ex[1].with_traceback(ex[2])

  File "/usr/local/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall

    res = hook_impl.function(*args)

  File "/usr/local/lib/python3.7/site-packages/_pytest/config/__init__.py", line 1003, in pytest_cmdline_parse

    self.parse(args)

  File "/usr/local/lib/python3.7/site-packages/_pytest/config/__init__.py", line 1286, in parse

    args, self.option, namespace=self.option

  File "/usr/local/lib/python3.7/site-packages/_pytest/config/argparsing.py", line 135, in parse_setoption

    parsedoption = self.parse(args, namespace=namespace)

  File "/usr/local/lib/python3.7/site-packages/_pytest/config/argparsing.py", line 105, in parse

    self.optparser = self._getparser()

  File "/usr/local/lib/python3.7/site-packages/_pytest/config/argparsing.py", line 122, in _getparser

    arggroup.add_argument(*n, **a)

  File "/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/argparse.py", line 1373, in add_argument

    return self._add_action(action)

  File "/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/argparse.py", line 1577, in _add_action

    action = super(_ArgumentGroup, self)._add_action(action)

  File "/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/argparse.py", line 1387, in _add_action

    self._check_conflict(action)

  File "/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/argparse.py", line 1526, in _check_conflict

    conflict_handler(action, confl_optionals)

  File "/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/argparse.py", line 1535, in _handle_conflict_error

    raise ArgumentError(action, message % conflict_string)

argparse.ArgumentError: argument --dump-vcd: conflicting option string: --dump-vcd

Christopher Batten

unread,
Oct 25, 2020, 5:33:19 PM10/25/20
to Sebastian, pymtl-users

Hi Sebastian,

The tutorials for ECE 5745 are really just meant for the course. The course was using a very specific commit of PyMTL3 last spring because the master branch was under active development ... I will be updating the tutorials this spring, but you should not assume those tutorials will work with the master branch of PyMTl3 ...

Best,
Chris
> --
> You received this message because you are subscribed to the Google Groups "pymtl-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to pymtl-users...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/pymtl-users/c9849f8c-61fd-4940-9413-90eb690900dan%40googlegroups.com.

Sebastian

unread,
Oct 25, 2020, 6:06:32 PM10/25/20
to pymtl-users
Thanks Chris.  I see.  Your tutorial document and examples for v2 were excellent.  Looking forward to the v3 versions!  

So at the moment the only samples for outsiders to safely riff on are the ones found in https://github.com/pymtl/pymtl3/tree/master/examples I'm guessing?

By chance, in the Quick Start Guide (https://pymtl3.readthedocs.io/en/latest/intro/quickstart.html) is it also 'ok' if I run into this issue:

>>> fa.apply( DefaultPassGroup() )

Traceback (most recent call last):

  File "<stdin>", line 1, in <module>

NameError: name 'DefaultPassGroup' is not defined

Thanks again,

Sebastian


Christopher Batten

unread,
Oct 25, 2020, 6:08:08 PM10/25/20
to Sebastian, pymtl-users

Right ... I think those examples should work?

Not sure why the DefaultPassGroup is not showing up ... maybe @shunning can chime in?

Best,
Chris
> To view this discussion on the web visit https://groups.google.com/d/msgid/pymtl-users/fd34ff83-25c4-476a-9bbf-9803d8114e16n%40googlegroups.com.

Christopher Batten

unread,
Oct 25, 2020, 9:07:23 PM10/25/20
to Sebastian, pymtl-users
Hmmm ... everything seems to be working fine? What version of PyMTL3 are you using?

% python3 -m venv pymtl3
% source pymtl3/bin/activate
% pip install pymtl3
(pymtl3) brg-vip % python
>>> from pymtl3 import *
>>> from pymtl3.examples.ex00_quickstart import FullAdder
>>> fa = FullAdder()
>>> fa.apply( DefaultPassGroup(textwave=True) )
>>> fa.sim_reset()
>>> fa.a @= 0
>>> fa.b @= 1
>>> fa.cin @= 0
>>> fa.sim_tick()
>>> fa.a @= 1
>>> fa.b @= 1
>>> fa.cin @= 1
>>> fa.sim_tick()
>>> fa.print_textwave()

|0 |1 |2 |3 |4

clk /‾‾\__/‾‾\__/‾‾\__/‾‾\__/‾‾\__

reset ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾\___________

a ________________________/‾‾‾‾‾

b __________________/‾‾‾‾‾‾‾‾‾‾‾

cin ________________________/‾‾‾‾‾

cout ________________________/‾‾‾‾‾

sum __________________/‾‾‾‾‾‾‾‾‾‾‾
> To view this discussion on the web visit https://groups.google.com/d/msgid/pymtl-users/CF0B724D-FB1E-402C-8B96-3CA0577A1566%40cornell.edu.

Sebastian

unread,
Oct 25, 2020, 9:24:22 PM10/25/20
to pymtl-users
Thanks Chris!  It worked!  Seems like the "textwave=True" argument as in your code above was what I needed (I am using 3.1.2, just downloaded it today).  I don't think that argument appears in the Quick Start Guide, was just blindly following instructions hope I didn't miss it  (trying to absorb what I can via what I can recall from v2 and the v3 code and your ISCA'19 Tutorial, those are the most detailed dox available at the mo right, as well as the IEEE Micro paper?)

What a cool functionality!  Wonderful tool you guys are building.  

Christopher Batten

unread,
Oct 25, 2020, 9:25:48 PM10/25/20
to Sebastian, pymtl-users

It should work fine even without textwave=True though? That is just there to give you the cute little text waveform dump.

Best,
Chris
> To view this discussion on the web visit https://groups.google.com/d/msgid/pymtl-users/3ff8896b-74d2-4935-a996-e48665a1f6fcn%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages