Jump to content

constrain or unconstrain illegal values

Recommended Posts



We have programmable registers/tables we would like to randomize.  Some of the values are illegal.  In real system, the programmgers has to program the registers/tables legal values in legal sequences.  We have to make a choice from the following:


1. Constrain values in sequence/configuration so that no illegal condition happens.

2. Set up predictors/scoreboards so that predictors/scoreboards handle appropriately when illegal condition happens.


If we choose #1, the constraints may become super-complicated.  Also we might mask corner cases we might hit if we have less constraints.  If we choose #2, we might hit too many illevant cases that we don't care about, and we may end up missing real corner cases.  These are my concerns.


Which way is recommended?


Thank you for your help!

Link to comment
Share on other sites

You can use distributions, so that you can weight the corner cases to happen less than normal operations. 




x dist { 100:=1, 200:=2, 500:=5 }



which gives the weights of 1-2-5.  So 500 is weighted to happen more often.


You can also use the range distribution:




x dist {[100:102] :/ 1, 200:=2, 500:=5}



which give the weights of 1/3, 1/3,  1/3, 2, and 5


You can't use distributions on randc variables.



Link to comment
Share on other sites



i would do three things:


1. make the probability high that you see normal use cases (legal traffic) and the probability for illegal low. 

2. you can now decide whether you want to ignore or drive the illegal traffic

3. if you decide to drive the illegal config/values you have to harden your sb. usually you also want illegal values driven in order to see they are not causing final lockups, hangs or other bad things and your device can recover.



Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...