Commit Graph

69 Commits

Author SHA1 Message Date
Cary R dec524a151 More valgrind cleanup.
This patch adds code to cleanup system functions driving a
continuous assignment. It also modifies the user function
cleanup to not interfere with this. It also adds a count
of the nets and signals that were not cleaned up that is
pnly printed when running valgrind. They are not flagged
y valgrind since they are pool managed objects. There are
a few signals that need to be cleaned up and local nets
are missed so there are a lot of nets.
2009-10-16 20:03:26 -07:00
Stephen Williams d64b1f0275 Unify some duplicated heap management.
Create the permaheap class to hold common code from the vvp_net_fun_t
and vvp_net_fil_t classes.
2009-09-30 22:10:35 -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
Patrick Doyle f379cd0a14 Teach vvp about -N
Added support for the -N option, which causes $stop and ^C to behave
like $finish with an exit code of 1.

While I was at it, I noticed that the summary line in the man page for
vvp was missing a couple of options, so I fixed that.
2009-06-19 21:30:33 -07:00
Cary R 1942327ae2 Allocate the fd table dynamically in 32 entry chunks.
The fd table used to be statically allocated with only 32 entries.
Three of these were preallocated for stdin, stdout and stderr
leaving only 29 for the user.  This patch makes the allocation of
this table dynamic with a hard limit at 1024 total fds. The table
is increased in 32 bit chunks.
2009-06-07 16:48:05 -07:00
Cary R bb37607a30 Add island EOS cleanup code
This cleans up most of the memory allocated when building and
island and the branches that connect to it.
2009-02-09 13:41:54 -08:00
Cary R 7b1905b997 Add memory freeing and pool management for valgrind.
This patch adds code to free most of the memory when vvp
finishes. It also adds valgrind hooks to manage the various
memory pools. The functionality is enabled by passing
--with-valgrind to configure. It requires that the
valgrind/memcheck.h header from a recent version of
valgrind be available. It check for the existence of this
file, but not that it is new enough (version 3.1.3 is known
to not work and version 3.4.0 is known to work).

You can still use valgrind when this option is not given,
but you will have memory that is not released and the
memory pools show as a single block.

With this vvp is 100% clean for many of the tests in the
test suite. There are still a few things that need to be
cleaned up, but it should be much easier to find any real
leaks now.

Enabling this causes a negligible increase in run time and
memory. The memory could be a problem for very large
simulations. The increase in run time is only noticeable on
very short simulations where it should not matter.
2009-02-01 06:55:28 -08:00
Cary R c419e77710 More end of simulation memory cleanup.
This patch adds some more memory freeing routines to vvp and
the vpi library. Much more to do before this is finished.
2009-01-25 07:40:28 -08:00
Cary R eddfa12569 Cleanup the lexor state information when done parsing.
This patch frees the lexor buffers when we are done parsing
the input file.
2009-01-14 18:48:44 -08:00
Cary R c2605a5c9b Fix memory leaks in vvp and change vvp T_STRING token to be new based.
This patch fixes a bunch of memory leaks in vvp and converts the
T_STRING lexical token to be new based. There are still two
known leaks that I need to find a way to fix and likely some
unknown leaks that still need to be found and fixed.
2009-01-13 10:53:23 -08:00
Cary R 5d7f8c9706 Update copyright in files changed in 2009
This patch updates the copyright notice in the files that
were modified in 2009. It also updates the normal programs
and the vvp target.
2009-01-08 20:03:34 -08:00
Cary R 8c4a080754 Put a version in the vvp file and have vvp verify compatibility.
This patch makes the code generator put the compiler version
information in the vvp output file. It also adds checks in vvp
to verify that this version is compatible with the run time.
I am assuming that a base release 0.9.0, etc. will have a
blank VERSION_TAG. Any change relative to the release will have
a VERSION_TAG.
2008-11-25 08:01:06 -08:00
Cary R 24827c4b42 Add a -V flag to the runtime and update the manual pages.
This patch adds a -V flag to the runtime to print version information.
It also updates the manual page to document this and makes some minor
changes to the iverilog an iverilog-vpi manual pages.
2008-11-19 20:40:30 -08:00
Stephen Williams 3aaea46144 Content-free portability fixes.
These are patches from ITOH Yasufumi and Larry Doolittle of pr2120948.
They change nothing, but make the code compile with older compilers.
2008-09-29 18:06:47 -07:00
Stephen Williams 6f9643df79 Better array statistics.
Allocation counters for arrays and array words of various types.
2008-06-13 17:41:24 -07:00
Stephen Williams aeaf8e8433 Permalloc vvp_net_fun_t objects.
The vvp_net_fun_t objects, and derived objects, are small, and are
created in large quantities. Tightly pack them into permanently
allocated space in order to save on system allocation overhead, and
thus save overall on memory.
2008-06-13 17:08:11 -07:00
Cary R 99a46fd5af Fix incorrect typecast.
This patch fixes an incorrect typecast in vvp/main.cc.
2008-06-13 11:38:18 -07:00
Larry Doolittle eed4ff7e2d Spelling fixes
Mostly comments, but includes quite a few
user-visible error, debug, and help messages.
2008-06-13 08:51:28 -07:00
Stephen Williams 4af4c8cca9 Permallocate scheduler cells in chunks
Scheduler cells are small objects that come and go in great quantities.
Even though they are allocated and deallocated a lot, they tend to a
steady state quantity, so put together a heap that is unique for each
cell type.

