From the category archives:

6. Automatic Stimulus

$onehot

by Ray Salemi on March 5, 2010

If you are creating automatic stimulus using the randomize() method and you need a value to be one-hot, you can use the built in $onehot assertion. ┬áThis assertion returns a 1 if the value inside it is a one-hot. ┬áThe assertion looks like this: assert(myreq.randomize() with{ $onehot(onehot_reg) == 1;}); This code will clear all the […]

{ 0 comments }