Commit Graph

2023 Commits

Author SHA1 Message Date
Cary R 0a429dba99 And another compiler warning fix 2020-12-14 20:22:12 -08:00
Cary R 7f2ee99ebd Fix some compiler warnings 2020-12-14 20:06:40 -08:00
Cary R b7b7280794 Merge branch 'master' of github.com:steveicarus/iverilog 2020-12-13 23:02:43 -08:00
Cary R 05a4e72b1a Add support for passing a null object to $display 2020-12-13 23:02:11 -08:00
Stephen Williams e5f68d7c89 Handle dynamic queue objects in event context
In the rare cases where DARRAY signals are in the network, handle
them by creating the proper ivl_nexus_t node. This also implements
the receive of vvp_object_t objects bu vvp_fun_anyedge_sa. This
together makes it possible for IVL_VT_DQUEUE objects to be in
wait lists.

This fixes #412
2020-12-13 18:22:34 -08:00
Martin Whitaker 0d6a2f95a8 Fix vvp segfault on Windows when vvp_net_ptr_t values exceed 4GB.
Under Windows unsigned long is 32 bits, so we must use unsigned long long
values for 64-bit address masks.
2020-12-04 18:47:58 +00:00
Martin Whitaker 8da8261fc3 Fix segfault under mingw32 due to dynamic cast of invalid pointer value.
sync_cb::run_run() attempts to cast the obj field of the callback data to a
__vpiSysTaskCall pointer. But a sync_cb object is only used for simulation
time callbacks, where the obj field is (mostly) not used, so I can't see
that would ever succeed. As the obj field is not required to be set by the
user, the dynamic cast results in undefined behaviour, so mingw32 is not to
blame.

This code was introduced by Johann Klammer in commit c79df7c44, but the user
klammerj and all trace of that pull request have vanished from GitHub, and
there is no associated regression test, so I can't establish the rationale
for it.
2020-12-02 12:27:42 +00:00
Marlon James 65b4c17451 Skip all removed VPI callbacks 2020-11-30 09:22:18 -08:00
Stephen Williams dee68faf80
Merge pull request #396 from steveicarus/array-copy
Fix dynamic array assignment to make a copy of the rvalue.
2020-11-26 13:17:30 -08:00
Stephen Williams 3c2fb6a601 Fix dynamic array assignment to make a copy of the rvalue.
IEEE Std 1800-2017 Section 7.6 Array assignments

