From eaea529c280e613295a13f9f1bb384df3a3bd3d8 Mon Sep 17 00:00:00 2001 From: Stephen Williams Date: Mon, 5 Jan 2009 20:22:54 -0800 Subject: [PATCH] Delay statement times are 64bit. In certain special cases, the compiler did not properly work with long64 while handling delay statement times. --- elaborate.cc | 2 +- vvp/opcodes.txt | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/elaborate.cc b/elaborate.cc index 1ec20a887..03e33aa35 100644 --- a/elaborate.cc +++ b/elaborate.cc @@ -2741,7 +2741,7 @@ NetProc* PDelayStatement::elaborate(Design*des, NetScope*scope) const return new NetPDelay(tmp->value().as_ulong64(), statement_->elaborate(des, scope)); else - return new NetPDelay(tmp->value().as_ulong(), 0); + return new NetPDelay(tmp->value().as_ulong64(), 0); delete dex; diff --git a/vvp/opcodes.txt b/vvp/opcodes.txt index db3de0c4e..dc24887e8 100644 --- a/vvp/opcodes.txt +++ b/vvp/opcodes.txt @@ -280,14 +280,17 @@ will be deactivated. For a full deactivation the is 0 and The same as %deassign above except this is used for real variables. -* %delay +* %delay , This opcode pauses the thread, and causes it to be rescheduled for a -time in the future. The is the number of the ticks in the +time in the future. The amount is the number of the ticks in the future to reschedule, and is >= 0. If the %delay is zero, then the thread yields the processor for another thread, but will be resumed in the current time step. +The delay amount is given as 2 32bit numbers, so that 64bit times may +be represented. + * %delayx This is similar to the %delay opcode, except that the parameter