but here 4 value is hardcoded . I wanted to generalize hardcoded stuffs to {a[i][a.size()-1-i] == 0 ; }
But I am getting run time errors . I think *triple-back-ticks and end with ** is not supported in system verilog . if you have any example you can share .
@ajitgangad_2, Srini was referring to formatting the code in your post in the forum with triple backticks.
```verilog
constraint c4 { foreach (a[i,j]) {
```
shows up as
constraint c4 { foreach (a[i,j]) {
If you want the 2 diagonal elements to be 0, use the following
Thanks @dave_59 . I will use mentioned formatting while keeping post .
a[i][a.size()-1-i] == 0;
above mentioned constraints is giving below run time error- Failure: C:/questasim64_10.4e/examples/matrix_gen1.sv(17): Invalid random variable in index expression for constraint.
How can I fix this error ?