I have come across following 3 Constraints , which I somehow feel is Lazy way of writing Constraints
// CODE 1
rand bit [1:0] a , b ;
constraint IMPLI { a -> ( b == 3 ) ; } // EDIT :: LHS 'Operand' means what ??
[a] I am unsure what LHS of implication Constraint mean ?
Similarly if I modify it to ::
// CODE 2
rand bit signed [1:0] a ; // a is inside {[-2:1]} !!
rand bit [1:0] b ;
constraint IMPLI { a -> ( b == 3 ) ; } // EDIT :: LHS 'Operand' means what ??
[b] In this case does the LHS mean the same as CODE 1 ? Or are they different
// CODE 3
rand bit [7:0] b ;
constraint ITERATN {
foreach(b[i])
if ( i ) // Index means what ??
{
b[i] == 1 ;
}
else
{ b[i] == 0 ; }
}
// CODE 4
rand bit signed [-2:1] b ; // b has value inside {[-8:7]}
constraint ITERATN {
foreach(b[i])
if ( i )
{
b[i] == 1 ; // For which indexes ?
}
else
{ b[i] == 0 ; }
}
[c]
Similarly in these 2 foreeach Consatrints ( Code 3 && 4 ) what does i indicate when if ( i ) is True ?