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

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

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
查看: 3059|回复: 2

[求助] vcs initreg

[复制链接]
发表于 2022-3-4 19:29:22 | 显示全部楼层 |阅读模式

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

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

x
vcs 使用initreg 初始化,reg初始化为0  但是mem 还是XS。 请问这个怎么解决
发表于 2022-3-5 17:56:02 | 显示全部楼层
Initializing Memories and Regs
VCS has compile-time options for initializing all bits of memories and regs to the 0, 1, X, or Z value:
+vcs+initmem+0|1|x|z
Initializes all bits of all memories in the design.
+vcs+initreg+0|1|x|z
Initializes all bits of all regs in the design.
The +vcs+initmem option initializes regular memories and multi-dimensional arrays of the reg data type with more than two dimensions, for example:
reg [7:0] mem [7:0][15:0];
The +vcs+initmem option does not initialize multi-dimensional arrays of any other data type.
The +vcs+initreg option does not initialize registers (variables) other than the reg data type.
When you use these options, to prevent race conditions, you should avoid the following :
•Assigning initial values to a regs in their declaration when the value assigned is not the same as the value specified with the +vcs+initreg option, for example:
reg [7:0] r1 8’b01010101;
•Assigning values to regs or memory elements at simulation time 0 when the value assigned is not the same as the value specified with the +vcs+initreg or +vcs+initmem option, for example:
initial
begin
mem[1][1]=8’b00000001;
.
.
.
 楼主| 发表于 2022-3-7 16:17:04 | 显示全部楼层


ashish 发表于 2022-3-5 17:56
Initializing Memories and Regs
VCS has compile-time options for initializing all bits of memories an ...


加assign这个不太现实,因为分布的很散且很多,有什么好的方法吗
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

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

X

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

GMT+8, 2025-6-21 13:49 , Processed in 0.014498 second(s), 8 queries , Gzip On, MemCached On.

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