Nov 7

Verilog 的 parameter 和 define 不指定

RickySu , 18:30 , 技术经验 , 评论(2) , 引用(0) , 阅读(3016) , Via 本站原创 | |
整理来源:http://www.edacn.net/index.php/action_viewthread_tid_64616.html

1、语法
声明:
parameter xx = yy;
`define XX YY

使用:
xx
`XX

2、作用域
parameter 作用于声明的那个文件;`define 从编译器读到这条指令开始到编译结束都有效,或者遇到`undef命令使之失效。

如果想让parameter或`define作用于整个项目,可以将如下声明写于单独文件,并用`include让每个文件都包含声明文件:
`ifndef xx
 `define xx yy // or parameter xx = yy;
`endif

`define也可以写在编译器最先编译的文件顶部。通常编译器都可以定义编译顺序,或者从最底层模块开始编译。因此写在最底层就可以了。

3、作用
parameter可以用作例化时的参数传递。具体方法参见《Verilog例化时的参数传递》一文
Tags:
COSPLAY Email Homepage
2010/08/05 15:16
That theme about this good topic seems to be good enough! Thence people do not have to compose the thesis or just doctoral thesis by their efforts, they will get your assistance
lily
2008/09/02 16:21
parameter是局部变量  ,是不能用include方式来包含的。
分页: 1/1 第一页 1 最后页
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]