http://www.actel.com/kb/article.aspx?id=TT1002

Logic Replication vs. Preserve Attributes in Synplicity

In general, Synplicity's synthesis tool, Synplify, will try to replicate logic rather than add buffers to stay within the stated synthesis constraints. However, this feature is "turned off" if the logic in question contains syn_keep or syn_preserve attributes (these are two Synplify attributes that allow you to preserve a net or preserve a register - examples are shown below).

In other words, if you use syn_keep or syn_preserve attributes, you may slow down your design since buffers added in series with your logic will reduce your circuit's performance.

Examples of syn_keep and syn_preserve:

attribute syn_preserve of MYSIGNALNAME: signal is true;

Synplicity directive to preserve a signal and the register that generated it

attribute syn_keep of MYSIGNALNAME: signal is true;

Synplicity directive to preserve a signal

http://www.cnblogs.com/wobeiwangle/p/5755612.html

使用Synplify综合时保留logic

在使用Synplify综合时,此工具会自动优化我的设计。

当然此功能有好有坏,最近有个项目需要使用Chipscope观察内部信号,打开inserter就懵了,信号列表中我的设计有的是名字被改了,有的是干脆给优化没了。

网上当然也有人提出这个问题, 例如 http://www.xilinx.com/support/answers/5249.html 就提供了一个 /* synthesis syn_keep = 1 */ 的语法来保留自己的设计。

随后又以 /* synthesis syn_keep = 1 */ 为关键词搜索了一下,又发现了其他的新内容,随即记录一下。

 

在 Synopsys FPGA Synthesis Attribute Reference Manual 中提到了三个语法: syn_keep , syn_preserve, syn_noprune 并对三种语法做出了比较。

 

syn_keep 只适用于net和 combinational logic,此语法可以在综合过程中保留wire,且不对此wire做任何的优化。此语法也可用于register,当用于register时,register可以被保留且不会变成macro
syn_preserve 保证register不会被优化
syn_noprune 保证一个没输出的blackbox(此blackbox 的输出没有驱动任何logic)不被优化

 

然而看了此表还是很模糊,再看了一下Synplify Pro for Microsemi Edition User Guide文档中 Preserving Objects from Being Optimized Away 部分则会有更深入的解释。

 

To Preserve Attach Result
Nets 使用syn_keep语法。适用于verilog中的wire或reg,或者VHDL中的signal 在仿真,综合或者P&R中保留net
Net for probing 使用syn_probe语法。用于verilog中的wire或者reg,或者VHDL中的signal 保留内部的net来用于观察
Shared registers 使用syn_keep语法。适用于shared register的输入wire或者signal 保留重复的驱动cell

sequential

component

使用syn_preserve语法。适用于verilog中的reg或者module,或者VHDL中的signal或architecture 保留固定值驱动的register
FSM 使用syn_preserve语法。适用于verilog中的reg或module,或者VHDL中的signal 保留state register有值的输出端口或者内部信号

instantiated

components

使用syn_noprune语法。适用于verilog中的module或者component,或者VHDL的architecture或者instance 即使instance有未使用的端口也可以保留下来

 

由此可以总结一下:

syn_keep最常用,可以用于wire,reg和shared register两种情况;

syn_probe处于观察的目的可以使用于wire或者reg (ChipScope观察信号的话使用此语法应该足够了);

syn_preseve使用于固定值驱动(constant-driven)的register或者状态机register中;

而syn_noprune使用于例化的模块(instance),即使例化模块有未使用的端口,也可以让模块保留下来。

posted on 2016-12-24 13:21  e_shannon  阅读(1157)  评论(0编辑  收藏  举报