Yes, the Quartus II software (versions 2.1 and higher) supports the translate_on
and translate_off
compiler directives.
You can enter synthesis directives (also called pragmas or attributes) into Verilog HDL or VHDL code as comments. These directives are not commands that are included in the language definition, but the synthesis tool reads the commands to drive the synthesis process in some way.
The translate_on
and translate_off
directives tell the Quartus II software (or a third-party synthesis tool) not to compile a particular part of the design file. This is useful if a section of the code is only intended for simulation and not for synthesis. These synthesis-specific directives will be read and processed during synthesis but read as comments and ignored by a third-party simulation tool. The translate_off
directive indicates the beginning of a section that should be ignored during synthesis, and the translate_on
directive indicates that synthesis should resume at that point.
The Quartus II software supports the following different translate compiler directives:
Verilog HDL:
// synthesis translate_off // synthesis translate_on
or
/* synthesis translate_off */ /* synthesis translate_on */
VHDL:
-- synthesis translate_off -- synthesis translate_on
In addition to the synthesis
keyword as shown above, the following keywords are supported in both Verilog HDL and VHDL for compatibility with other synthesis tools:
pragma synopsys exemplar
Quartus II software versions older than 2.1 did not support compiler directives. You will see different Quartus II behavior if designs compiled in earlier versions of the software included these directives. You may need to change your code now that the options are honored by the software since previous versions of the Quartus II Compiler treated the options as just comments.
A common case where you might see differences from previous Quartus II versions is when you have a MegaWizard®-generated VHDL or Verilog HDL megafunction and have added translate_off
and translate_on
pragmas to hide the internal details from your third-party synthesis tool. These details are now hidden from the Quartus II software as well, and the megafunctions will not be implemented when you compile using version 2.1 or above of the Quartus II software.
For more information on synthesis directives, refer to the Quartus II Integrated Synthesis chapter in volume 1 of the Quartus II Handbook.