ここに私の簡単なコードセグメントがあります
class sample_sequence extends uvm_sequence#(sample_sequence_item);
rand int no_txn;
`uvm_object_param_utils_begin(sample_sequence_item)
`uvm_field_int(no_txn,UVM_ALL_ON)
`uvm_object_utils_end
rand sample_sequence_item sample_sequence_item_inst;
function new(string name="sample_sequence");
super.new(name);
endfunction
virtual task body();
no_txn = 10;
for(int i = 0;i<no_trn;i++) begin
sample_sequence_item_inst = sample_sequence_item::type_id::create($sformatf("sample_sequence_item_%0d",i));
sample_sequence_item_inst.addr = $urandom_range(0,20);
start_item(sample_sequence_item_inst);
finish_item(sample_sequence_item_inst);
end
endtask: body
endclass
このシーケンスは、ランダムなアドレスを生成してドライバーに送信するだけです。テストからパラメーター no_txn を制御したい。
シーケンスの階層を使用してそれを行うことができますが、それをオーバーライドするための UVM ベースのファクトリ メソッドはありますか?