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

No warning of erroneous architecture when adding configurations #1026

Closed
sigmuha opened this issue Jun 5, 2024 · 3 comments
Closed

No warning of erroneous architecture when adding configurations #1026

sigmuha opened this issue Jun 5, 2024 · 3 comments

Comments

@sigmuha
Copy link

sigmuha commented Jun 5, 2024

When adding a generic to a testbench with the "add_config" method, no warning is given to the user if the architecture of the testbench is not correct.

I experienced this when writing "t_dummy" instead of "tb_dummy" for the entity of the architecture of a testbench, where the entity is called "tb_dummy". This caused vunit not to create a default configuration, leading to the following error when "add_config" was called:

File "C:\Users\dummy\AppData\Roaming\Python\Python312\site-packages\vunit\configuration.py", line 265, in add_config
    config = configs[DEFAULT_NAME].copy()
             ~~~~~~~^^^^^^^^^^^^^^
KeyError: None

What caused this error was not obvious at all and took some time to find what caused it. Spelling the architecture correctly fixed the issue. To remedy this, the shown error could be ignored, and continue with the compilation of all design and testbench files, which would highlight the misspelling.

It is possible that different kinds of errors in the testbench file also can cause this, and not just a misspelling of the entity in the architecture declaration.

@LarsAsplund
Copy link
Collaborator

Can you provide an MRE. I can't seem to reproduce this so maybe I misunderstood your code.

@sigmuha
Copy link
Author

sigmuha commented Jun 24, 2024

Sorry for the late reply.

vunit_issue.tar.gz contains two files, run.py and test.vhd.

Doing python run.py the same error as written above is reproduced. This happens, because a generic is attempted to be added, when no architecture for the testbench in test.vhd exists. In this case the architecture is misspelled. The user is not notified of this error.

LarsAsplund added a commit that referenced this issue Jun 24, 2024
LarsAsplund added a commit that referenced this issue Jun 24, 2024
@LarsAsplund
Copy link
Collaborator

This should be fixed now.

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