This heap actually saves memory overall because cells are allocated in
chunks, thus eliminating allocator overhead, and they are pulled/pushed
from/to a heap very quickly so that what overhead remains is slight and
bounded.
2008-06-12 19:55:53 -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
Cary R 608c2574bd Add $finish_and_return.
This new system task can be used to set the vvp return value
and finish the simulation.
2008-05-22 20:34:38 -07:00
Michael Witten 9c0d2c13c9 [PATCH] Removed #include asm/page.h on GNU/Linux
vvp/main.cc was including asm/page.h on GNU/Linux
systems, though that file does not often exist and
is not necessary.

Signed-off-by: Michael Witten <mfwitten@mit.edu>
2008-02-04 13:22:32 -08:00
Cary R d95c77a58a Add vvp flag that allows $stop to act like $finish.
This patch adds a new flag to vvp "-n" that can be used to make
$stop and hence <Control-C> act like $finish. This may be desired
when using vvp in a non-interactive environment.
2008-01-07 18:23:18 -08:00
Stephen Williams e5381feb85 Clean up functor counters
The functor counters were left over from the v0.8 release. Rework
the counters to be relevent to the current state of vvp.

Signed-off-by: Stephen Williams <steve@icarus.com>
2007-12-02 08:47:06 -08:00
Stephen Williams 7132b8ff6b Start runtime trace aids
The runtime is a vvp runtime engine debug aid that allows for
detailed dump into a debug log. The trace is enabled by setting
the VVP_DEBUG variable and activating specific debug messages
in the vvp source.

Signed-off-by: Stephen Williams <steve@icarus.com>
2007-07-11 21:38:56 -07:00
steve 9d4fc92df5 Get page size from sysconf. 2007-02-16 23:30:14 +00:00
steve 56f70ec702 Include math.h with lround implementation. 2006-04-28 15:44:37 +00:00
steve 949054e000 lround takes double, not float. 2006-04-28 15:40:30 +00:00
steve fd94268315 Detect missing lround function. 2006-04-27 05:04:59 +00:00
steve bf3679b7d4 Add the -s flag to start up interactive. 2005-01-29 06:28:19 +00:00
steve e4ae832153 Clean up spurious trailing white space. 2004-10-04 01:10:51 +00:00
steve e8a222e783 Fix mingw portability problems. 2003-06-25 04:04:19 +00:00
steve 54e809ffa4 Include verbose messages in log output. 2003-06-13 19:51:08 +00:00
steve 2e3ce49400 Arrange for mcd id=00_00_00_01 to go to stdout
as well as a user specified log file, set log
 file to buffer lines.

 Add vpi_flush function, and clear up some cunfused
 return codes from other vpi functions.

 Adjust $display and vcd/lxt messages to use the
 standard output/log file.
2003-05-15 16:51:08 +00:00
steve f45fd155c4 Remove the obsolete functor delete functions. 2003-03-13 04:36:57 +00:00
steve 3c18663c3f Mke getopt ignore options after the file name. 2003-02-07 02:45:05 +00:00
steve ddd43f1378 Add a means to clear the module search path. 2003-01-18 23:55:35 +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 7a5c30d297 printf size warning. 2002-09-18 03:34:07 +00:00
steve 52bf4e613f conditional ident string using autoconfig. 2002-08-12 01:34:58 +00:00
steve 41239078a9 Fix initialization of symbol table string heap. 2002-07-15 00:21:42 +00:00
steve 54b96ea7bd Count different types of functors. 2002-07-05 20:08:44 +00:00
steve fd8ceac170 Names of vpi objects allocated as vpip_strings. 2002-07-05 17:14:15 +00:00
steve 626f418ab0 Track opcode memory space. 2002-07-05 03:46:43 +00:00
steve 5792220dcb Remove the vpi object symbol table after compile. 2002-07-05 02:50:57 +00:00
steve e1a6bb10de Formally define extended arguments to vvp. 2002-04-12 02:44:02 +00:00
steve c159ff3134 Add cleanup to verbose messages. 2002-03-01 05:43:14 +00:00
steve 4291866b9f Add vpi_get_vlog_info support. 2002-01-09 03:15:23 +00:00
steve acf3a4ec16 Print memory usage information if requested (Stephan Boettcher) 2001-10-20 01:03:42 +00:00
steve 537757a7b9 Cleanup defines and types for mingw compile. 2001-07-30 02:44:05 +00:00