发新话题
打印

VHDL 中的注释

VHDL 中的注释

发现VHDL 中的注释对于下面两个语句怎么无效' n/ \. h6 @( J  @( ^8 ^
-- synthesis translate_off
* T+ x! ^8 `& X4 s-- synthesis translate_on
+ e8 h  n6 K; q% |6 R. ?% f- c就是上面的语句必须成对出现,否则提示莫名其妙的错误7 E$ M, P0 B0 M1 c* l% W
ERROR:HDLParsers:3524 - "../bps_ram.vhd" Line 35. Unexpected end of line.( q" S8 W) T8 e. l6 `5 l
WARNING:HDLParsers:3471 - File "../bps_ram.vhd" ended without turning synthesis meta comment on. It will be reset to be synthesis on for next vhdl file (if any).
. R, ^6 c, U) U0 m; H甚至不加注释,直接使用synthesis translate_on也会由这个问题
做永远的初学者,欢迎大家指点

TOP

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”.
做永远的初学者,欢迎大家指点

TOP

回复 2# 的帖子

上面的两个语句是综合的约束语句,必须成对出现,和别的注释不一样,这个会被综合器使用的。
承接FPGA设计项目

TOP

回复 3# 的帖子

恩 ,就是,我在 2# 的帖就是回答自己1#的问题 ,自问自答,不要见怪
做永远的初学者,欢迎大家指点

TOP

发新话题