Error: $value$plusargs : Second argument must be a modifiable variable.
In the below code, I intend to send the number of slaves and the required slaves I want to check.
Say I want to set 10 slaves, and I want to check in them slave 1 and 10
So to do that how can I send the same using $value$plusargs?
//TB FILE USED
`include "cs_common.sv"
`include "cs_tx.sv"
`include "cs_gen.sv"
module top_tb;
cs_gen gen=new();
initial
begin
$value$plusargs("total_target_slaves=%d",cs_common::total_target_slaves);
$value$plusargs("target_slaves=%p",cs_common::target_slaves);
$display("cs_common::target_slaves=%p",cs_common::target_slaves);
for(int i=0;i<cs_common::target_slaves.size;i++)
begin
cs_common::target_slaveQ.push_back(cs_common::target_slaves[i]);
end
$display("cs_common::target_slaveQ=%p",cs_common::target_slaveQ);
gen.run();
end
endmodule
// RUN FILE USED
#compilation
vlog top_tb.sv
#elaboration
vsim top_tb -sv_seed 356489 +total_target_slaves=10 +target_slaves={1,3}
#there is nothing to add in the waveforms
run -all
//ERROR
Error: $value$plusargs : Second argument must be a modifiable variable.