微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 嵌入式设计讨论 > FPGA,CPLD和ASIC > OVM xbus例子里的不寻常的systemverilog语法问题讨教一下!

OVM xbus例子里的不寻常的systemverilog语法问题讨教一下!

时间:10-02 整理:3721RD 点击:
我学习一个代码,遇到这么几个代码搞不懂它的语法意思!
第一个:
$cast(tmp_slave_monitor, lookup({slave_name, ".monitor"}));
这里懂得$cast的基本意思,可是来个lookup函数就不明白了!lookup函数里还是个{}.
第二个:
void'(this.begin_tr(trans_collected));
这行代码就搞不明白啥意思了!
上面两行代码均来自OVM的XBUS的例子里!

I hadn't learn OVM before, but I'm a little familiar with SystemVerilog.
So sharing with you, something which might wrong.
1. lookup should be a function declared preceding. {} used for concatenation, for example, say slave_name is "slave", then {slave_name,".monitor"} should be string "slave.monitor". Then lookup("slave.monitor") would return the type of the slave.monitor. In addition, the system function $cast convert the type of tmp_slave_monitor to type of slave.monitor.
2. void'() used in scenario that wanna  call a function but not use the return value.

小编这个例子跑通了吗?我也在学习OVM,在QuestaSim中联系XBUS的例子,编译等通过了,但是不能运行,小编知道是什么问题吗?我用的QuestaSim 6.3c,OVM2.0.1,是不是QuestaSim的版本太低了啊?有些功能不支持?不知道如何解决了,OVM自带的例子应该没有错啊?
1# system100

很好 谢谢了

我也不懂。

谢谢了

学习,刚好也看到这里

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top