Hi ,
I had multiple masters of an i2c ovc. I want to use an for loop for setting the variables in multiple i2c masters by using set_config_int statement in ovm. For this i had done in this way
//STANDARD WAY IS THIS ONE
set_config_int(“i2c0.master[0]”,“is_active”,OVM_ACTIVE);
set_config_int(“i2c0.master[1]”,“is_active”,OVM_ACTIVE);
set_config_int(“i2c0.master[2]”,“is_active”,OVM_ACTIVE);
Instead of using above style, i tried with below style but got issues with it
for(int i=0;i<=i2c_masters;i++)
begin
set_config_int($psprintf(“i2c0.master[%d]”,i),“is_active”,OVM_ACTIVE);
end
But i am getting issue that is_active value is not getting passed to i2c environemnt. Is there another way to write this logic so that i dont have to manually set the variables and can use arrays to set variables.
Thanks in advance for your responses.