Knowledge Center
Knowledge Center

Stimulus Constraints

Constraints on the input to guide random generation process


Constrained random test pattern generation has the ability to generate huge amounts of stimulus, but most of that would be a waste of time if the stimulus generated were not actually useful. This is equivalent to a room full of monkeys sitting in front of keyboards and asking them to write Shakespeare. But by providing rules and guidelines, it becomes a more likely outcome, if still highly improbable. This is the role of constraints.
The simplest form of constraint is a combinatorial one. This may say that if a particular bit is set to be a logic 1, then this is the valid range that this other number can take. This process is called constraint solving and is performed as part of the pattern generation. In fact this is the meaning of the “constrained” in the term.

More complex constraints would be temporal in nature and say, for example, that after this cycle has been executed, these are the valid cycles that can be run next. Unfortunately, we do not have a language that can define these. Instead we rely of the definition of sequences which define what are valid sequences and for the generator to pick randomly from these sequences. The weakness in this method is that not all valid sequences may have been defined and thus waters-down the benefits that come from using a constrained random approach.

Constraints are also important in the formal verification flow in that they restrict the range of things that have to be considered. This may be related to knowing the context in which a block may operate, or it may be to prune the size of a problem such that obtaining a proof becomes possible.

Related Technologies