vunit icon indicating copy to clipboard operation
vunit copied to clipboard

parsing/verilog/parser.py bug

Open asicnet opened this issue 2 years ago • 1 comments

I get always errors with blocklabel !!

def _parse_block_label(stream):
   """
   Parse a optional block label after begin|end keyword
   """
try:
    token = stream.peek()

    if token.kind != COLON:
        # Is not block label
        return

    stream.pop()   # The COLON is removed
    stream.expect(IDENTIFIER)  # The next token is the label name and is never an indetifier

except EOFException:
    return

bugfix:

The label name is not an IDENTIFIER - get always an error So remove:

 stream.expect(IDENTIFIER)

and add

 stream.pop() #remove the label 

asicnet avatar Feb 27 '23 12:02 asicnet

I agree.

For this code, where label1 is an identifier

for (i=0; i < width; i=i+1) begin:label1


end

We are currently seeing this error:

  File "<>/vunit/parsing/tokenizer.py", line 163, in expect
    raise LocationException.error(f"Expected {expected!s} got {token.kind!s}", token.location)
vunit.parsing.tokenizer.LocationException

krishnan-gopal avatar Feb 27 '23 14:02 krishnan-gopal