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

 找回密码
 注册

手机号码,快捷登录

手机号码,快捷登录

搜帖子
查看: 4833|回复: 2

[求助] systemverilog 同一个function被多个地方同时调用

[复制链接]
发表于 2016-10-24 20:19:40 | 显示全部楼层 |阅读模式

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

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

×
我函数里面对队列进行了操作,然后函数被多个地方同时调用,这个队列应该如何处理?如何让调用这个函数的多个地方各自拥有一个队列?

当前这个队列被多个地方同时调用时混乱了。
发表于 2016-10-25 08:56:06 | 显示全部楼层
回复 1# cy_00521

我记得有个automatic的关键字,你试着让它声明下函数里的变量看看。
发表于 2016-10-30 22:06:54 | 显示全部楼层
回复 2# chensong0007


   是的:
Variables are static by default.


Unless declared in a dynamic context—within a class or an automatic task—all variables in SystemVerilog are static by default. Static variables are not really an unspecified behavior in System-Verilog but can be a source of unexpected behavior. A single copy exists for a static variable. It is created and initialized at the beginning of the simulation and is reused by all threads referencing that variable. A variable in a dynamic scope or explicitly declared as automatic is created and initialized every time a thread enters the scope in which the dynamic variable is declared.
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2025-5-24 13:37 , Processed in 0.110325 second(s), 6 queries , Gzip On, Redis On.

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