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….

Randcase Vs Randsequence in Systemverilog

Randcase: Randcase is a case statement that randomly selects one of its branches just like a case statement in Verilog but here as its randcase so it will pick statements randomly. Randcase can be used in class or modules. The randcase item expressions are non-negative integral values that constitute the branch weights. An item weight…

@event Vs wait(event.triggered) in SystemVerilog

SystemVerilog supports two ways through which we can wait for a particular event to be triggered. So let’s understand what is the exact difference between those two ways of event trigger with the following example. An event trigger ->e is an instantaneous event. The event control @e has to execute and block the current process…