TRANSLATE_OFF and TRANSLATE_ON 的作用
TRANSLATE_OFF and TRANSLATE_ON Applicable Elements
. r; K, w H, f; ~
7 I1 Q9 _ ]' m: t5 }TRANSLATE_OFF and TRANSLATE_ON can be applied locally only.# c8 I# K8 {9 Z- K `7 _. i
TRANSLATE_OFF and TRANSLATE_ON Description
' j. Y ^& _. U
( l- Y& q# f8 M( |, {TRANSLATE_OFF and TRANSLATE_ON are synthesis constraints. Use TRANSLATE_OFF and TRANSLATE_ON to instruct XST to ignore portions of your VHDL or Verilog code that are not relevant for synthesis—for example, simulation code. The TRANSLATE_OFF directive marks the beginning of the section to be ignored and the translate_on directive instructs XST to resume synthesis from that point." o4 b y! o b) j+ z' l
' {' N; e! O ]( C% _
Note: The constraints TRANSLATE_OFF and TRANSLATE_ON are also Synplicity and Synopsys constraints that are supported by XST in Verilog. Automatic conversion is also available in VHDL and Verilog.& j7 T9 X- g* j# F
/ ~" ?) y% u8 K0 n- _Note: translate_on/translate_off could be used with the following words:
* [4 T! V. C+ F0 |" x+ `4 p
# x, Z& N4 C5 t- k; q6 A * synthesis/ k+ C4 r" R# b& D7 {
* synopsys4 C0 M+ f6 u9 M
* pragma
# {; l5 v1 o }# n) Z0 C4 K! G9 @ E0 H0 ?- N; A3 }
TRANSLATE_OFF and TRANSLATE_ON Propagation Rules
- h$ S) W! I5 q& |8 b
6 l6 w6 X T- }2 x% G% l1 VInstructs synthesis tool to enable or disable portions of code.
# ^0 b2 S3 v3 z$ K2 @TRANSLATE_OFF and TRANSLATE_ON Syntax Examples
: T, w& ^# O( T- i8 D9 gSchematic
! |' p: o% }$ G |4 D$ _ G0 {
$ Z+ X; I4 B7 ]Not applicable.
9 ~- |3 r* _/ f( g; |; ~VHDL* G L2 ~- |' e4 ~
! j7 ~2 o. \/ l( d6 c9 `+ UIn your VHDL code, the directives should be written as follows:' ~' X6 S0 z( O) B! y. \# A7 Z- I( y
-- synthesis translate_off4 T: M' a6 U' v1 a* O5 i1 A
...code not synthesized...! S( w- {; R* b7 W6 m3 C
-- synthesis translate_on- J) Z" K& f$ v& |9 j; e n/ B
9 v" d0 D. b# HFor a detailed discussion of the basic VHDL syntax, see “VHDL”.: q$ s7 a4 h3 p7 w' t
Verilog
6 M3 t+ X* b: R! ?9 }
5 I: f L% u; m/ \The directives are available as VHDL or Verilog meta comments. The Verilog syntax differs from the standard meta comment syntax presented earlier in this chapter, as shown below.8 [# i% P' Y% i \
// synthesis translate_off
J5 Z6 x; V: n9 }# y...code not synthesized...
2 r$ {9 @2 B' Z/ U8 s) |; L9 D& ?// synthesis translate_on: X7 ~0 ]8 n4 S3 \3 c
8 Y+ f; N) s9 c* P
For a detailed discussion of the basic Verilog syntax, see“Verilog”.