xzy610030

一起探讨,一起进步,一起分享!

Quartus II 中如何保持信号不被综合(转载)

0
阅读(3111)

在一些应用中,有些特定的信号我们需要保留,用于进行采集检测,而综合器会自动优化把它综合掉,那么,应该怎样告诉综合器,不让它优化掉我们需要保留的信号呢?

对这种情况的处理是增加约束,共有2种情况:


1、需要保留的信号是引线
Verilog HDL—定义的时候在后面增加/* synthesis keep */。
例如:wire keep_wire /* synthesis keep */;

 

2、需要保留是的寄存器

跟reg相关的synthesis attribute,共有两种,分别是/*synthesis noprune*/和/*synthesis preserve*/,两者的差别如下:

/*synthesis noprune*/ 避免 Quartus II 优化掉没output的reg。

/*synthesis preserve*/避免 Quartus II 將reg优化为常数,或者合并重复的reg。

定义的时候在后面增加相关的约束语句。
例如:reg reg1 /* synthesis noprune*/;或者 reg reg1 /* synthesis preserve */;

將/*synthesis noprune*/等synthesis attribute 语句放在module后面,这样整个module的reg将不被最佳化,从而不用再一一寄存器指定。
 

 

注意:以上所提到的synthesis attribute必须写在结束分号前面,写在分号后面只相当于注释:

正确:reg reg1 /* synthesis preserve */;

错误:reg reg1 ;/* synthesis preserve */


转自:

http://www.eefocus.com/xjx163/blog/15-08/317933_e4a83.html