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

Hardcoded installation path of verilator in unit tests #168

Closed
cpehle opened this issue Sep 19, 2018 · 2 comments
Closed

Hardcoded installation path of verilator in unit tests #168

cpehle opened this issue Sep 19, 2018 · 2 comments

Comments

@cpehle
Copy link

cpehle commented Sep 19, 2018

Currently verilator installation path is hardcoded in "NyuziProcessor/tests/unit/runtest.py", this prevents use of non-standard installation paths (for example if the user does not have root permissions or if verilator is installed as a module).

verilator_args = [
'sh',
'/usr/local/bin/verilator',
'--unroll-count', '512',
'--assert',
'-I' + test_harness.PROJECT_TOP + '/hardware/core',
'-DSIMULATION=1',
'-Mdir', test_harness.WORK_DIR,
'-cc', filename,
'--exe', DRIVER_PATH
]

This most easily could be fixed by taking into account the VERILATOR_ROOT and VERILATOR_BIN environment variables that verilator uses to keep track of non-standard installation locations.

jbush001 added a commit that referenced this issue Sep 20, 2018
verilator is in the PATH, so switch to command line instead of
absolute path.
@jbush001
Copy link
Owner

Okay, that breaks in continuous integration, because it's not picking up /usr/local/bin/ from the PATH.

On my machine, VERILATOR_ROOT and VERILATOR_BIN are not set on install (these appear to be build variables).

jbush001 added a commit that referenced this issue Sep 20, 2018
jbush001 added a commit that referenced this issue Sep 20, 2018
Take 2. verilator is a script, so needs to be launched from a script,
but invoking sh does not use the PATH variable. Let python start
the shell instead.
@jbush001
Copy link
Owner

I kind of mangled the commit log, but /usr/local/bin/verilator is a perl script (which then invokes the actual executable), so it can't be invoked directly by subprocess.call. My original workaround was to execute 'sh' with verilator as the argument. But that doesn't perform a PATH lookup (since it's an argument), hence the hardcoded path. Instead, invoking subprocess.call with shell=true uses PATH as expected.

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

2 participants