Hi,
To create multiple instance of my parameterized class, I use following code :
//-------------------
define PARAMS(WIDTH) ``WIDTH,``WIDTH for(int i =0; i<2; i++) begin mon#(
PARAMS(i)) mon_inst[i];
mon_inst[i] = mon#(`PARAMS(i))::type_id()::create(“$psprintf(“mon_inst_%0d”,i),this);
end
It expands to : mon_inst[i] = mon#(i,i)::type_id()::create(“$psprintf(“mon_inst_%0d”,i),this);
I wanted it to as :
mon_inst[i] = mon#(0,0)::type_id()::create(“$psprintf(“mon_inst_%0d”,i),this);
mon_inst[i] = mon#(1,1)::type_id()::create(“$psprintf(“mon_inst_%0d”,i),this);
//-------------------
It doesn’t pass the value of “i”. just pass the “i” in macro expand. Please let me know if it’s possible OR is there any other way to solve this.
Thanks & Regards,
Krupa