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

Parsing problem in 4.4.0? #725

Closed
mschiller302 opened this issue Jul 26, 2021 · 4 comments
Closed

Parsing problem in 4.4.0? #725

mschiller302 opened this issue Jul 26, 2021 · 4 comments
Labels

Comments

@mschiller302
Copy link

mschiller302 commented Jul 26, 2021

I have two source files that represent two versions of a block:
vita_49_2_sink_buffer_output_logic_read_2_0.vhd
vita_49_2_sink_buffer_output_logic_read_1_0.vhd

As the name suggests they represent two versions of the same block in my vunit project.

I get the following warning:

WARNING - /...../vita_49_2_sink_buffer_output_logic_read_1_0.vhd: context 'checking' previously defined in /...../vita_49_2_sink_buffer_output_logic_read_2_0.vhd

The offending lines of code appear to be in these generate sections (I can't attach the full VHDL file so a snipit will have to do)

On the right is the original version which appears verbatim in both 2_0 and 1_0 of this block. But if I make the changes indicated on the left in the 2.0 version, the warning goes away
Image Pasted at 2021-7-26 09-32

This appears to be a parsing bug.

@LarsAsplund
Copy link
Collaborator

This is our simple regex-based parser that picks up the report string

Context Checking is

as the beginning of a context statement. It is not a proper parser that understands that this is part of a string. You can make changes to how you formulate the string or simply ignore the warning. We may change to a proper parser in the future but we're hoping for some of the emerging open source parser to do the work for us rather than we spending time on that.

@mschiller302
Copy link
Author

Figured that might be root cause.

@eine
Copy link
Collaborator

eine commented Jul 29, 2021

@mschiller302 it would be interesting if you dropped your sources into pyVHDLModel (https://github.com/vhdl/pyVHDLModel#list-all-entities-with-generics-and-ports) for testing. That is a VHDL language model which uses GHDL for parsing and analysing the sources. There is a GUI proof of concept in https://umarcor.github.io/osvb/apis/project.html#open-source-vhdl-design-explorer-osvde.

pyVHDLModel is a possible replacement for VUnit's parser. However, since it needs GHDL at the moment, it is unlikely to be used as the single and default solution. In the future, pyVHDLParser might be used instead of pyGHDL.dom.

@eine eine added the Parsing label Oct 26, 2021
@LarsAsplund
Copy link
Collaborator

see #1080

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

No branches or pull requests

3 participants