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

Preprocessor issue higher case #773

Closed
treffnix1983 opened this issue Oct 27, 2021 · 4 comments
Closed

Preprocessor issue higher case #773

treffnix1983 opened this issue Oct 27, 2021 · 4 comments
Labels
Milestone

Comments

@treffnix1983
Copy link

I have tried the feature of adding line_num and file_name to a convenience procudure, like describes in the documentation

Documentation:

With earlier VHDL standard you can add the line_num and file_name parameters to the end of the parameter list for the convenience procedure

procedure my_convenience_procedure(

line_num : natural := 0;
file_name : string := "") is
begin

info("Some message", line_num => line_num, file_name => file_name);

end procedure my_convenience_procedure;
and then let the location preprocessor know about the added procedure

ui = VUnit.from_argv()
ui.enable_location_preprocessing(additional_subprograms=['my_convenience_procedure'])

BUG:

It was really frustatric sine it did not work. I could see that the preprocessor did some wired stuff. It added addtional ines to the code at wrong position.

PROCEDURE my_convenience_procedure (
	SIGNAL test : OUT STD_LOGIC;
	line_num    : NATURAL := 0;
	file_name   : STRING, line_num => 57, file_name => "Testbench.vhd") IS    ==>>> THIS LINE IS WRONG
begin
	test <= '1';
	info("Some message", line_num => line_num, file_name => file_name);
	test <= '0';
END PROCEDURE;

SOLUTION:

Then I tried to write PROCEDURE in lower case (actually my VHDL-formatter does this)
And suddenly everything works well.

To there is an issue with this preprocessor.

@umarcor
Copy link
Member

umarcor commented Oct 27, 2021

@treffnix1983, please wrap your VHDL snippets in code blocks, so it is easier to read:

```VHDL
-- Your VHDL code here
```
-- Your VHDL code here

@LarsAsplund
Copy link
Collaborator

That is a confirmed bug. I fixed it and will merge as soon as the tests pass.

@LarsAsplund
Copy link
Collaborator

@treffnix1983 The fix is on the master branch now. Please give it a try.

@eine eine added the Bug label Oct 27, 2021
@eine eine added this to the v4.7.0 milestone Oct 27, 2021
@treffnix1983
Copy link
Author

I did and it's working. Thank you for the quick response.

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

4 participants