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

pyverilator does not work with latest verilator #17

Open
namin opened this issue Mar 3, 2022 · 4 comments
Open

pyverilator does not work with latest verilator #17

namin opened this issue Mar 3, 2022 · 4 comments

Comments

@namin
Copy link

namin commented Mar 3, 2022

I have a program (from https://github.com/namin/bluespec-sandbox) that works with verilator 4.200 but not verilator 4.218.

The error is

clang++  -I.  -MMD -I/usr/local/Cellar/verilator/4.218/share/verilator/include -I/usr/local/Cellar/verilator/4.218/share/verilator/include/vltstd -DVM_COVERAGE=0 -DVM_SC=0 -DVM_TRACE=1 -DVM_TRACE_FST=0 -faligned-new -fbracket-depth=4096 -fcf-protection=none -Qunused-arguments -Wno-bool-operation -Wno-tautological-bitwise-compare -Wno-parentheses-equality -Wno-sign-compare -Wno-uninitialized -Wno-unused-parameter -Wno-unused-variable -Wno-shadow     -fPIC -shared --std=c++11 -DVL_USER_FINISH  -std=gnu++14 -Os -c -o pyverilator_wrapper.o ../obj_dir/pyverilator_wrapper.cpp
../obj_dir/pyverilator_wrapper.cpp:113:14: error: expected ';' after top level declarator
uint32_t get_&RDY_put(Vmachine01* top){return top->&RDY_put;}
             ^
             ;
1 error generated.
make: *** [pyverilator_wrapper.o] Error 1
Traceback (most recent call last):
  File "/Users/namin/code/blu/bluespec-sandbox/testbench.py", line 3, in <module>
    sim = PyVerilator.build('machine01.v')
  File "/Users/namin/opt/anaconda3/lib/python3.9/site-packages/pyverilator/pyverilator.py", line 493, in build
    call_process(make_args, quiet=quiet)
  File "/Users/namin/opt/anaconda3/lib/python3.9/site-packages/pyverilator/pyverilator.py", line 345, in call_process
    subprocess.check_call(args)
  File "/Users/namin/opt/anaconda3/lib/python3.9/subprocess.py", line 373, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['make', '-C', 'obj_dir', '-f', 'Vmachine01.mk', 'LDFLAGS=-fPIC -shared']' returned non-zero exit status 2.

Let me know if I can provide more information.

Thanks!

@maltanar
Copy link

Hello, I ran into this as well and it looks like the issue is the ampersand characters that appear in the generated function names.I have a quick fix here that worked for me (essentially just stripping the ampersand character from the generated macro calls):

maltanar#5

@bat52
Copy link

bat52 commented Jul 30, 2023

I made a fork that deals with this issue ( https://github.com/bat52/pyverilator ) and is available over pypi as pyverilator-mm

@Kreijstal
Copy link

I made a fork that deals with this issue ( https://github.com/bat52/pyverilator ) and is available over pypi as pyverilator-mm

add issues and discussions on your fork

@bat52
Copy link

bat52 commented Aug 6, 2024

I made a fork that deals with this issue ( https://github.com/bat52/pyverilator ) and is available over pypi as pyverilator-mm

add issues and discussions on your fork

Done

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

No branches or pull requests

4 participants