Assignment of a dynamic array creates a duplicate of the source,
so that assignments to the copy don't impact the original. Handle
all sorts of dynamic array base types.
2020-11-26 12:52:06 -08:00
Martin Whitaker 159af4d4ba In Windows, export VPI functions from vvp.exe (GitHub issue #395)
This is to support cocotb, who don't use our vpi_user.h and libvpi.a,
instead building their own import library to directly link to vvp.
2020-11-24 20:01:12 +00:00
Cary R d209e7533a Update some queue code since deques support random access 2020-11-14 17:09:51 -08:00
Martin Whitaker 8f8737198c Bump version to 12.0 in vvp/examples/*.vvp. 2020-10-03 10:57:25 +01:00
Stephen Williams fec003bd36 vvp: Remove a dead rule for the .port_info statement.
We left an old rule that matched a port_info statement without a
trailing semicolon. Remove that rule ahead of the release.
2020-09-22 14:18:24 -07:00
Martin Whitaker 10685ed89d Remove redundant test for whether a vvp thread is joinable.
Since commit 15cda5fe, forked threads are never embedded in the parent
thread, so we no longer need the special case code that ensured that
task/function calls were reaped before a join.

This also fixes GitHub issue #368.
2020-09-11 21:18:54 +01:00
Martin Whitaker bd0a1c75ed Add support for string values in event expressions (GitHub issue #365). 2020-08-23 11:06:15 +01:00
Martin Whitaker a69de8b94a Rework last value storage in vvp_fun_anyedge functors.
This prepares the way to support strings and object handle values.
2020-08-23 11:04:44 +01:00
Cary R 0a69303164 Refactor array store for string/real and skip saving when given an undefined index 2020-08-16 19:49:34 -07:00
Cary R 505ee1a96c Refactor store for real/string 2020-08-16 19:23:41 -07:00
Cary R aa013a0ef0 Refactor store prop 2020-08-16 19:08:34 -07:00
Cary R 4bf502741d Refactor store DAR 2020-08-16 18:37:28 -07:00
Cary R 8e3afebb7b Refactor set DAR object 2020-08-16 18:00:41 -07:00
Cary R 43441066eb More refactoring in vthread 2020-08-13 23:28:18 -07:00
Cary R f3e4287d0a Refactor prop routines to use common template 2020-08-13 22:30:21 -07:00
Cary R 52c3b901e0 When available print file/line information with thread error messages 2020-08-13 22:05:31 -07:00
Cary R 294005c5b2 Refactor load DAR routines 2020-08-13 21:48:52 -07:00
Cary R 3993241d04 Refactor more of the queue code 2020-08-11 19:46:36 -07:00
Cary R f6d8cfc80c Add file/line to Sorry queue message 2020-08-11 19:46:22 -07:00
Cary R 112ebb48d8 Add file/line information to procedural warnings and darray fixes
When -pfileline=1 is used the queue procedural warnings have file
and line information added to the messages. Also switch the trace
debugging to be off by default.

Also, Add some preliminary missing darray functionality.
2020-08-10 22:01:55 -07:00
Cary R bff115b9f7 Add initial support for assigning between queues and darrays 2020-08-07 00:23:43 -07:00
Cary R a0ef23605a Update some functions to use inline 2020-08-04 22:11:36 -07:00
Cary R 538a03ba8e Add templates for queue push 2020-08-04 22:07:02 -07:00
Cary R f638e9dd5d Add templates for queue pop 2020-08-04 21:48:47 -07:00
Cary R 84eb70660d Switch qinsert to use a template 2020-08-04 21:14:17 -07:00
Cary R d1d6c0f5d2 Start refactoring the queue routines 2020-08-03 23:45:56 -07:00
Cary R 199ed39abe Report when the array pattern is larger than the maximum queue size 2020-08-02 23:40:35 -07:00
Martin Whitaker 8e4cc8e887 Use GNU make pattern rules to handle multiple file output from bison.
With a pattern rule, the recipe will only be executed once, even when
the rule has multiple targets. Using this to handle the output from
bison is included as an example in the GNU make manual.

This fixes the makefiles so that bison-generated header files will be
regenerated if they are deleted.
2020-07-30 16:27:01 +01:00
martinwhitaker a4c9919e3a
Merge pull request #349 from hzeller/fix-bison-include
Bison includes its generated header in *.cc. Generate with correct name.
2020-07-30 15:53:21 +01:00
Cary R a2ba8a16b1 Add support for inserting into a queue 2020-07-29 23:00:19 -07:00
Henner Zeller 5b699c1be7 Bison includes its generated header in *.cc. Generate with correct name.
The current bison (3.7) generates a *.cc file that includes the header
it generated. For parse.cc this would be parse.hh. Right now, we rename
this header to have a common name used in other files, but this results
in a compile error for the parse.cc file:

parse.cc:462:10: fatal error: parse.hh: No such file or directory
  462 | #include "parse.hh"
      |          ^~~~~~~~~~

Fix this by telling bison to output the header file to the correct
filename in the first place so that we don't have to rename it.
(using the --defines instead of -d option).

This looks like a bison specific option not available in Posix yacc;
but looks like we're requiring bison anyway.

Signed-off-by: Henner Zeller <h.zeller@acm.org>
2020-07-29 15:29:08 -07:00
Martin Whitaker e69549034d Fix potential buffer overflows (GitHub issue #346). 2020-07-28 13:17:57 +01:00
Cary R fdd902e446 Remove some clang warnings 2020-07-27 21:56:29 -07:00
Cary R 14ade1a9f4 Pass the max size when storing to a queue 2020-07-27 21:24:22 -07:00
Cary R c969c324ed Add initial support for using a queue element as an L-value 2020-07-26 14:02:29 -07:00
Cary R d1b75d9407 Update some queue warning messages and optimize element erase 2020-07-25 15:32:28 -07:00
Cary R 1a4345cce9 Add the ability to delete an element of a queue 2020-07-25 00:49:42 -07:00
Cary R e94291c88f Handle negative and undefined queue addresses correctly 2020-07-23 22:49:33 -07:00
Cary R f0f045f1f9 Add warning messages when popping from an empty queue 2020-07-23 22:04:27 -07:00
Cary R 1b52a4a578 Don't fail when pushing/poping from an empty queue 2020-07-23 19:12:35 -07:00
Cary R e1870acfac Return the correct value when a queue or darray references an undefined element 2020-07-22 21:47:37 -07:00