Commit Graph

8061 Commits

Author SHA1 Message Date
Stephen Williams c5e65b5cc8 Merge branch 'v10-branch' of github.com:steveicarus/iverilog into v10-branch 2019-10-02 18:34:48 -07:00
Stephen Williams 9554c32f42 Don't allow nil bytes in string literals.
(cherry picked from commit 30fbc020e6)
2019-10-02 18:32:04 -07:00
Cary R adfabf34bf Update error message generation to match devel 2019-10-01 19:01:47 -07:00
Stephen Williams 7dfdd344e0 Handle breakage in nested module parsing. 2019-10-01 15:35:59 -07:00
Stephen Williams 8a24adf858 Detect errors elaborating delay expressions. 2019-10-01 09:34:12 -07:00
Stephen Williams c02f22732d More robust handling of identifiers out of scope.
Handle the (otherwise and error) case of an identifier
used or accessed outside any scope.
2019-09-30 18:46:26 -07:00
Cary R ab0c4bb8c7 Update to latest GTKWave files 2019-09-29 10:00:06 -07:00
Martin Whitaker ea9b8408f5 Improve handling of invalid packed and unpacked dimensions.
As reported on iverilog-devel on 2018-10-12, a dimension size of zero
could case the compiler to go into an infinite loop. Further tests
showed that unsized or queue dimensions entered as packed dimensions
would cause the compiler to crash.

(cherry picked from commit 832adc5c74)
2019-09-14 09:42:52 +01:00
Stephen Williams 453c546589 Prepare for 10.3 release. 2019-08-15 08:31:11 -07:00
Martin Whitaker 4914f83ae3 Schedule UDP initial 0/1 assignments to occur during time 0.
This allows any always processes that are sensitive to the UDP output
to start first. This fixes a time 0 race that was found in a Lattice
Semiconductor simulation library (reported on iverilog-devel).

If the initial value is 'x', propagate the value to the UDP output
before the start of simulation, to avoid unwanted update events on
the z -> x transition on downstream nets.

(cherry picked from commit 3bdb50da29)
2019-08-09 21:09:44 +01:00
Martin Whitaker b7b22660e5 Fix assertion failure when top level module has array ports.
Reported by Kustaa Nyholm on iverilog-devel, 2017-10-17.

(cherry picked from commit a8318db21c)
2019-08-03 19:26:16 +01:00
Martin Whitaker a6eb59192e Add note that bison 2.3 is known to generate bad code (br1028).
(cherry picked from commit 326945329e)
2019-08-02 17:03:53 +01:00
Martin Whitaker dbcb7e5fb6 Fix for br1015 : assertion failure when task/function port is an array.
This is an error for Verilog and not yet supported for SystemVerilog.

(cherry picked from commit e97883b1db)
2019-08-02 17:03:42 +01:00
Martin Whitaker 2546631874 Fix for GitHub issue #256 - don't use V as Makefile variable name.
Some build systems override V on the make command line, wrongly assuming
it is the automake verbose option.

(cherry picked from commit 866cc46915)
2019-08-02 10:32:51 +01:00
StefanBruens 8e54e31bd8 Fix redefinition of YYLTYPE struct caused by wrong include order
cfparse.h defines the YYLTYPE struct in case it has not been defined, and
also declares an extern YYLTYPE cflloc which is used in cflexor.

As cfparse_misc.h defines an extended YYLTYPE, the cflloc instance in
cfparse.c has this extended type, i.e. there is a type mismatch.

Changing the include order in cflexor causes both cflexor.c and
cfparse.c to use the definition from cfparse_misc.h.

This has been uncovered by GCC when using LTO:
---
gcc -flto=8 main.o substit.o cflexor.o cfparse.o -o iverilog 
cfparse.h:105:16: warning: type of 'cflloc' does not match original declaration [-Wlto-type-mismatch]
  105 | extern YYLTYPE cflloc;
      |                ^
cfparse.c:1162:9: note: type 'struct cfltype' should match type 'struct YYLTYPE'
 1162 | YYLTYPE yylloc
      |         ^
