Commit Graph

56 Commits

Author SHA1 Message Date
Stephen Williams 7f95abc6ab Make a pass at implementing cbAtEndOfSimTime.
In Icarus Verilog, AtEndOfSimTime is practically the same as
cbReadWriteSync, since the latter is after non-blocking events
in Icarus Verilog.
2019-11-25 17:57:10 -08:00
Cary R db1ea05452 Fix #0 to trigger in the inactive region and add a trigger for always_comb/latch 2017-12-03 20:17:42 -08:00
Martin Whitaker 8234f1845d Fix for GitHub issue #106 - prevent VPI writes during read-only synch. 2016-06-09 21:27:20 +01:00
Martin Whitaker 61c82d2cb0 Handle mixed continuous and non-blocking assignments to same vector.
SystemVerilog allows a mixture of procedural and continuous assignments
to be applied to different parts of the same vector. The previous attempt
to make this work for non-blocking assignments was flawed (see preceding
fix for vvp_fun_part_pv::recv_vec4_pv). Instead, handle this case by
converting the non-blocking assignment into a delayed force statement,
which matches the way mixed continuous and blocking assignments are
handled.
2016-05-10 22:16:40 +01:00
Martin Whitaker 54feb89bf5 For SystemVerilog, run variable initialization before main simulation starts. 2016-03-19 13:46:09 +00:00
Stephen Williams bea03db25d Minor vec4 stack manipulation optimizations. 2014-11-21 14:41:31 -08:00
Cary R d6b6b76015 Update header files to use a more standard name to prevent rereading
This is from github report #16. There are likely a few more issues
that need to be addressed though this takes care of the major ones.
2014-07-23 13:42:56 -07:00
Arun Persaud f5aafc32f9 updated FSF-address 2012-08-29 10:12:10 -07:00
Jared Casper 9b785031f5 Implement SystemVerilog final statements.
Add a new IVL_PR_FINAL process type.

Add a flag to NetScope in_final_ which is set when elaborating the
statement of a final procedure.

Add checks during statement elaboration for invalid statements in a
final procedure, similar to checks for statements in functions.

Do a final check to make sure no final blocks have delays.

In the vvp runtime, use "$final" as the flag for the thread created by
the final procedure.  During compilation, instead of adding such a
thread to the sched_list, add it to a new schedule_final_list that
mirrors the schedule_init_list, but is run at the end of simulation.
2011-08-11 14:31:38 -07:00
Stephen Williams ec49f10e2d Revert bad merge from vhdl branch 2010-10-02 11:02:27 -07:00
Martin Whitaker 2bf704940b Fix for initial value propagation (part 2).
To ensure the initial propagation of 'x' values at time-0 does not
trigger any events, the propagation of these values needs to be
completed before any statements that wait on events are executed.
vvp has a pre-simulation event queue to handle this, but some
functors defeat this by postponing their output propagation using
the stratified event queue. This patch fixes this by using the
pre-simulation event queue to schedule functor output propagation
until initial value propagation is complete.
2010-04-13 19:22:29 -07:00
Martin Whitaker da9edeacc7 Fix for pr2974294.
If a net is driven by a simple variable, an initial 'x' value is
propagated to the net at time-0. The same thing should happen if
a net is driven by a variable array word. This patch makes this
happen by scheduling an initial event for each array port attached
to a variable array.
2010-04-13 19:07:05 -07:00
Stephen Williams 5533252cc1 Add generic single-step-display for vvp_gen_event_s objects.
This gives a little bit more specificity to the event step
display.
2010-01-06 21:40:26 -08:00
Stephen Williams 3ddb421fbf Add some single-step debugging
Work out the basis for single-stepping events in the scheduler,
and fill in some basic single-step results.
2010-01-06 16:08:20 -08:00
Stephen Williams 734124e653 Remove dead code in pointers.h. 2009-11-28 21:39:35 -08:00
Stephen Williams 1b7a42ffcd Implement cbAtStartOfSimTime callback. 2009-11-01 09:26:09 -08:00
Stephen Williams 0018cb38b0 Merge branch 'master' into vvp-net-out-rework
Conflicts:
	vvp/schedule.cc
	vvp/schedule.h
2009-09-05 10:19:20 -07:00
Cary R 9a4cd1af32 Add support for non-blocking assignment to real arrays.
This patch adds support for the various types of non-blocking
assignments to real arrays.
2009-09-03 17:07:17 -07:00
Stephen Williams a2bf4904c4 Handle nets driven by C8<> constants. 2009-08-29 08:53:44 -07:00
Stephen Williams 6f8b229646 Remove peek_out() access to the vvp_net_t out member.
Fix up the last bits of code that accessed the ->out member of the
vvp_net_t class. Now the out member is only accessed by send_* methods.
2009-04-06 21:47:21 -07:00
Stephen Williams 8c07d3b51c Fix memory leak in vpi_put_value.
Certain paths through vpi_put_value cause a vpip_put_value_event to
be created with no path for deleting in. Add the capability in the
schedule_generic method, so that it can be delete as soon as it is
executed.
2009-01-14 20:15:50 -08:00
Stephen Williams 49363c660c Remove the duplicate schedule_assign_vector.
The schedule_assign_plucked_vector is a better way to implement the
schedule_assign_vector, or at least no worse, so remove the now
redundent schedule_assign_vector.
2008-06-16 13:40:20 -07:00
Stephen Williams 3c4346acb2 ASSIGN transfer data to scheduler efficiently/permalloc vvp_net_t objects.
The vvp_net_t objects are never deleted, so overload the new operator
to do a more space efficient permanent allocation.

