Hi,
I want to have variable number of drivers for my verification env and also to have different configuration for each driver.
Is there a way of doing it?
E.g
global_config class extends uvm_component;
int no_of_drivers;
int max_delay[];
function new(string name="gbl_cfg", uvm_component parent=null);
super.new(name,parent);
this.name = name;
if (!$value$plusargs("NO_OF_DRV=%d", no_of_drivers))
no_of_drivers = 2;
endfunction
virtual function void build_phase(uvm_phase phase);
super.build_phase(phase);
max_delay = new[no_of_drivers];
foreach(fencer_tx_fc[idx])
begin
if (!$value$plusargs($psprintf("MAX_DELAY_DRV_%0d",idx)=%0d, max_delay[idx])) // This statement does not work. Could you suggest something similar?
max_delay[idx] = 5;
end
end
endfunction
endclass
if (!$value$plusargs($psprintf("MAX_DELAY_DRV_%0d",idx)=%0d, max_delay[idx])) -> This statement does not work. Could you suggest something similar?
If I run with "+NO_OF_DRV=5 +MAX_DELAY_DRV_0=10 +MAX_DELAY_DRV_4=3" compile options, I want the max_delay array to be as follows:
max_delay = {3,5,5,5,10}
If the next simulation is run with "+NO_OF_DRV=2 +MAX_DELAY_DRV_0=1 +MAX_DELAY_DRV_1=2", the max_delay array to be max_delay={1,2}
Is this possible? If so, how?
TIA !