Yes it’s like a error frame generation, 10 errors to generated with each error being unique.
Yes the error bits inserted should be random for each error not on consecutive Index.
Insertion of error bits to the fixed 1000 bit frame makes it different for each.
Totally 10 Errors, so each error is nothing but Frame of 1000 bits + Error bits injected. Error bits should not be injected consecutively.
For example:: in Error 1 pattern, 1000 bits are injected with 5 error bits which are not consecutive.
In error 2 pattern, 1000 bits are injected with 7 error bits , and so on
OK, now you are a little bit clearer, but still a lot of missing information. Let’s create an array of bits indicating which bits in your pattern should have an error
bit [0:999] pattern;
rand bit error_bits[1000]; // bit set if inject error
You never stated what an error looks like, but I will assume an error is an inverted bit. You can generate the errors with this in post_randomise();
You want to inject N error bits into a pattern of 1000 bits. You never specified how many bits out of those 1000 could have an injected error, but let me assume a range from 1 to 100. You constraints would then look like
constraint c {
error_bits.sum() with (int'(item)) inside {[1:100}; // number of bits that will have an error
foreach (error_bits[b]) b>0 -> !error_bits[b] || !error_bits[b-1]; // no consecutive errors
foreach (error_bits[b]) const'(error_bits[b]) -> !error_bits[b]; // no repeated errors
}
You need to repeatedly call randomize() 10 times to get 10 error scenarios.