在使用SignalTAP II的过程中,我经常发现一些用于调试的逻辑(比如调试用的计数器)会被优化掉,不能出现在调试波形中。在Altera的一篇文档中,发现了以下关键信息: riple
In the logic synthesis stage, the Quartus II software may optimize away signals that you are trying to analyze with the SignalTap II Embedded Logic Analyzer. If this occurs, you will see a compilation error. You can force the Quartus II software to preserve these signals by adding the keep or preserve attribute in the source HDL to the signals you want to monitor.
The keep attribute is used for a wire or net node. For example:
In Verilog:
wire my_wire /* synthesis keep = 1 */:
In VHDL:
signal my_signal: bit;
attribute syn_keep : boolean;
attribute syn_keep of my_signal: signal is true;
The preserve attribute is used for a register. For example:
In Verilog:
reg my_reg /* synthesis preserve = 1 */:
In VHDL:
signal my_reg: stdlogic;
attribute preserve : boolean;
attribute preserve of my_signal: signal is true;
背景资料:Using SignalTap II Embedded Logic Analyzers in SOPC Builder Systems riple
ash_riple_768180695 2010-6-21 10:17
用户234413 2010-6-15 15:52
用户1278632 2010-2-6 09:29
ash_riple_768180695 2009-11-4 15:45
用户505573 2009-11-4 11:34
用户1166636 2008-4-18 10:18
用户1319511 2008-3-25 18:12
ash_riple_768180695 2008-1-17 09:02
是的。还有一点:注释一定要在分号前边。
用户128735 2008-1-16 21:08
呵呵,客气了。经常看你的博客,受益匪浅,不时冒个泡也算表示感谢了。另外也是把自己实践过的结果贴上来给其他兄弟参考。
关于这个我试了一下:
In Verilog:
wire my_wire /* synthesis keep = 1 */:
为什么末尾是冒号啊?我这样写编译通不过,改成分号就好了。
你贴的那个文件上也是这么写的,是不是Altera写错了?
ash_riple_768180695 2008-1-16 10:45
谢谢你的评论,我刚刚发现,对于一些没有驱动任何逻辑的reg或wire,仅仅采用编译指示语句是不行的,还是要连接到一个空端口才能被保留。希望对你有帮助。