在线咨询
eetop公众号 创芯大讲堂 创芯人才网
切换到宽版

EETOP 创芯网论坛 (原名:电子顶级开发网)

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
查看: 2365|回复: 6

[求助] 求助一个verilog语法问题

[复制链接]
发表于 2011-10-13 14:07:53 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

x
assign last_master_ns = rst
                            ? ONE[0+:WIDTH]
                            : upd_last_master
                                ? current_master
                                : last_master_r;
这个0+是什么意思呢?
发表于 2011-10-13 14:45:26 | 显示全部楼层
没见过,你确定不是sv?
 楼主| 发表于 2011-10-13 15:20:07 | 显示全部楼层
回复 2# chlor


    我项目V代码里的啊,xilinx官方提供的参考设计
发表于 2011-10-13 15:37:41 | 显示全部楼层
ONE[0+:WIDTH]
是不是等同于ONE[0:0+WIDTH]
这里的要是不是0+,就还蛮有意义的吧。。。比如,1+,2+之类的、、、
不过我不知道啊。。瞎猜的。。哈哈~
期待高手解答啊、、
发表于 2011-10-13 16:14:40 | 显示全部楼层
查了一下,verilog-2001支持这种语法,IEEE standard上的:

big_vect[lsb_base_expr +: width_expr]
little_vect[msb_base_expr +: width_expr]
big_vect[msb_base_expr -: width_expr]
little_vect[lsb_base_expr -: width_expr]
The width_expr shall be a constant expression. It also shall not be affected by run-time parameter assignments.
The lsb_base_expr and msb_base_expr can vary at run-time. The first two examples select
bits starting at the base and ascending the bit range. The number of bits selected is equal to the width expression.
The second two examples select bits starting at the base and descending the bit range. Part-selects that
address a range of bits that are completely out of the address bounds of the net, reg, integer, or time,
or when the part-select is x or z, shall yield the value x when read, and shall have no effect on the data
stored when written. Part-selects that are partially out of range shall when read return x for the bits that are
out of range, and when written shall only affect the bits that are in range.
 楼主| 发表于 2011-10-13 16:21:53 | 显示全部楼层
回复 5# chlor


    非常感谢啊,很细心啊!
发表于 2011-10-13 16:29:03 | 显示全部楼层
没用过。。。。。。。。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐 上一条 /2 下一条

X

小黑屋| 手机版| 关于我们| 联系我们| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2025-6-17 07:47 , Processed in 0.019505 second(s), 7 queries , Gzip On, MemCached On.

eetop公众号 创芯大讲堂 创芯人才网
快速回复 返回顶部 返回列表