SystemVerilog Event Scheduling Algorithm

Posted lyuyangly

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了SystemVerilog Event Scheduling Algorithm相关的知识,希望对你有一定的参考价值。

While simulating System Verilog design and its test-bench including assertions, events has to be dynamically scheduled, executed, and removed as the simulator advances time. To have this feature, simulator has to maintain a data structure and usually would be a time ordered linked list. That means, at any point of time during simulation, event has one execution time which is current time or future time.

All scheduled events at a specific time define a time slot. A time slot is divided into a set of ordered regions, as Preponed, Pre-Active, Active, Inactive, Pre-NBA, NBA, Post-NBA, Pre-Observed, Observed, Post-Observed, Reactive, Re-Inactive, Pre-Re-NBA, Re-NBA, Post-Re-NBA, Pre-Postponed & Postponed.

REGION GROUPS

There are groups of event regions that are used to help define the scheduling of System Verilog activity.

Active region: Events scheduled in the Active, Inactive, Pre-NBA, NBA, and Post-NBA regions are active region set events.

Reactive region: Events scheduled in the Reactive, Re-Inactive, Pre- Re-NBA, Re-NBA, and Post-Re-NBA regions are reactive region set events.

Iterative regions: The Active, Inactive, Pre-NBA, NBA, Post-NBA, Pre-Observed, Observed, Post- Observed, Reactive, Re-Inactive, Pre-Re-NBA, Re-NBA, Post-Re-NBA, and Pre-Postponed regions are known as the iterative regions.

Simulation region: The simulation regions of a time slot are the Preponed, Active, Inactive, NBA, Observed, Reactive, Re-Inactive, Re-NBA and Postponed regions.

技术分享图片

Simulator executes and removes all events in the current simulation time slot before moving to next time slot. In an even based simulator, a time slot is divided into a set of ordered regions to provide predictable interactions between the design and test-bench code.

PREPONED

Sampling in the preponed region is same as the sampling in the previous postponed region. All nets and variables used in concurrent assertions are sampled here.

The #1step sampling delay provides the ability to sample data immediately before entering the current time slot. #1step sampling is identical to taking the data samples in the Preponed region of the current time slot.

ACTIVE REGION

Sampling of blocking assignments (out = in), continuous assignments (assign out=in) and RHS of non-blocking assignments (out <= in) are evaluated in this region. If intra-assignment delay exist for blocking assignment, it first computes RHS value and then suspend the executing process and schedule as future event. Delay 0 will be scheduled for inactive region.

INACTIVE REGION

The Inactive region holds the events to be evaluated after all the Active events are processed.

#0 delay statements are executed in this region.
out = #0 in

An explicit #0 delay control requires the process to be suspended and an event to be scheduled into the Inactive region of the current time slot so that the process can be resumed in the next Inactive to Active iteration.

NBA

RHS of non-blocking assignment are occurred in active region and update of LHS will happen in NBA region.

The NBA region holds the events to be evaluated after all the Inactive events are processed. If events are being executed in the active region set, a non-blocking assignment creates an event in the NBA region scheduled for the current or a later simulation time.

OBSERVED REGION

The Observed region is for evaluation of property expressions when it is triggered. During property evaluation, pass/fail code shall be scheduled in the Reactive region of the current time slot. PLI callbacks are not allowed in the Observed region.

RE-ACTIVE REGION

The pass/fail code (code in action blocks of concurrent assertions) is scheduled in this region. The code specified by blocking assignments in program blocks is also scheduled in this region.

The Reactive region is the reactive region set dual of the Active region.

RE-INACTIVE REGION

#0 delay statements related to program block are scheduled in this region.The Re-Inactive region holds the events to be evaluated after all the Reactive events are processed.

The Re-Inactive region is the reactive region set dual of the Inactive region.

RE-NBA REGION

The Re-NBA region holds the events to be evaluated after all the Re-Inactive events are processed.

Update of LHS will happen in this region for the statements its RHS of non-blocking assignment occurred in re-active region.The Re-NBA region is the reactive region set dual of the NBA region.

POSTPONED

Write values to any net or variable or scheduling an event in any previous region within the current time slot are illegal in this region. $monitor, $strobe, and other similar events are scheduled here.


以上是关于SystemVerilog Event Scheduling Algorithm的主要内容,如果未能解决你的问题,请参考以下文章

求systemverilog vimrc 高亮方法(要代码)

请教systemverilog中的interface问题

SystemVerilog 编写FSM

systemverilog 断言中assume 和assert的区别

systemverilog 为啥要用$cast类型转换函数

参数化模块 (SystemVerilog)