晓灰灰 发表于 2017-2-17 15:05:53

Quartus II 中如何保持信号不被综合

        在一些应用中,有些特定的信号我们需要保留,用于进行采集检测,而综合器会自动优化把它综合掉,那么,应该怎样告诉综合器,不让它优化掉我们需要保留的信号呢?
        对这种情况的处理是增加约束,共有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 */
页: [1]
查看完整版本: Quartus II 中如何保持信号不被综合