Macro Example Two - 2025.1 English - UG901

Vivado Design Suite User Guide: Synthesis (UG901)

Document ID
UG901
Release Date
2025-06-11
Version
2025.1 English
'ifdef MYVAR
module if_MYVAR_is_declared;
...
endmodule
'else
module if_MYVAR_is_not_declared;
...
endmodule
'endif
Note: When synthesis runs, Vivado automatically sets the SYNTHESIS macro. So, when using ‘ifdef SYNTHESIS, it is triggered during the synthesis run.