I need to constrain the contents of an array with values ranging from -3 to 3 (-3, -2, -1, 0, 1, 2, 3).
When I do this:
rand bit [1:0] signed my_arr[6]; //error stating "signed" is not expected.
If I do:
rand int my_arr[6];
and follow it with a constraint stating that the values of each array item must be between -3 to 3, I am good. No errors. Why does “bit [1:0] signed” throw an error? Can someone please let me know what I am missing here?