Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Avoiding race conditions without using program blocks in systemverilog

We know that program blocks are used in SystemVerilog to avoid race conditions between DUT and testbench. What did the verification engineers do before SystemVerilog came into picture? I can only think of using hand shake signals.

like image 472
user3655085 Avatar asked Aug 05 '26 17:08

user3655085


2 Answers

You use the same semantics that designers use to prevent race conditions in RTL: Non-blocking assignments, or alternative clock edges.

Program blocks are an unnecessary construct in SystemVerilog. See http://go.mentor.com/programblocks

like image 173
dave_59 Avatar answered Aug 07 '26 08:08

dave_59


You can avoid race condition without using program block.

Race condition is created just because of expression or assignments are try to access same signal at a same time.

If two signals try to access same signal at different time stamp then user can remove race condition.

Actually code is written in verilog or system verilog is execute in different time region like active region, reactive region.

Race condition can be removed using following things.

(1) Program block

(2) Clocking block

(3) Non blocking assigment

Before program block and clocking block race condition is removed using non blocking assignment.

As I explained above statement written in verilog code or system verilog code is not execute code in single time same. There are different region in which specific syntax is executed by tool.

Here I mainly talked about Active and Reactive region. Active region consider continuous assignments, blocking assignments. Reactive region consider LHS of non blocking assignments are evaluated in this region.

First active region is evaluated then reactive region is evaluated.

So before program block to remove race condition verification engineers take care of this things(regions of execution).

Now in system verilog there are many other regions are added like prepone region, observed region, postpone region.

like image 21
Ankit Avatar answered Aug 07 '26 07:08

Ankit



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!