U
Uwe Bonnes
Guest
Following code
`timescale 1ns/1ns
module test();
reg clka = 0, clkx2=0;
reg clkb = 0;
reg xa = 0, xb = 0;
always # 5 {clka, clkx2} = {clka, clkx2} + 3'h3;
always @(posedge clkx2)
clkb <= !clkb;
always @(posedge clkx2)
begin
xa <= clka;
xb <= clkb;
#1 $display("xa %x xb %x", xa, xb);
end
initial
begin
$dumpfile("timing.dmp");
$dumpvars;
# 30 $finish;
end
endmodule // test
gives a for me unexpected result in that xa and xb are out of phase
when run with iverilog and cver. Both print
xa 1 xb 0
xa 0 xb 1
xa 1 xb 0
Are these simulators right? And if they are right,
what verilog language feature causes this behaviour.
Thanks
--
Uwe Bonnes bon@elektron.ikp.physik.tu-darmstadt.de
Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
`timescale 1ns/1ns
module test();
reg clka = 0, clkx2=0;
reg clkb = 0;
reg xa = 0, xb = 0;
always # 5 {clka, clkx2} = {clka, clkx2} + 3'h3;
always @(posedge clkx2)
clkb <= !clkb;
always @(posedge clkx2)
begin
xa <= clka;
xb <= clkb;
#1 $display("xa %x xb %x", xa, xb);
end
initial
begin
$dumpfile("timing.dmp");
$dumpvars;
# 30 $finish;
end
endmodule // test
gives a for me unexpected result in that xa and xb are out of phase
when run with iverilog and cver. Both print
xa 1 xb 0
xa 0 xb 1
xa 1 xb 0
Are these simulators right? And if they are right,
what verilog language feature causes this behaviour.
Thanks
--
Uwe Bonnes bon@elektron.ikp.physik.tu-darmstadt.de
Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------