Commit Graph

111 Commits

Author SHA1 Message Date
Cary R 94dcd658c8 Update exe and manual pages to report @(C) 2025 2025-10-12 19:13:30 -07:00
Martin Whitaker adb6a2f454 Add vvp "quiet" flag (issue #1193)
This adds a "-q" option on the vvp command line and a vvp_set_quiet_flag()
function in the VVP library API. Setting this flag will cause all output
to standard output via MCD bit 0 to be suppressed. It will not prevent the
output being sent to a log file if the vvp "-l" option has been used, and
it will not affect output to the STDOUT file descriptor.
2024-12-31 13:05:36 +00:00
Martin Whitaker 713b002138 vvp: fix regression in behaviour of -N option (issue #1138)
The -N option was broken by PR #1068. This fix modifies and simplifies
the libvvp API that was introduced in that PR.
2024-06-15 10:47:22 +01:00
ga 95810b2f61 Configure with --enable-libvvp builds a shared library containing
almost all of vvp that may be used by other programs.
The vvp program becomes a small client of libvvp.
2024-01-24 11:46:02 +00:00
ga e6ea9bee83 Restore main.cc, completing copy of main.cc to lib_main.cc. 2024-01-24 10:33:40 +00:00
ga 400bda8bed Copy main.cc to lib_main.cc to prepare for libvvp.so.
To examine older history use "git log --follow lib_main.cc".
2024-01-24 10:31:13 +00:00
Cary R dc047799d6 Update displayed Copyright 2024-01-20 17:52:04 -08:00
Cary R ee14cb0eb0 Update displayed Copyright dates 2023-06-10 20:33:08 -07:00
Martin Whitaker 9cc09b8513 Remove "using namespace std" from vvp header files and fix the fallout. 2021-11-04 17:02:07 +00:00
Cary R c978d28c09 Update main component Copyright to 2021 2021-01-10 14:32:30 -08:00
Cary R 7299625ab5 Cleanup vvp with suggestions from cppcheck 2021-01-02 13:53:18 -08:00
Cary R fb237fb006 Update the user visible copyright to be 2020 2020-05-31 13:41:38 -07:00
Martin Whitaker 6887c31d8c Refactor vpi module path code.
Also restore the original behaviour of the '-M -' option, although it's
probably not needed now we add the default path last.
2018-10-29 20:33:52 +00:00
Alex Forencich a1ad6d4b51 Support IVERILOG_VPI_MODULE_PATH environment variable 2018-10-28 12:44:09 -07:00
Alex Forencich a638d1eed0 Check for too many paths specified and fix path priority so paths specified on command line supersede built-in paths 2018-10-28 12:43:40 -07:00
Cary R aacb4df1dd Fix memory leak found with valgrind 2015-12-13 14:55:05 -08:00
Cary R a65c007fdb Fix some cppcheck warnings 2015-10-02 09:43:54 -07:00
Stephen Williams df7b1879dd Rework vvp file version checking. 2015-08-17 15:37:28 -07:00
Martin Whitaker 9f4b485c1c Updated copyright dates displayed for main programs and targets. 2015-08-17 22:05:08 +01:00
Martin Whitaker c75498b1d4 Add -i (interactive) option to vvp.
This forces <stdout> to be unbuffered. This is useful when using the
mintty terminal emulator in Windows (as used by MSYS2 and CygWin),
which identifies as a pipe, not a tty.
2015-05-16 00:39:03 +01:00
Martin Whitaker cfbc90812b Enable use of MinGW ANSI stdio routines.
Defining __USE_MINGW_ANSI_STDIO=1 provides C99 compatible printf
and scanf routines, which avoids the need for workarounds for the
various failings of the Microsoft C runtime library.
2015-05-10 11:45:42 +01:00
Martin Whitaker 6a3edc63d5 Fix printf format for size_t values when using 64-bit MinGW.
The Microsoft C runtime does not support the %zu and %zd formats.
Previously these were replaced with %u and %d, but for 64-bit we
need to use %llu and %lld.
2015-05-08 20:20:14 +01:00
Cary R f682d9cad1 Clean up some more memory when using valgrind
When checking with valgrind clean up the following:

  The arguments for invalid task/function calls.

  The simulation callback queues (only needed when the runtime aborts).

  Call pthread_exit(NULL) just before exiting to cleanup dynamic loading.
2013-01-03 17:57:15 -08:00
Cary R 3fa7b3f05a Remove some valgrind warnings and a few errors
Cleanup a few more of the new constructs and fix free/delete mismatches.
2012-12-18 11:10:16 -08:00
Stephen Williams a186e5ad31 Garbage collection of DARRAY and CLASS objects.
While we're at it, provide a stub class_new runtime.
2012-12-10 19:13:43 -08:00
Arun Persaud f5aafc32f9 updated FSF-address 2012-08-29 10:12:10 -07:00
Cary R f36faa8ab3 Mingw needs to use Sleep vs sleep (also seconds go to ms) 2012-06-07 10:01:12 -07:00
Andrew Stevens 9b3d20239a Extend VPI and build to for SIMetrix cosimulation
Added: basic vpiPort VPI Objects for vpiModulkes
    vpiDirection, vpiPortIndex,   vpiName, vpiSize attributes

   Since ports do not exist as net-like entities (nets either side
   module instance boundaries are in effect connect directly in
   the language front-ends internal representation) the port information
   is effectively just meta-data passed through t-dll  interface and
   output as a additional annotation of module scopes in vvp.

Added: vpiLocalParam attribute for vpiParameter VPI objects

Added: support build for 32-bit target on 64-bit host (--with-m32
   option to configure.in and minor tweaks to Makefiles and systemc-vpi).
2012-06-07 08:00:02 -07:00
Cary R b16401301e For MinGW report an error of the two \\ are not found in the exe path
We need to print a message and fail if the two \\ characters are not found
in the executable path.
2011-08-27 10:04:33 -07:00
Cary R c69f4ef7e0 Fix spelling problem reported in pr3301924 2011-05-29 08:48:19 -07:00
Cary R 225ca1e205 Change iterators to use prefix ++ since it is more efficient.
This patch changes all the iterator code to use a prefix ++ instead
of postfix since it is more efficient (no need for a temporary). It
is likely that the compiler could optimize this away, but lets make
it efficient from the start.
2010-11-02 10:43:16 -07:00
Cary R 225ee65c31 Fix some vvp initialization problems found with cppcheck.
This patch adds a few missing initializations to various constructors
in the vvp directory. It also enhances the array alias code to copy
more values from the aliased array.
2010-10-14 17:48:12 -07:00
Cary R 3868334f5c Fix some on error memory leaks in vvp.
This patch modifies the vvp main code to cleanup if there was an
error compiling the input file. There are still a few issues, but
this takes care of most of them.
2010-06-18 15:52:21 -07:00
Cary R 3d63f664c8 Cache vpi_call error messages so we can include file and line info.
This patch caches the vpi_call error messages (task/function does
not exist, task being called as a function and function being
called as a task). This allows us to display the file name and line
number information for the invalid usage.
2010-06-08 11:11:52 -07:00
Cary R 1993bf6f69 Remove malloc.h support and for C++ files use <c...> include files.
The functions (malloc, free, etc.) that used to be provided in
malloc.h are now provided in cstdlib for C++ files and stdlib.h for
C files. Since we require a C99 compliant compiler it makes sense
that malloc.h is no longer needed.

This patch also modifies all the C++ files to use the <c...>
version of the standard C header files (e.g. <cstdlib> vs
<stdlib.h>). Some of the files used the C++ version and others did
not. There are still a few other header changes that could be done,
but this takes care of much of it.
2010-06-01 08:56:30 -07:00
Cary R 1a915005c4 Fix memory leak in vvp delay selection code.
The min/typ/max delay selection code had a memory leak.
2010-03-17 17:40:01 -07:00
Cary R 07bedc4e35 Add support for passing the delay selection to the VPI interface.
This patch adds support for passing the delay selection to the
VPI interface. It adds a new property to both the vpi_get and
vpi_get_str calls to return the current delay selection. It also
defines three constants for minimum, typical and maximum
delay selections.
2010-03-16 15:43:14 -07:00
Martin Whitaker 4818db887e Fix for LXT/LXT2 output using MinGW.
When using MinGW, routines registered via atexit() inside a
DLL are only called when the DLL is detached. If not detached
manually, DLLs are automatically detached *after* all remaining
open files are closed. This meant that by the time the LXT or
LXT2 close_dumpfile routine was called, the dump file handle
was no longer valid, so any remaining output was lost. This
patch fixes the problem by manually detaching the VPI modules.
2010-02-08 21:07:45 -08:00
Cary R fefc195540 Fix MinGW compile warnings.
This patch fixes a few compile warnings found with the latest
MinGW compiler.
2010-02-01 11:45:32 -08:00
Martin Whitaker 13cad6f268 Make vvp thread word storage consistently 64 bits.
The vvp thread word storage had previously been changed to always store
64-bit values, but some instructions still only operate on native long
values. This patch ensures all instructions that modify thread words
support 64-bit values.
2009-12-21 09:56:22 -08:00
Cary R 5fad844c30 Add support for a suffix to MinGW.
This patch adds support for a suffix in the relative path for the
MinGW compile of iverilog and vvp.
2009-12-18 13:28:46 -08:00
Stephen Williams 966e29db3b Unify the version stamp in the version_*.h header files.
Try to put all the version stamps into common version_base.h
and version_stamp.h header files. All the source programs then
get their version from these header files.

Also handle the version stamps in the man pages by using the
version_*.h header file contents to edit the version strings
in the man page title bar markers.
2009-11-27 09:25:50 -08:00
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