Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
16597 Discussions

Who wins VERILOG_MACRO.qsf or `define.v?

Altera_Forum
Honored Contributor II
2,189 Views

I have a design which `includes a header file which has `defines for default mode, say:`define ASIC_VERSION 32'h00000001 

 

I have an "override" in my .qsf to specify the FPGA build, say:set_global_assignment -name VERILOG_MACRO "ASIC_REVISION=32'h12345678" 

 

 

However, when I map I get this warning:Warning (10886): Verilog HDL macro warning at ...defines.v(line): overriding existing definition for macro "ASIC_VERSION", 

 

The `include file is overriding the .qsf! This is precisely the opposite of my intention. Is there any modifier to make sure that the .qsf file wins? 

 

Thanks, Tom
0 Kudos
8 Replies
Altera_Forum
Honored Contributor II
881 Views

Turns out it is load order - just like Verilog. You have to place your VERILOG_MACROs after your VERILOG_FILEs for it to win. ~Tom

0 Kudos
Altera_Forum
Honored Contributor II
881 Views

I declared victory too soon - seems to fail randomly, irregardless of load-order.

0 Kudos
Altera_Forum
Honored Contributor II
881 Views

How about: 

 

`ifndef ASIC_VERSION `define ASIC_VERSION 32'h00000001 `endif 

 

will define ASIC_VERSION only if it is not currently defined (by the .qsf file) 

 

( replaced `ifdef ... `else with `ifndef )
0 Kudos
Altera_Forum
Honored Contributor II
881 Views

Tried that - it did not work. I tried both load orders - fails same.

0 Kudos
Altera_Forum
Honored Contributor II
881 Views

Did you modify the definition in the include file to surround it with the `ifndef ... `endif lines? 

 

What is the failure you are seeing?
0 Kudos
Altera_Forum
Honored Contributor II
881 Views

I did indeed try the ifndef guard around the Verilog `defines - fails same regardless of load order. 

 

Failure is the Warning (10886) cited above and the fact that I want the .qsf VERILOG_MACRO definitions to win - not the Verilog.  

 

Strangely, in the .flow.rpt it shows the definitions I want. I get the warnings and then in the actual implementation I see that Verilog won out.
0 Kudos
Altera_Forum
Honored Contributor II
881 Views

Update: --verilog_macro= on quartus_map command-line fails same.

0 Kudos
Altera_Forum
Honored Contributor II
881 Views
0 Kudos
Reply