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

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

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
查看: 6188|回复: 5

[求助] UVM中如何精准控制仿真结束?

[复制链接]
发表于 2017-11-6 17:55:53 | 显示全部楼层 |阅读模式

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

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

x
验证新人,刚开始学习。请问各位前辈,如何控制UVM精准的结束仿真?

《UVM实践》中也说了:在Sequence中raise和drop objection,但如果立即drop,DUT有延迟的话会收不到最后一笔包。
所以,方法1:在Sequence的body中,发完以后,等一定延迟再drop。
方法2:对main_phase的set_drain_time进行配置,为非0。

——两者本质都是延迟一段固定时间。

然而,长度随机的包,经过DUT的延迟,结束的时间是不同的。

如何精准的在scoreboard比较结束后,就结束仿真?
(比如:为了测定转发延迟。但如果都打印信息,仿真速度又会变慢)

如果在比较任务的while(1)外raise、drop,则仿真不会结束。
如果将比较任务改成for循环发包数,到0结束。但如果丢包了,永远减不到0,也可能阻塞不结束。

求教各位前辈、大师~
发表于 2017-11-7 09:23:59 | 显示全部楼层
我也有這方面的因扰.
我是用你說的第一個方法, 在 body 中延迟一段時間再drop. 這段時間是略估會造成延迟的最大值. 所以會浪費一些 simulation 時間.

我也想知道還有没有其它更好的方法.
发表于 2017-11-7 15:55:01 | 显示全部楼层
可以用进程间通信的方法呀,接收包结束了给环境一个标志或者触发一个event,来控制仿真结束,这个是最好的机制,延时是下等策略。
发表于 2017-11-7 19:00:01 | 显示全部楼层
回复 1# liheng369

Hi, 参考Mentor 的uvm_cookbook 的描述:

phase_ready_to_end
For sequences, tests, and many complete testbenches, the raising and dropping of phase objections during the normal
lifetime of the phase, as described above, is quite sufficient.
However, sometimes a component does not want to actively raise and drop objections during the normal lifetime of a
phase, but does want to delay the transition from one phase to the next. This is very often the case in transactors, which
for  performance  reasons  cannot  raise  and  drop  an  objection  for  every  transaction,  and  is  quite  often  the  case  for
end-to-end scoreboards.
To delay the end of phase after all other components have agreed that the phase should end, that component should raise
objections in the phase_ready_to_end method. It is then responsible for dropping those objections, either in the main
body of the component or in a task fork / join none'd from the phase_ready_end_method.
An example of using fork / join_none is shown below :





  1. function void my_component::phase_ready_to_end( uvm_phase phase );
  2.   if( !is_ok_to_end() ) begin
  3.     phase.raise_objection( this , "not yet ready to end phase" );
  4.     fork begin
  5.       wait_for_ok_end();
  6.       phase.drop_objection( this , "ok to end phase" );
  7.     end
  8.     join_none
  9.   end
  10. endfunction : phase_ready_to_end


复制代码


Ready_to_end_phase  without  fork  /  join_none  is  used  in  the  Object-to-All  and  Object-to-One  phasing  policies  often
used in components such as transactors and scoreboards.
发表于 2017-11-13 22:05:25 | 显示全部楼层
13.1.4.3.2 phase_ready_to_end
virtual function void phase_ready_to_end(
uvm_phase phase
)
Invoked when all objections to ending the given phase and all sibling phases have been dropped, thus
indicating that phase is ready to begin a clean exit. Sibling phases are phases who share any adjacent
successor nodes
摘自 1800.2-2017;从这里 看出 依然 是需要 在 transactor, scoreboard中 分别 raise drop,对于 process控制 并不能起 决定性作用 ;我 估摸着 楼主 是希望找到 关于 如何 有效 的 process control 的答案 吧;在 1800-2012 9.6 process control 中 有详细的 解决方案;
发表于 2017-11-21 18:31:35 | 显示全部楼层
等收包结束。有需要的话,也可以监测设计内部信号。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

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

×

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

GMT+8, 2024-4-28 13:56 , Processed in 1.126667 second(s), 7 queries , Gzip On, Redis On.

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