在用signaltap调试FPGA程序的时候,通常为了观察内部一些信号,可以加编译属性比如 keep preserve noprune

那么他们的区别是什么呢?

我们可以从Quartus的说明中找到答案

 noprune keep preserve 区别

preserve的解释是:防止quartus优化掉寄存器,其典型应用是将其放在module声名前,这样这个module内部的所有reg类型变量都会被保留。

keep的解释如下:

// Prevents Quartus II from minimizing or removing a particular

// signal net during combinational logic optimization.

// Apply the attribute to a net or variable declaration.


(* keep *) wire <net_name>;

(* keep *) reg <variable_name>;

防止quartus优化掉组合逻辑中的特殊变量。

noprune的解释

// Prevents Quartus II from removing or optimizing a fanout free register.

// Apply the attribute to the variable declaration for an object that infers

// a register.


(* noprune *)  <variable_declaration>;

防止quartus优化掉没有扇出的寄存器。

 

总结如下:如果你只想quartus不优化掉某个特殊变量可以使用keep(wire类型),noprune(reg类型),如果是想让module里面所有的reg类型都不要被优化,那么建议使用preserve! 

 

 

转载于:https://www.cnblogs.com/fpga/archive/2009/12/24/1631216.html

相关文章:

  • 2021-06-23
  • 2021-12-24
  • 2021-11-24
  • 2022-12-23
  • 2022-12-23
  • 2021-09-30
  • 2021-09-11
  • 2021-10-03
猜你喜欢
  • 2021-11-02
  • 2021-06-07
  • 2021-10-15
  • 2021-12-21
相关资源
相似解决方案