Commit Graph

8851 Commits

Author SHA1 Message Date
Martin Whitaker e3ed4b28e7 Fix MSYS2 pkgver to only use allowed characters. 2020-12-05 21:55:18 +00:00
Martin Whitaker 9de8577e04 Convert CI from Travis to GitHub Actions.
Copied and adapted from the master branch, with thanks to
umarcor <unai.martinezcorral@ehu.eus> who did the original
work.
2020-12-05 21:43:09 +00:00
Tim b415678d5c Clarify "Standard inconsistency" warning
Fixes #343

(cherry picked from commit 2dcbfca5d9)
2020-12-05 21:28:01 +00:00
Martin Whitaker eec64de190 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.

(cherry picked from commit 0d6a2f95a8)
2020-12-05 21:08:30 +00:00
umarcor 1baeb0d671 driver-vpi: add DESTDIR to iverilog-vpi install path
(cherry picked from commit dbe15b6a46)
2020-12-05 21:08:10 +00:00
umarcor 26aaa42831 doc: add MSYS2 readme
(cherry picked from commit ae5be2b61f)
2020-12-05 21:04:05 +00:00
Martin Whitaker 7befefc65f Fix the libveriuser TF and ACC functions to work in callbacks.
Use the new cur_instance variable to get the call handle instead of calling
vpi_handle(vpiSysTfCall, 0).

This completes a proper fix for issue #141, to replace the problematic fix
that was reverted in commit 8da8261f.

(cherry picked from commit 360d1ca447)
2020-12-05 21:03:07 +00:00
Martin Whitaker 5667c63907 Rework libveriuser to make vpiSysTfCall handles available in callbacks.
PLI 1.0 callbacks are directly associated with the instance of the system
task/function that initiated them, allowing them to access the task/function
arguments. However, we implement them using VPI callbacks, which are not so
associated. So we need to pass the VPI handle for the associated task/function
instance to the callback routine via the VPI callback user_data pointer,
because vpi_handle(vpiSysTfCall, 0) will return null when called from the
callback function.

This is the first step to a proper fix for issue #141, to replace the
problematic fix that was reverted in commit 8da8261f.

(cherry picked from commit 3f9a49ae01)
2020-12-05 21:02:53 +00:00
Martin Whitaker 580170d974 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.

(cherry picked from commit 8da8261fc3)
2020-12-05 21:02:27 +00:00
Cary R d0e2ed1509 Report a package connot be dumped with most dumpers 2020-11-29 12:44:15 -08:00
Martin Whitaker 4598341e85 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.

