cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
ronagyl_adi
Observer
Observer
374 Views
Registered: ‎05-11-2018

[2020.1] Nested macros not expanded correctly

In Vivado 2020.1  nested macros are not expanded correctly like in previous releases did. 

e.g. 

 

`define SUFFIX(v) v``_suffix
`define NUMA a

module test;
  integer a_suffix = 1;
  integer b;
  initial begin
   b = `SUFFIX(`NUMA);
   $display("b is %d",b);
  end
endmodule

 

 

Steps to reproduce: 

See attached file to reproduce the ERROR.

xvlog -sv nested.sv

 

Compiler ERROR: 

INFO: [VRFC 10-2263] Analyzing SystemVerilog file "... nested.sv" into library work
INFO: [VRFC 10-311] analyzing module test
ERROR: [VRFC 10-3805] use of undefined macro 'NUMA_suffix' [.... nested.sv:15]
ERROR: [VRFC 10-4982] syntax error near ';' [.... /nested.sv:15]
ERROR: [VRFC 10-2865] module 'test' ignored due to previous errors [.... /nested.sv:7]

 

Any other industry standard simulator result is : "b is 1" so I guess the code is syntactically correct.

I have not tested it with 2020.2 

 

Thank you in advance,

Laszlo

0 Kudos
1 Reply
sakethb
Xilinx Employee
Xilinx Employee
349 Views
Registered: ‎09-05-2018

Hi @ronagyl_adi ,

Thank you for providing us with testcase.

The issue seems to be present from 2020.1, however I have filed a change request to fix the issue with nested macro.

Regards,

Saketh

-------------------------------------------------------------------------
Don't forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------

0 Kudos