Skip to content

NVC crashed when Cocotb accesses a level of the hierarchy that contains a specific user declared type. #1240

@dbrowne1982

Description

@dbrowne1982

When attempting to access a level of the hierarchy via cocotb, nvc crashes due to the declaration of a specific user created type. This occurs even when the type isn't used to create a signal and isn't accessed. Attempting to access any internal signal or constant from cocotb in the affected entity will cause the problem. Removing the type (T_SCALE) stops this from crashing. Changing the size of the user declared type (T_SCALE) from the function calculated constant to a literal prevents the problem. I suspect this may be due to the number of levels of function calls required in this entity to calculate the constant. I've used similar constructs in other entities with fewer levels of function calls and that has worked fine.

I've attached a minimal case to replicate the bug.

Python version used was: 3.12.11
Cocotb version used was: 1.9.2
nvc version used was: 1.16.2

To replicate from the attached untared/unzipped files run:
source ./test_run.sh

You may need to remove/comment out the line that we use to enable nvc in the python environment:
module load nvc

nvc_bug.tar.gz

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions