【问题标题】:Effect of request randomization before and after start_item() callstart_item() 调用前后请求随机化的影响
【发布时间】:2021-07-11 10:41:48
【问题描述】:

我正在尝试使用驱动程序的 run_phase 中的信号量、fork-join 和 get()-put() 方法为简单的流水线模型实现 UVM 驱动程序。

只要我以特定方式对序列进行编码,驱动程序部分就可以正常工作。据我所知,body 任务的编码如下

  Code1:
pkt = packet::type_id::create("pkt");    // Factory create the sequence item  
for(int i=0;i<num_trans;i++)             // Repeat as required
  begin
    assert(pkt.randomize());             // Randomize the sequence item
    start_item(pkt);                     //Send the request to Driver. 
    finish_item(pkt);                    //Wait for the driver to finish the current item

上述风格,没有实现流水线,而且与第一个事务包对应的数据节拍丢失。在 start_item 之后调用随机化时,测试台按预期工作。

Code2:
pkt = packet::type_id::create("pkt");      
for(int i=0;i<num_trans;i++)
  begin
    
    start_item(pkt); 

     assert(pkt.randomize());       
    finish_item(pkt);

我想知道编码风格 1 和 2 有什么区别

【问题讨论】:

  • 只是一个小评论,重要的是不要将 assert() 放在这些随机调用周围。有时人们会在模拟过程中关闭断言。如果他们这样做,突然之间您的随机化将不会运行,并且没有人会知道随机化被禁用。相反,您应该执行“if(!pkt.randomize()) uvm_error”或类似的操作

标签: uvm pipelining


【解决方案1】:

这可能是因为在任务 start_item() 任务上我们正在等待以下内容。

sequencer.wait_for_grant(this, set_priority);

所以我们正在等待定序器授予序列,然后将采用 sequence_item,但如果您喜欢以下内容。

assert(pkt.randomize());  // Randomize the sequence item
start_item(pkt);          //Send the request to Driver. 

该随机化丢失,因为该 start_item 可能正在等待音序器空闲,直到那时我们丢失了随机化。

您可以进一步阅读以下文章,这可能会有所帮助https://verificationacademy.com/forums/uvm/startitem/finishitem-versus-uvmdo-macros

【讨论】:

    猜你喜欢
    • 2013-04-21
    • 1970-01-01
    • 1970-01-01
    • 2011-12-27
    • 1970-01-01
    • 1970-01-01
    • 2014-05-08
    • 2016-11-16
    相关资源
    最近更新 更多