cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Adventurer
Adventurer
453 Views
Registered: ‎03-31-2017

Predefined constants/macros in xvlog?

Jump to solution

Does anyone happen to know what the macro that 'identifies' xvlog is, if there is one? In other words, I want to write code that looks like

`ifdef __VIVADO__
...do something specific to xvlog/xsim
`else
...do something specific to other sims
`endif

I've tried lots of variations on the __VIVADO__ string above, with no luck.

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Moderator
Moderator
430 Views
Registered: ‎05-31-2017

Re: Predefined constants/macros in xvlog?

Jump to solution

Hi @eml ,

XILINX_SIMULATOR is the XSIM predefined Verilog macro as shown in the below snippet

XSIM_PREDEFINED.JPG

Please check page 165 of UG900 regarding the same.

View solution in original post

0 Kudos
4 Replies
Highlighted
Moderator
Moderator
443 Views
Registered: ‎05-31-2017

Re: Predefined constants/macros in xvlog?

Jump to solution

Hi @eml ,

You can use xvlog -d option to specify the macro definition. Please check page 156 of UG900 regarding the same.

0 Kudos
Highlighted
Adventurer
Adventurer
439 Views
Registered: ‎03-31-2017

Re: Predefined constants/macros in xvlog?

Jump to solution

Hi Shameera - that's for user-defined macros, rather than built-in xvlog macros. It's common for Verilog vendors to have their own built-in (generally undocumented) macros. If I wanted to know that I was running on ModelSim, for example, I would test for 'MODEL_TECH'.

0 Kudos
Highlighted
Moderator
Moderator
431 Views
Registered: ‎05-31-2017

Re: Predefined constants/macros in xvlog?

Jump to solution

Hi @eml ,

XILINX_SIMULATOR is the XSIM predefined Verilog macro as shown in the below snippet

XSIM_PREDEFINED.JPG

Please check page 165 of UG900 regarding the same.

View solution in original post

0 Kudos
Highlighted
Adventurer
Adventurer
414 Views
Registered: ‎03-31-2017

Re: Predefined constants/macros in xvlog?

Jump to solution

Great - thanks.

0 Kudos