A
Alexis POLTI
Guest
Hello !
I have a problem with Verilog scheduling semantic. Given the following code :
***************************************
module top;
reg clk;
reg d;
initial
begin
d = 0;
clk = 0;
#10 clk <= 1;
#15 $finish;
end
always @(posedge clk)
d <= 1;
bottom bottom(clk, d);
endmodule
module bottom(clk, d);
input clk;
input d;
always@(posedge clk)
begin
$display("bottom : got clock pulse, d=", d);
end
endmodule // bottom
***************************************
What should this code display ?
I might think that the correct value is "d=0" (as given by modelsim), but cver gives "d=1". I ask Pragamatic-software
(cver) why, and they answered me that this design has a race condition. Could someone please explain where exactly is
this race condition ?
Thanx !
Alex
I have a problem with Verilog scheduling semantic. Given the following code :
***************************************
module top;
reg clk;
reg d;
initial
begin
d = 0;
clk = 0;
#10 clk <= 1;
#15 $finish;
end
always @(posedge clk)
d <= 1;
bottom bottom(clk, d);
endmodule
module bottom(clk, d);
input clk;
input d;
always@(posedge clk)
begin
$display("bottom : got clock pulse, d=", d);
end
endmodule // bottom
***************************************
What should this code display ?
I might think that the correct value is "d=0" (as given by modelsim), but cver gives "d=1". I ask Pragamatic-software
(cver) why, and they answered me that this design has a race condition. Could someone please explain where exactly is
this race condition ?
Thanx !
Alex