Вы находитесь на странице: 1из 13

System Verilog Scheduling

Schemantics
Verilog Race Condition

module design_ex( module testbench( module tbench_top;


output bit [7:0] input bit [7:0] addr); wire [7:0] addr;
addr); initial begin
$display("\t Addr design_ex
initial begin dut(addr);
= %0d",addr);
addr <= 10;
end
end endmodule testbench
endmodule test(addr);
endmodule

Simulator Output

Addr = 0
Verilog Race Condition => SV
Solution

module design_ex( program testbench( module tbench_top;


output bit [7:0] input bit [7:0] addr); wire [7:0] addr;
addr); initial begin
$display("\t Addr design_ex
initial begin dut(addr);
= %0d",addr);
addr <= 10;
end
end endprogram testbench
endmodule test(addr);
endmodule

Simulator Output

Addr = 10
SystemVerilog event regions
SystemVerilog Event Regions and
Advantages
Active, Re-active, NBA and Postponed regions
are designed for correct RTL functionality.

Preponed, Observed, Reactive, Re-Inactive


and Postponed regions are added in SV.
Preponed Events Region
The #1step sampling delay provides the ability
to sample data immediately before entering
the current time slot.
Sampling in the Preponed region is equivalent
to sampling in the previous Postponed region.

This region is to sample values that are used


by concurrent assertions.
RTL Regions
Already covered.
Observed Region
This region evaluates the concurrent
assertions using the values sampled in the
Preponed region.
Assertions that execute a pass or fail action
block, actually schedule a process associated
with the pass and fail code into the Reactive
region, not in the Observed region.
This is because concurrent assertions are
designed to behave strictly as monitors and
are not allowed to modify the state of the
design.
Reactive Region Set
Reactive Region
Reactive region is to execute the verification
processes called by program blocks.

The Reactive region holds the current reactive


region set events being evaluated and can be
processed in any order.
blocking assignments in program blocks
action blocks of concurrent assertions
Re-Inactive Region
The Re-Inactive region holds the events to be
evaluated after all the Reactive events are
processed.

Events are scheduled into the Re-Inactive


region by executing #0 in a program process.

Re-Inactive region is the dual of the Inactive


RTL region which is not recommended.
Re-NBA Region
If events are being executed in the reactive
region set, a NBA creates an event in the Re-
NBA update region scheduled for the current
or a later simulation time.

RTL regions (Active-Inactive-NBA) will re-


triggered if the program execution scheduled
any events in those regions in the same
timestep.
Postponed Region
$strobe and $monitor commands that will
show the final updated values for the current
timestep.
to collect functional coverage for items that
use strobe sampling.
There is no feedback path from the Postponed
region back into the RTL or Reactive-loop
regions, so the values displayed and the
coverage collected will be the final values for
that timestep.

Вам также может понравиться