Those variables(var_inst0,var_inst1…) and their corresponding coverpoints are generated automatically from an excel sheet using a perl script. So I would have to manually change wherever these variables are being used. So is there any way to implement the assignment using for loop?
In reply to Mark Curry: So is there any way to implement the assignment using for loop?
Thanks.
Yes, Fix your PERL script. Either have it create an array as Mark suggested above, or have it generate the assignments for you.
SystemVerilog is a compiled language and you cannot create identifier names during runtime. (Same as C/C++/Basic)