(cherry picked from commit 159af4d4ba)
2020-11-24 20:04:26 +00:00
Martin Whitaker 55e2c5abef Support passing class objects as task/function arguments (GitHub issure #391)
(cherry picked from commit b0b44fdd8a)
2020-11-24 17:19:03 +00:00
Martin Whitaker 20c6d83ae9 Support calls to inherited methods without "this." prefix (GitHub issue #388).
(cherry picked from commit 55e06db693)
2020-11-23 22:06:47 +00:00
Cary R f0b3056bfc Add support for an empty ';' in the description text 2020-11-20 21:42:47 -08:00
Cary R 412195e660 Update module items to include just a ';' 2020-11-20 21:01:12 -08:00
Martin Whitaker 103f1fa4bb Add enumeration assignment compatibility check for continuous assignments.
(cherry picked from commit 1b3f0dd689)
2020-11-20 17:38:10 +00:00
Martin Whitaker d521585901 Fix expression type for packed struct member access (GitHub issue #386)
A NetESelect is used for accessing packed struct members and also for
accessing dynamic array elements. In these cases the expr_type() and
enumeration() methods should reflect the member/element type.

(cherry picked from commit 0fada92389)
2020-11-20 17:38:01 +00:00
Cary R 84fa910820 Move GNU lesser to tgt-vvp since that is the only place where LGPL code is located 2020-11-14 20:31:34 -08:00
Cary R ae0ee87363 Update some queue code since deques support random access 2020-11-14 20:31:27 -08:00
Martin Whitaker c09ae8869c Fix assertion failure when no value supplied with -P option (GitHub issue #377)
(cherry picked from commit d6e01d0c55)
2020-10-24 23:06:05 +01:00
Martin Whitaker 5b1d97fac7 Support escaped identifiers as macro names.
(cherry picked from commit 359b2b65c2)
2020-10-09 12:01:20 +01:00
Martin Whitaker 794e15ac56 Fix GitHub issue #374 - ordering of `` and embedded macro expansion.
The IEEE standard does not clearly state whether the `` directive is applied
before or after embedded macros are expanded. Other simulators vary in their
behaviour. For maximum compatibility, this fix adopts the behaviour found in
Verilator, where `prefix``suffix expands to <prefix>suffix if prefix is a
defined macro, otherwise it expands to <prefixsuffix> (where <...> is the
expanded macro text). Other simulators show this behaviour in at least some
circumstances.

(cherry picked from commit 6566072741)
2020-10-09 12:01:13 +01:00
Martin Whitaker 50cd3b107c Refactor task declaration parsing and fix warning for empty port list.
1364-2005 and later allow a task declaration with an empty port list.

(cherry picked from commit 6880b39770)
2020-10-03 09:38:46 +01:00
Martin Whitaker 59b67b69f6 Fix width of localparam created from genvar when using -gstrict-expr-width.
(cherry picked from commit c4883da334)
2020-10-01 11:37:04 +01:00
Stephen Williams 84b4ebee0c Mark version as stable. 2020-09-26 15:44:25 -07:00
Stephen Williams e66fbc9bf9 Prepare for Version 11.0 2020-09-26 13:36:43 -07: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
Stephen Williams a831108c96
Merge pull request #371 from larsclausen/enum_implicit_reg
parse.y: Mark enum output ports always as IMPLICT_REG
2020-09-21 08:10:18 -07:00
Lars-Peter Clausen 1064543d27 parse.y: Mark enum output ports always as IMPLICT_REG
Unless explicitly declared a wire an enum output port is of variable type
and should be marked as IMPLICT_REG.

Currently this is only done when the base type of the enum is `logic`. But
it should be done for all enums regardless of their base type.

Without this change for example the following snippet

```
  typedef enum {
      A,
      B
  } E;

  module M (
      input E ei,
      output E eo
  );

      always_comb eo = ei;

  endmodule
```

fails with the following error message

  test_enum.sv:11: error: eo is not a valid l-value in M.
  test_enum.sv:8:       : eo is declared here as wire.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2020-09-20 19:14:28 +02:00
Stephen Williams b8c5fd6314
Merge pull request #370 from larsclausen/remove-empty-file
tgt-vvp: Remove (almost) empty file vector.c
2020-09-19 08:19:38 -07:00
Lars-Peter Clausen 1ec5a441f3 tgt-vvp: Remove (almost) empty file vector.c
Since commit 62fce50f8c ("Remove dead code for allocate_vec handling.")
vector.c only contains the license header and some include directives
but no actual code.

Remove the file.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2020-09-19 12:39:04 +02: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 d8556e4c86 Fix handling of the SV `` delimiter when combined with macro usage.
Given a macro definition like this:

  `define name  `macro``text

the preprocessor should expand `macro, not `macrotext, when it expands
`name. This also ensures that

  `define name(p,s)     p``_``s
  `define PREFIX        my_prefix
  `define SUFFIX        my_suffix

  `name(`PREFIX, `SUFFIX)

expands to

  my_prefix_my_suffix

as the user would expect.
2020-08-24 20:29:15 +01:00
Martin Whitaker dc2aa6efa0 Fix handling of SV `" and `\`" escape sequences in macros (GitHub issue #366).
`" overrides the normal behaviour of disabling macro expansion within
a string.
2020-08-24 14:48:40 +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
Martin Whitaker bd0133b386 Fix GitHub issue #361 - explicit cast check on function return value.
A function call returning an enumeration value can be assigned to an
enumeration variable without an explict cast.
2020-08-14 12:30:05 +01: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 61884e559c Add support for assigning a queue using a normal concatenation 2020-08-09 21:10:30 -07:00