The %assign/v instruction copied the vvp_vector4_t object needlessly
on its way to the scheduler. Eliminate that duplication.(cherry picked from commit d0f303463d)
2008-06-12 13:00:31 -07:00
Stephen Williams 007056d671 Remove last vestiges of the the .mem structures.
Before the .array support, we had .mem nodes. These are long since
removed because the arrays to all the jobs of the .mem nodes.
2008-05-20 16:57:50 -07:00
Cary R 5b2f249dcc Thread deletion is now scheduled after rosync.
Threads used to be deleted when they finished processing code.
The problem with this is that some of the code could be
rescheduled to run at rosync ($strobe, etc.). This allowed the
thread data the code depended on to be reaped too soon. This
patch uses a new queue to schedule thread deletion. The queue
is processed after rosync has finished.
2008-03-20 20:45:41 -07:00
Larry Doolittle d9ac146b8f Spelling fixes
only comments and documentation
some punctuation and capitalization for good measure
Changelogs are purposefully untouched
2008-01-29 20:24:24 -08:00
Stephen Williams b54ef4f585 Variable drivers propogate initial values.
Make varable drivers (reg vectors and real) propagate their initial
values using a special init scheduler queue. This causes the net to
be loaded with reasonable initial values.

Signed-off-by: Stephen Williams <steve@icarus.com>
2007-07-11 21:31:09 -07:00
steve 91d84e7dc7 Major rework of array handling. Memories are replaced with the
more general concept of arrays. The NetMemory and NetEMemory
 classes are removed from the ivl core program, and the IVL_LPM_RAM
 lpm type is removed from the ivl_target API.
2007-01-16 05:44:14 +00:00
steve 44ca0fe798 rwsync callback fixes from Ben Staveley (with modifications.) 2006-09-29 01:24:34 +00:00
steve d434dd7296 Allow part selects of memory words in l-values. 2006-02-02 02:43:57 +00:00
steve bf8b085159 Clean up compiler warnings. 2005-09-20 18:34:01 +00:00
steve 3ac79c294a Implement real valued signals and arith nodes. 2005-07-06 04:29:25 +00:00
steve b58705b829 Inline more simple stuff, and more vector4_t by const reference for performance. 2005-06-22 18:30:12 +00:00
steve 3607fb584d Support UDP initial values. 2005-06-09 05:04:45 +00:00
steve 42433f4df9 Add support for notif0/1 gates.
Make delay nodes support inertial delay.
 Add the %force/link instruction.
2005-06-02 16:02:11 +00:00
steve 5277124c76 Implement non-blocking part assign. 2005-05-07 03:15:42 +00:00
steve 8e135a1020 Non blocking assign to memory words. 2005-03-06 17:07:48 +00:00
steve 2e6d2f8e98 Support scheduling vvp_vector8_t objects. 2005-02-12 03:26:14 +00:00
steve 0609c5f18c Use scheduler to initialize constant functor inputs. 2005-01-29 17:53:25 +00:00
steve 65e9b6be12 Rework of internals to carry vectors through nexus instead
of single bits. Make the ivl, tgt-vvp and vvp initial changes
 down this path.
2004-12-11 02:31:25 +00:00
steve 2418ab9063 Reimpelement scheduler to divide nonblocking assign queue out. 2003-09-09 00:56:45 +00:00
steve 19c6bd2139 Check for stopped flag in certain strategic points. 2003-02-22 02:52:06 +00:00
steve 2de0597038 Add vpiStop and interactive mode. 2003-02-21 03:40:35 +00:00
steve b726395d1e Spelling fixes. 2003-02-09 23:33:26 +00:00
steve aa3a6dba4e Schedule wait lists of threads as a single event,
to save on events. Also, improve efficiency of
 event_s allocation. Add some event statistics to
 get an idea where performance is really going.
2003-01-06 23:57:26 +00:00
steve 52bf4e613f conditional ident string using autoconfig. 2002-08-12 01:34:58 +00:00
steve 94cef20e49 task calls and forks push the thread event in the queue. 2002-05-12 23:44:41 +00:00
steve eb708c1540 Support specified times in cbReadOnlySync, and
add support for cbReadWriteSync.
 Keep simulation time in a 64bit number.
2002-04-20 04:33:23 +00:00
steve a75326e2e0 Rewrite the functor type to have fewer functor modes,
and use objects to manage the different types.
 (Stephan Boettcher)
2001-10-31 04:27:46 +00:00
steve da828a218f Add support for REadOnlySync and monitors. 2001-07-11 02:27:21 +00:00