You can pass the plusarg value from the command line and catch that value inside your sequence in a variable, later you can use that variable inside a loop where you generate the transactions.
For example,
if($value$plusargs("WR=%d",wr)) begin
`uvm_info (get_type_name(),$sformatf ("wr = %0d", wr), UVM_DEBUG)
end else begin
wr = 50;
`uvm_info (get_type_name(),$sformatf ("wr = %0d", wr), UVM_DEBUG)
end
rd = 100 - wr;
`uvm_info (get_type_name(),$sformatf ("rd = %0d", rd), UVM_DEBUG)
randcase
wr : begin
`uvm_do_on_with(wseq, seqr,
{
addr inside {[1:10]};
data == 100;
})
rd : begin
`uvm_do_on_with(rseq, seqr,
{
addr inside {[1:10]};
})
endcase
It would be much easier to read this from a file using $fscanf. Doing it from the command line requires a number of steps (untested)
string line;
string pairs[$];
// Read the command line string using $value$plusargs
if ($value$plusargs("instr=%s",line)) begin
// split the line into instructions
uvm_split_string(line,":",pairs);
foreach(pair[ins]) begin
string i_w[$]
// split the pair into instruction/weights
uvm_split_string(pair[ins],"-", i_w);
if (i_w.size == 2)
all_instr.push_back(instr'{itype:i_w[0], iwt:i_w[1].atoi()};
else
// something is wrong
end
end
BTW - I personally am not a big fan of this technique as it makes your constraint solver and regression beyond SV code into scripts/Makefiles. But you may like it.