[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-user: iverilog vs. $realtime?
- To: geda-user@xxxxxxxx
- Subject: gEDA-user: iverilog vs. $realtime?
- From: Dan McMahill <dan@xxxxxxxxxxxx>
- Date: Tue, 25 Apr 2006 16:15:02 -0400
- Delivered-to: archiver@seul.org
- Delivered-to: geda-user-outgoing@seul.org
- Delivered-to: geda-user@seul.org
- Delivery-date: Tue, 25 Apr 2006 16:20:21 -0400
- Reply-to: geda-user@xxxxxxxx
- Sender: owner-geda-user@xxxxxxxx
- User-agent: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.7.6) Gecko/20050412
I'm trying to use $realtime for some stuff with the 20060409 verilog
snapshot. I'm getting some funny results with $realtime and I'm not
sure if its me doing something stupid or it its a bug in verilog. FWIW,
verilog-XL gives the answer I think I should get.
`timescale 1ns/10ps
module test();
reg ck;
integer cnt;
real tval;
initial begin
ck <= 0;
cnt <= 0;
tval <= 0.0;
end
always #2 ck <= !ck;
always @(posedge ck) begin
cnt <= cnt + 1;
tval <= $realtime;
$display ("tval = %g\n", tval);
if (cnt >= 5) begin
$finish;
end
end
endmodule // test
verilog-XL gives
tval = 0
tval = 2
tval = 6
tval = 10
tval = 14
tval = 18
icarus verilog gives:
tval = 0
tval = 2
tval = 2
tval = 6
tval = 6
tval = 10
I made up this test case after having problems with the following from
my real code:
Assertion failed: now.high == 0, file sys_time.c, line 126
Abort - core dumped
I can make that go away by commenting out a line where I do
x <= $realtime; // x is a real
-Dan