Hi, I have a question regarding a randomization i am trying to modify.
The current code i have which works is as below:
if (max_sleep_cycles <= 200) max_sleep_cycles = $urandom_range(50,200);
std::randomize(sleep_cycles) with {
if(do_intr_abort_exit) sleep_cycles <= 60000;
sleep_cycles dist {
[10:20000] :/ 5,
[20001:60000] :/ 11,
[60001:130000] :/ 14,
[150001:200000] :/ 60
};
sleep_cycles <= max_sleep_cycles;
};
I am trying to add some modifications to it, below is my modified code:
if (max_sleep_cycles <= 200) max_sleep_cycles = $urandom_range(50,200);
std::randomize(sleep_cycles) with {
if(do_intr_abort_exit)
sleep_cycles <= 60000;
else
if(sleep_sync == 1'b1)
sleep_cycles dist {
[150001:170000] :/ 45,
[170001:200000] :/ 45
};
else
sleep_cycles dist {
[10:20000] :/ 5,
[20001:60000] :/ 11,
[60001:130000] :/ 14,
[150001:200000] :/ 60
};
sleep_cycles <= max_sleep_cycles;
};
With my modification, i am getting the below error
integer max_sleep_cycles = 69841;
bit[0:0] do_intr_abort_exit = 1’h0;
bit[0:0] sleep_sync = 1’h1;
rand integer sleep_cycles; // rand_mode = ON
constraint WITH_CONSTRAINT // (from this) (constraint_mode = ON)
{
((!do_intr_abort_exit) && (sleep_sync == 1’h1)) → (sleep_cycles dist {[150001:170000] :/ 45, [170001:200000] :/ 45});
(sleep_cycles <= max_sleep_cycles);
}
Iam not sure what i am doing wrong, can someone tell where i am going wrong and how to resolve it
Thanks,
Sid