0

我认为peek函数uvm_reg在 0 模拟时间内返回值。因为我需要这个功能,所以我实现了我所有的 HDL 后门访问路径。这是我在记分牌中使用的代码

while (state == DISABLE) begin
  uvm_reg_data_t val = 'hDEADBEEF;
  uvm_status_e status;
  `uvm_info(get_name(), "Start peek", UVM_LOW)

  my_reg_block.my_reg.peek(status, val);

  `uvm_info(get_name(), "End peek", UVM_LOW)

  assert (val == 'h0)

  @posedge(my_vif.clk); //Advance clock

end

我的意图是:在每个时钟周期,在零仿真时间,断言my_reg0 当state==DISABLE.

在模拟运行中,我注意到这很好,直到时间my_reg发生变化。此时,Start peek -> End peek 大约需要 10 个时钟周期。在这个时候,我的状态不再是 DISABLE 并且当然 val != 'h0. 为什么 peek 需要这么长时间才能返回?

我正在使用 Questasim 10.4a

4

1 回答 1

1

这可能需要一些时间,因为peek是 SystemVerilog 任务,而不是函数。

函数将在 0 模拟时间执行,但任务也可能有时间延迟。

这是它的定义。

virtual task peek(  output  uvm_status_e    status,     
output  uvm_reg_data_t  value,      
input   string  kind     =  "",
input   uvm_sequence_base   parent   =  null,
input   uvm_object  extension    =  null,
input   string  fname    =  "",
input   int     lineno   =  0   )
于 2016-11-29T08:32:08.410 回答