Commit Graph

10116 Commits

Author SHA1 Message Date
Martin Whitaker 8dc395940d Fix issue #298: elaborate types in the scope where they were declared.
The compiler elaborates types on the fly as they are used. For user-
defined types (typedefs) we must do the elaboration in the scope where
the type was declared, not in the scope where it is used.
2019-12-22 17:29:23 +00:00
Martin Whitaker e8e2c35df0 Fix some errors in pform dumps. 2019-12-22 11:26:13 +00:00
Martin Whitaker 732a763188 Record typedef name in data_type_t struct.
This will be used to locate the scope where the type was declared.
2019-12-22 11:21:05 +00:00
Martin Whitaker 95147a2cc2 Record data type for all pform "wires" added the new way.
For unpacked arrays, record both the array type and the base type.
This will be needed to elaborate typedefs in the correct scope.
2019-12-22 11:03:50 +00:00
Martin Whitaker 465e0d2710 Allow classes to reference declarations in their enclosing scope(s).
The original implementation made each class a root scope. They should
be added to the scope hierarchy just like any other declaration.
2019-12-22 10:46:38 +00:00
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
Stephen Williams b25df08c99 Fix possible buffer overflow. 2019-11-21 18:48:57 -08:00
Stephen Williams f147cf9c61 Merge branch 'master' of github.com:steveicarus/iverilog 2019-11-21 18:35:55 -08:00
Stephen Williams 7cf8bb9875 Put some buffer overflow checks in.
Also, do a minor rework of StringHeap, and have it check its
assumptions more thoroughly.
2019-11-21 18:35:43 -08:00
Martin Whitaker 351a4e5f5e Improve vvp handling of excessively large shift distances. 2019-11-16 12:11:49 +00:00
Martin Whitaker 0a4cae2644 Fix vvp %shift instructions to treat right operand as unsigned.
1364-2005 section 5.1.12 says "The right operand is always treated
as an unsigned number".

