Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Prepared By:
Jayesh Popat
Sonali Patel
Event Regions
Definition:
The term simulation time is used to refer to
the time value maintained by the simulator to
model the actual time it would take for the
system description being simulated. The term
time is used interchangeably with simulation
time.
timeslot: all simulation activity that is
processed in the event regions for each
simulation time.
IEEE P1800/D4 Draft Standard for SystemVerilog - Unified Hardware Design, Specification, and
Verification Language (working draft of the SystemVerilog Standards Group).
Race Condition
The term originates with the idea of two signals
racing each other attempting to influence the
output first
Example:-2
Example:-1 always @(posedge clk)
assign p = q; begin
initial begin x = 1'b0;
q = 1; y = x;
#1 q = 0; end
$display(p); always @(posedge clk)
End begin x = 1'b1;
*What is the value of p? end
*What is the value of y?
Non determinism
Example:-4
module DFF (clk, q, d);
input clk, d;
output q;
reg q;
always @(posedge clk)
q = d;
endmodule
module DFF_chain;
DFF dff1(clk, q1, d1);
What is value of q2?
DFF dff2(clk, q2, q1);
endmodule
Self triggering blocks
module osc2 (clk);
output clk;
reg clk;
always @(clk)
begin
#10 clk <= ~clk;
$display("time=%0g",$time," clk = %b",clk);
end
endmodule
Coding guidelines to avoid Race
condition in Verilog
Event Regions Verilog 2001
Scheduling Semantics Verilog
Events at simulation time are stratified into four
layers of events in the order of processing: