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

Comment after macro with arguments breaking next line parsing #4020

Open
FlyGoat opened this issue Dec 8, 2024 · 0 comments
Open

Comment after macro with arguments breaking next line parsing #4020

FlyGoat opened this issue Dec 8, 2024 · 0 comments

Comments

@FlyGoat
Copy link

FlyGoat commented Dec 8, 2024

Hi all,

I found a very wired behaviour in preprocessor:

case1.sv

`define FOO(n)   n // comment
`define BAR     10'h03E

module top();
  wire  [9:0] a;
  assign a = `BAR;
endmodule

With surelog surelog -nobuiltin -nocache -writeppfile /dev/stdout case1.sv:

[INF:CM0023] Creating log file "/***/slpp_all/surelog.log".
[ERR:PP0102] /***/case1.sv:8:14: Unknown macro "BAR".






module top();
  wire  [9:0] a;
  assign a = SURELOG_MACRO_NOT_DEFINED:BAR!!! ;
endmodule


[  FATAL] : 0
[ SYNTAX] : 0
[  ERROR] : 1
[WARNING] : 0
[   NOTE] : 0

Verilator verilator -E ./case1.sv :

`line 1 "case1.sv" 1
 
 

`line 4 "case1.sv" 0
module top();
  wire  [9:0] a;
  assign a = 10'h03E;
endmodule


`line 10 "case1.sv" 0

For context:

surelog --version
VERSION: 1.84
BUILT  : Dec  8 2024

Any idea what's going on here?

Thanks!

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

1 participant