cfparse.c:1162:9: note: 'cflloc' was previously declared here
cfparse.c:1162:9: note: code may be misoptimized unless '-fno-strict-aliasing' is used
---

(cherry picked from commit d58fde6f36)
2019-08-02 10:15:55 +01:00
Martin Whitaker 9a81d5dd65 Change minimum gperf version to 3.0.
vhdlpp uses the --ignore-case option, which isn't supported in 2.7.

(cherry picked from commit 10168d542c)
2019-08-02 10:15:47 +01:00
Martin Whitaker 564c7404a6 Fix initialisation of vvp symbol table values.
In 64-bit Windows, an unsigned long is 32 bits, so initialising the num
member of the union did not properly initialise the ptr member. The num
member isn't actually needed, so eliminate it.

(cherry picked from commit c383d2048c)
2019-08-01 13:00:26 +01:00
Martin Whitaker a01b7054fc Fix GitHub issue #231 - support packed array indexing in foreach statement.
(cherry picked from commit 6309674a8d)
2019-07-25 11:14:21 +01:00
Martin Whitaker e834302875 Fix VPI interface to APV objects.
- type is vpiPartSelect, not vpiMemoryWord
- left/right range is for part, not full word
- index is not valid for a part select

The user will now get a sensible error message if they pass part of an
array word to $dumpvars (GitHub issue #230).

(cherry picked from commit 8402696676)
2019-07-25 09:03:04 +01:00
Martin Whitaker 7f418af98a Fix for GitHub issue #239 - segfault when library file has syntax errors.
If there are errors when parsing a file, it is not safe to elaborate any
modules that have been found in that file.

(cherry picked from commit 0cb1ebddf1)
2019-07-24 10:32:44 +01:00
Martin Whitaker 5b5c0f5c69 Fix GitHub issue #243 - support arbitrary width static bit arrays in vvp.
(cherry picked from commit 8cd8bed22e)
2019-07-24 09:17:08 +01:00
Martin Whitaker 892f5f84c4 Fix white space errors.
(cherry picked from commit 4055752959)
2019-07-23 11:05:24 +01:00
Maciej Kurc cb4c98bd4e Added support for parsing attributes on function calls
Signed-off-by: Maciej Kurc <mkurc@antmicro.com>
(cherry picked from commit b619b43ddd)
2019-07-23 11:05:16 +01:00
Maciej Kurc 49066f1601 Added support for parsing attributes on port connections
Signed-off-by: Maciej Kurc <mkurc@antmicro.com>
(cherry picked from commit e6fa2625a4)
2019-07-23 11:05:01 +01:00
Martin Whitaker 5a9a4c4f94 Fix makefile rules for header files generated by bison.
bison 3.4.1 writes the header file before the c++ file. Our makefile
rules make the header files depend on the c++ files, so we need to
fix the timestamps accordingly.

(cherry picked from commit 5bb6c7f53a)
2019-06-02 19:56:42 +01:00
Cary R 6ebe707091 Update files from GTKWave 2019-05-14 22:35:13 -07:00
Martin Whitaker 9b5906b000 Fix GitHub issue #244: handle mixed signed/unsigned power operations.
The signed version of the power operation in vvp should only be used
if the exponent is signed. Both signed and unsigned versions will
produce the correct result regardless of the type of the base operand,
provided it has been appropriately extended to the result size.

(cherry picked from commit ffb34861cf)
2019-05-11 21:43:38 +01:00
Cary R 27cac593e3 Update fstapi.c to the latest from GTKWave 2019-03-26 19:59:29 -07:00
Martin Whitaker 7399f3744b Fix for GitHub issue 235: segfault when calling vpi_handle_by_name().
When vpi_handle_by_name() iterates over the VPI objects in a scope, handle
the case that vpi_get_str() returns a null value. This currently occurs if
the scope contains an enum type definition, as vpi_get_str() is not
implemented for __vpiEnumTypespec.

(cherry picked from commit 51a13e883a)
2019-03-23 17:31:07 +00:00
Stephen Williams d46e7ace70 Merge branch 'v10-branch' of github.com:steveicarus/iverilog into v10-branch 2019-03-20 09:36:06 -07:00
Martin Whitaker bda6e0ae3f Update README to say "or later" for build tool versions.
(cherry picked from commit 9369d6db57)
2019-03-16 12:42:19 +00:00
Konst Mayer bd721c1483 Fix a typo in the man page
(cherry picked from commit f95ae911d0)
2019-03-16 12:42:09 +00:00
Martin Whitaker 41c6a0e0fe Fix assertion failure on assignment to part of variable member (GitHub issue #226)
For now, output a "sorry" message, as the compiler doesn't support this.

(cherry picked from commit dc5429e5e7)
2019-01-26 17:49:57 +00:00
Martin Whitaker 37b98bbe67 Use LLONG_MIN instead of LONG_LONG_MIN.
GCC 8 no longer defines LONG_LONG_MIN. We already assume a C99 compliant
compiler in other places.

(cherry picked from commit 2ff6af254b)
2019-01-26 17:49:49 +00:00
Martin Whitaker f62d738813 Fix for GitHub issue #224 - import * does not import enum members.
(cherry picked from commit e745304cc4)
2019-01-15 21:06:51 +00:00
Martin Whitaker 19444dd2fa Restrict cast type to what's allowed by the IEEE standard.
(cherry picked from commit 7cd078e7ab)
2018-12-15 12:49:34 +00:00
Martin Whitaker bd4d73d9ae Fix GitHub issue #219 and #220 - incorrect results from SV size cast.
(cherry picked from commit 230f0bc13c)
2018-12-15 12:49:12 +00:00
Martin Whitaker edfe398e26 Undo redefinition of unique_ptr at end of header files.
It seems that clang both defines __cplusplus < 201103L and provides
unique_ptr (GitHub issue #215).

(cherry picked from commit 3612076943)
2018-12-13 19:16:30 +00:00
Cary R acae85d1a4 Fix a space issue 2018-11-13 21:59:09 -08:00
Cary R 95444b474d Update fstapi files to the latest from GTKWave 2018-10-12 21:30:12 -07:00
Martin Whitaker 3581da23e3 Don't use MinGW strtod workaround when building for MinGW-w64.
The host triplet for MinGW-w64 has changed to more closely match that
for MinGW, so we need to update the pattern in the test.

(cherry picked from commit fdf353af29)
2018-10-08 22:11:36 +01:00
Martin Whitaker 10448bf94b Fix bug in output of null character with %c format.
(cherry picked from commit 9d0d1938dc)
2018-10-08 22:11:25 +01:00
Martin Whitaker 10e7eb55ce Fix bit width when converting real value to binary/hex string in VPI.
(cherry picked from commit 5aae9ea770)
2018-10-08 22:11:16 +01:00
Martin Whitaker 062fc43fab Fix another implicit fallthrough warning.
(cherry picked from commit a03995b4da)
2018-10-08 22:11:06 +01:00
Martin Whitaker 869513a1ec Fix alloc size warning when building with recent GCC.
(cherry picked from commit 5cd0ba08b1)
2018-10-08 22:10:50 +01:00
Martin Whitaker ac2f5f0740 Fix invalid cast of TF sizetf callback.
(cherry picked from commit 6415d84ed5)
2018-10-08 22:10:17 +01:00
Martin Whitaker 4cb9ae0aa2 SIGHUP is not available in Windows.
(cherry picked from commit 3e25b04685)
2018-10-08 22:10:13 +01:00
Martin Whitaker 8e77900b9c Fix deprecated dynamic exception specification warnings.
(cherry picked from commit 4ea18196c8)
2018-10-08 22:10:07 +01:00
Martin Whitaker 400428a2b6 Fix signed/unsigned comparison warning.
(cherry picked from commit e71a76a1e2)
2018-10-08 22:10:00 +01:00
Martin Whitaker de63c0cedb Fix implicit fallthrough warnings when building with recent GCC.
(cherry picked from commit f1608e163f)
2018-10-08 22:09:50 +01:00