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

Verilator errors (ex: lint errors when verilating) are suppressed when they should be displayed #245

Open
paul-demo opened this issue Sep 1, 2023 · 0 comments

Comments

@paul-demo
Copy link

This is my first time using cocotb-test and I'm using it with Verilator. I have used Verilator fairly extensively with just C++ testbenches. I'm following some alexforencich examples for cocotb-test which are basically this:

cocotb_unit_test.py:

import os
import deps
import cocotb_test.simulator

def register(top, file, parameters=None):
    def _register():
        cocotb_test.simulator.run(
            toplevel=top,
            module=os.path.splitext(os.path.basename(file))[0],
            verilog_sources=deps.get_dependencies(top + '.f'),
            parameters=parameters,
            compile_args=['-CFLAGS', '-Wno-deprecated',],
            timescale='1ns/1ps',
            waves=None,
        )
    return _register

syncfifo_test.py:

import cocotb
import cocotb.triggers
import cocotb_unit_test

@cocotb.test()
async def syncfifo_basic(dut):
    # TODO: testbench goes here

test_dut = cocotb_unit_test.register(top="syncfifo", file=__file__)

A makefile invokes the pytest file like this:

PYTHONPATH={blah} SIM=verilator WAVES=1 pytest -o log_cli=True

While this works fine for functional RTL, I found that if you have an RTL bug that the verilator linter would normally catch for you (like a misnamed variable), cocotb-test is suppressing the Verilator output that results from the "perl verilator ..." call, so all you get is the cryptic message: "SystemExit: Process .../verilator terminated with error 1". In reality the verilator command that failed prints a ton of useful debugging information before returning that value of 1, and it seems the cocotb-test should be displaying it.

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

1 participant