This fixes GitHub issue #283.
2019-11-15 21:24:47 +00:00
Martin Whitaker 4a8f4d65d0 Fix spelling of pulsere_flag in vpi_user.h (from Pablo Bleyer). 2019-11-12 18:01:39 +00:00
Martin Whitaker 9f712429c8 Fix elaboration of void functions with no arguments (GitHub issue #281)
N.B. commit 82c8a495 incorrectly referenced issue #281. It should have
referenced issue #280.
2019-11-09 20:16:25 +00:00
Martin Whitaker a8f71d3c92 Additional cleanup of void function elaboration. 2019-11-09 20:15:31 +00:00
Martin Whitaker cab9526e6c vlog95 target: better solution for void functions with no arguments. 2019-11-09 20:14:57 +00:00
Martin Whitaker 39238fd1cd vlog95 target: ! operator does not require explicit type conversion. 2019-11-09 16:52:28 +00:00
Martin Whitaker 58aa08ab64 Handle SV void functions in vlog95 target. 2019-11-09 16:14:09 +00:00
Martin Whitaker 82c8a49573 Fix for issue #281 - the condition operator may return a valid enum type.
If the condition expression is 2-state, the result won't be blended, so
the result will be a valid enum value if both true and false expressions
return the same enum type.
2019-11-09 13:11:16 +00:00
Stephen Williams 7feb26ff6b Cleaner elaboration of void functions.
This fixed githun issue # 281.
2019-11-07 14:25:51 -08:00
Martin Whitaker a621fa48a6 Merge branch 'sft-rework' 2019-11-04 22:24:45 +00:00
Martin Whitaker d1d409fd88 Add version check for VPI routines callback. 2019-10-30 20:16:30 +00:00
Stephen Williams eeeb9ff099 Create files with default suffix when $dumpfile doesn't include a suffix. 2019-10-30 12:23:24 -07:00
Stephen Williams d718e7b468 Handle case that strings are arguments of functions/tasks.
When strings are arguments to functions/tasks, that doesn't suddenly
make them implicitly scalar. Strings are vectors and should be treated
that was, even if they are IMPLICIT_REG.
2019-10-29 22:58:48 -07:00
Martin Whitaker 16e8563c6e Fix for GitHub issue #277 - incorrect sensitivity calculation.
The fix for the compiler hang when calculating the sensitivity list
for an always_comb construct containing recursive function calls
could cause the compiler to ignore sequential calls to the same
function, and thus not add the arguments of those calls to the
sensitivity list.
2019-10-28 21:01:42 +00:00
Martin Whitaker 9fb952ed72 Use functions instead of macros for VPI routine redirection in Windows. 2019-10-27 09:06:55 +00:00
Martin Whitaker 3f1253039a Only use VPI routine jump table in Windows. 2019-10-25 10:07:57 +01:00
Martin Whitaker f0326bc9c2 Fix bug in converting directory separators for MinGW. 2019-10-23 13:05:48 +01:00
Martin Whitaker 160bfbf2fc Another makefile fix. 2019-10-23 13:03:32 +01:00
Martin Whitaker c98f8b17ba Support IVERILOG_VPI_MODULE_PATH in compiler driver.
Also make sure we convert '/' to '\' before doing any searches when
running in Windows.
2019-10-23 12:26:28 +01:00
Martin Whitaker a8fc131fc9 Use more explicit name for VPI routine jump table. 2019-10-23 11:41:14 +01:00
Martin Whitaker 1c26bcef2d Update vpi.txt. 2019-10-23 10:04:58 +01:00
Martin Whitaker 79d3a21b65 Minor code tidy-up. 2019-10-22 21:52:52 +01:00
Martin Whitaker f5cb5b2d90 Make sure vlog_startup_routines is exported from Windows VPI modules. 2019-10-22 20:33:52 +01:00
Martin Whitaker 5f0bbe4cdb One more makefile fix. 2019-10-22 20:30:09 +01:00
Martin Whitaker e6b0396e6f Makefile fixes. 2019-10-22 16:51:14 +01:00
Martin Whitaker a59b183bd1 Allow VPI modules to be loaded by multiple clients under Windows.
The old scheme of linking the VPI modules with the vvp exports meant they
did not work when loaded by the compiler. Instead, let each client create
a jump table for the VPI routines and pass that to each VPI module as it
is loaded.
2019-10-22 16:00:13 +01:00
Martin Whitaker e63135b412 Add -BM driver option to specify different base path for VPI modules.
This is needed for 'make check'.
2019-10-21 19:43:00 +01:00
Martin Whitaker 1c7f7aedbe Update man page. 2019-10-21 15:33:39 +01:00
Martin Whitaker 8d3e895593 Remove obsolete SFT files. 2019-10-21 13:53:53 +01:00
Martin Whitaker d1ae818a9f Remove static system function return descriptors.
The information is provided by the VPI modules.
2019-10-21 13:49:19 +01:00
Martin Whitaker a92a3074c0 Fix some missing/incorrect function return types in the system VPI modules. 2019-10-21 13:45:09 +01:00
Martin Whitaker 9f93989944 Extract system function return types from VPI modules, not SFT files. 2019-10-21 13:40:40 +01:00
Cary R df38460d26 Add the missing ivl_stmt_case_quality to ivl.def 2019-10-20 16:35:31 -07:00
Cary R 077d8d6c4d Update fstapi.c to latest from GTKWave 2019-10-20 16:35:24 -07:00
Martin Whitaker 1069a0ef02 Don't evaluate built-in system functions if they are overridden.
We don't support evaluating user-defined system functions at compile
time. If possible, defer evaluation until run time. If used in a
constant expression, output a "sorry" message.
2019-10-19 16:12:17 +01:00
Stephen Williams bf655003e8 Merge branch 'master' of github.com:steveicarus/iverilog 2019-10-14 14:11:58 -07:00
Stephen Williams 0abf91ca4e Make vvp exit with FAILURE if $fatal is used to exit the simulation. 2019-10-14 14:11:50 -07:00
Martin Whitaker cb69a321ab Enable user-defined system functions to override built-in functions.
Fixes bug reported on iverilog-devel on 2019-10-13.
2019-10-14 21:41:58 +01:00
Martin Whitaker b82c185051 iverilog: Allow the user to specify the location of VPI modules.
Make it explicit in the manual that a path can be supplied with the -m
option, and when it is, search for a SFT file there, not in the base
directory.
2019-10-14 21:34:40 +01:00
Martin Whitaker 9f7dc732ab Add error recovery for invalid cast expressions. 2019-10-11 19:04:23 +01:00