In reply to Srini @ CVCblr.com:
Hello Everyone,
In reference with discussion going on unique constructs i have few points as a query.
I have compiled & executed this below simple code to check the sv-2012 unique construct.However it is executing successfully with VCS 2014.10 but for cadence incisive 15.20 it is reporting an error like below::
ncvlog: *E,MSTBER (design.sv,5|38): Expecting a random variable (declared with the ‘rand’ modifier).
Is it having possibility like we have to pass some switch to enable 2012 constructs?
Also the concept of unique is related only with randomizing unique array elements or it has some other use cases as well apart from array randomizing?
class dummy;
rand bit [3:0] mode[5];
bit[3:0] exludes[]={1,2,3,4,5,6};
constraint uniq{unique {mode,exludes};} //excluding elements
endclass : dummy
module test_unique;
initial begin
dummy clkgen = new();
clkgen.randomize();
for(int i=0;i<5;i++)
begin
$display("clkgen.mode = %0d\n",clkgen.mode[i]);
end
end
endmodule
Regards,
Geet