randomize() Vs std::randomize()

The built-in class randomize method operates exclusively on class member variables. Using classes to model the data to be randomized is a powerful mechanism that enables the creation of generic, reusable objects containing random variables and constraints that can be later extended, inherited, constrained, overridden, enabled, disabled, and merged with or separated from other objects….

Functional Coverage Options in System Verilog

Functional Coverage is very important in Test Bench Development. It always gives us confidence in covered items listed on the verification plan. Usually, the goal of a verification engineer is to ensure that the design behaves correctly in its real environment according to specifications. Defining a coverage model is very important for any test bench…

Immediate Vs Concurrent Assertions

Immediate assertions use expressions and are executed like a statement in a procedural block. They are not temporal in nature and are evaluated immediately when executed. Immediate assertions are used only in dynamic simulations. Following is an example of a simple immediate assertion that checks “if x and y are always equal”: Concurrent assertions are temporal…

How to generate an array of unique random values

Nowadays in many verification scenarios, it requires to create a set of random instructions or addresses with each unique value or we can say that no repeating values, usually represented as elements in a dynamic array.  Earlier versions of SystemVerilog required you to use either nested foreach loops to constraint all combinations of array elements…

System Verilog rand_mode() and constraint_mode()

rand_mode(): Variables who is having random nature declared as rand or randc can be turned on or off dynamically by using an in-built method called rand_mode(). It can be called either function or task. In the below example, you can see that how rand_mode we are going to use to disabled and enabled all variables….