Jump to content


  • Content Count

  • Joined

  • Last visited

  1. I just came across this thread and thought I'd add something just for fun. If you change the code to this: class showit; rand int var1; rand int var2; constraint c_1 { var1 == 1; } // <----- here endclass It fails too (without the uncommenting). That's because by using only var2 in the randomize, you turn off random for the other vars; rand_mode (0) on var1. Because var1 comes up 0, and 0 < 100, it is fine with that. So it's not 'showit.var1 = 101' that causes the problem, it's 'showit.var1 = any non Zero value'. Change again to class showit; rand int var1 = 1; // <------here rand int var2; constraint c_1 { var1 = 1; } endclass and it 'passes', albeit boringly so.