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

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

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
查看: 2828|回复: 4

[求助] 在new构造函数括号里的parent 参数,专门指定parent= NULL 和不指定 结果有什么不同?

[复制链接]
发表于 2016-3-21 08:47:18 | 显示全部楼层 |阅读模式

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

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

x
请教个简单的new funciton parameter setting 问题
~~~~~~~~~~~~~
class my_component extends uvm_component;
function new(string name = "my_component", uvm_component parent = null);
super.new(name, parent);
endfunction
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class my_component extends uvm_component;
function new(string name = "my_component", uvm_component parent );
super.new(name, parent);
endfunction

在括号里的parent 参数,专门指定parent NULL 和不指定 result 有什么不同?
发表于 2016-3-21 15:30:02 | 显示全部楼层
同求。。。。。
发表于 2016-4-1 21:20:40 | 显示全部楼层
同问~~~
发表于 2016-4-2 20:57:00 | 显示全部楼层
uvm_component parent = NULL 表示parent参数的缺省值为 NULL。
在my_compoment实例化时 可以直接 my_component comp = my_component(name);

否则 就需要显性指定参数值,如 my_component comp = my_component(name, NULL);
 楼主| 发表于 2017-1-19 10:31:38 | 显示全部楼层
谢谢,谢谢啊
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

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

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

GMT+8, 2024-4-27 21:56 , Processed in 0.023942 second(s), 8 queries , Gzip On, Redis On.

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