System verilog 产生相关数的UVM序列

System verilog 产生相关数的UVM序列,system-verilog,verification,uvm,System Verilog,Verification,Uvm,在UVM测试中,我声明并启动了序列,但是具有相同参数的独立序列的输出在某种程度上是“相关的”(参见底部的示例),所以当我进行交叉覆盖时,我只覆盖了12.5%的情况,这是什么原因造成的?如何使两个序列的输出独立且随机 //declare ve_master_sequence#( 8,`num_inputs) x_agent_sequence_inst; ve_master_sequence#( 8,`num_inputs) y_agent_sequence_inst; //build_phase

在UVM测试中,我声明并启动了序列,但是具有相同参数的独立序列的输出在某种程度上是“相关的”(参见底部的示例),所以当我进行交叉覆盖时,我只覆盖了12.5%的情况,这是什么原因造成的?如何使两个序列的输出独立且随机

//declare
ve_master_sequence#( 8,`num_inputs) x_agent_sequence_inst;
ve_master_sequence#( 8,`num_inputs) y_agent_sequence_inst;
//build_phase
x_agent_sequence_inst = ve_master_sequence#( 8,`num_inputs)::type_id::create("x_seq");
y_agent_sequence_inst = ve_master_sequence#( 8,`num_inputs)::type_id::create("y_seq");
//run_phase
x_agent_sequence_inst.start(multadd_env_inst.ve_x_agent_inst.sequencer);
y_agent_sequence_inst.start(multadd_env_inst.ve_y_agent_inst.sequencer);
该环境包含4个主代理、两个32位、两个8位。在所有代理上运行相同的参数化序列

// within the sequence
virtual task body();
  `uvm_info("ve_master_sequence", $sformatf("begin body()"), UVM_MEDIUM);
    for(int i=0; i<length; i++) begin
    req = ve_seq_item#(data_width)::type_id::create("req");
    start_item(req);

  while(!req.randomize() with { 
     data <= (2**data_width)-1;
     delay  dist { [0:1] := 2, [2:6] := 1};  
     });

    finish_item(req);
    get_response(req);
    end
    #1000;
endtask

etc.

显然,UVM使用其父随机数生成器和序列为序列创建新的RNG。这是给好


尝试更改序列的名称,使其更为唯一。我假设更长的唯一字符串提供更高程度的随机化

sequence类中有一个创建序列项的循环。解释是(如上所述),UVM使用的类层次结构创建随机种子,这提供了良好的随机稳定性

for(int i=0; i<1000; i++) begin
     //this caused the error
     req = ve_seq_item#(data_width)::type_id::create("req");

     //this fixed it
     req = ve_seq_item#(data_width)::type_id::create($sformatf("req_%1d", i));
     //randomizing the sequence item with the loop variable

for(int i=0;i问题是什么?请澄清。ve_seq_item类中是否有任何约束?请尝试将
while(!req.randomize()…
if(reg.randomize()…)else`uvm_error(…)
切换。这将报告任何错误,而不是陷入while循环中。如果change没有报告任何错误,但这可能是一个线索,如果我更改序列的变量名,序列输出的数字之间的关系会更改,感谢注释seq_item classHmm中没有约束。您的工具执行随机化的方式可能有点奇怪。可能是伪随机数最大化不够随意,并导致关系。听起来很奇怪,但更改变量名称可能会以某种方式更改随机化的条件,从而更改关系。您正在使用什么工具?您正在运行什么UVM版本?请确保use_UVM_Seaking(UVM_对象的一部分)变量设置为1。
for(int i=0; i<1000; i++) begin
     //this caused the error
     req = ve_seq_item#(data_width)::type_id::create("req");

     //this fixed it
     req = ve_seq_item#(data_width)::type_id::create($sformatf("req_%1d", i));
     //randomizing the sequence item with the loop variable