Commit Graph

8851 Commits

Author SHA1 Message Date
Stephen Williams 65aff65344 Better job choosing unique scope-local symbols during elaboration. 2019-09-25 12:18:41 -07:00
Stephen Williams ecd7b39244 Merge branch 'master' of github.com:steveicarus/iverilog 2019-09-24 15:05:51 -07:00
Stephen Williams 7b66de0711 Handle nested packed strucdts in r-values. 2019-09-24 15:05:39 -07:00
Martin Whitaker 714b211d9f Document the iverilog '-i' option in the man page. 2019-09-23 20:10:38 +01:00
Martin Whitaker abd63e80e1 With '-i', don't return an error when there are no top-level modules.
The '-i' option is there to allow the compiler to be used to check an
incomplete design for errors. With no top-level modules, nothing will
be elaborated, but at least will be checked for syntax errors.
2019-09-23 20:05:03 +01:00
Martin Whitaker 791c056b77 Document -gassertions/-gno-assertions in driver man page. 2019-09-20 21:30:43 +01:00
Martin Whitaker 823a508d6b Implement SV immediate assertions. 2019-09-20 21:30:43 +01:00
Stephen Williams 9e10645722 Merge branch 'master' of github.com:steveicarus/iverilog 2019-09-17 14:12:43 -07:00
Stephen Williams 2aa7700970 Add support for packed arrays in nested struct l-values. 2019-09-17 13:34:36 -07:00
Stephen Williams 1c281c2d77 Support nested struct l-values. 2019-09-16 13:50:17 -07:00
Martin Whitaker 41ac0b2621 Include wires in items imported by an "import ::*". 2019-09-16 20:42:32 +01:00
Martin Whitaker d6391490e3 Resize vector before assigning to a dynamic array word.
Failing to do this leads to an assertion failure in vvp.
2019-09-16 20:39:19 +01:00
Martin Whitaker 02ee1c65d0 Support dynamic array initialisation in variable declarations. 2019-09-16 20:35:27 +01:00
Stephen Williams b639c4c9aa Clean up some debug dump formatting. 2019-09-15 21:17:16 -07:00
Martin Whitaker 832adc5c74 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.
2019-09-14 09:10:52 +01:00
Martin Whitaker a6bcbc3d1d Remove obsolete private VPI functions. 2019-09-13 08:40:58 +01:00
Martin Whitaker a0ef6c4b62 Fix design dump to correctly report cast operations. 2019-09-11 22:14:03 +01:00
Martin Whitaker c066e2d15c Properly implement casts from strings and dynamic arrays to vectors.
As discussed on iverilog-devel (2018-03-09), the existing implementation
(using Icarus-specific vpi functions) only worked with assignments to
simple variables, and could not be easily modified to work more generally.
So use the new vvp instructions added in the previous two commits.
2019-09-11 22:08:46 +01:00
Martin Whitaker 1aa22735ce Add new %cast/vec2/dar and %cast/vec4/dar instructions to vvp. 2019-09-11 21:56:27 +01:00
Martin Whitaker 74ff44314e Add new %cast/vec4/str instruction to vvp. 2019-09-11 21:56:09 +01:00
Martin Whitaker 34bb98676a Fix assertion failure on illegal SV cast.
Bug reported on iverilog-devel on 2018-02027.
2019-09-07 14:35:19 +01:00
Martin Whitaker b43fcccc0f Add support for PATHPULSE, PATHPULSEPERCENT, and PERIOD in SDF parser.
As requested on iverilog-devel. These are all parsed then ignored for now.
2019-08-24 00:23:29 +01:00
Martin Whitaker 3bdb50da29 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.
2019-08-09 21:00:10 +01:00
Martin Whitaker a8318db21c Fix assertion failure when top level module has array ports.
Reported by Kustaa Nyholm on iverilog-devel, 2017-10-17.
2019-08-03 18:52:49 +01:00
Martin Whitaker 7fa781d5f3 Re-enable disabled compiler warnings for Windows builds. 2019-08-03 12:41:38 +01:00
Martin Whitaker 326945329e Add note that bison 2.3 is known to generate bad code (br1028). 2019-08-02 15:45:20 +01:00
Martin Whitaker e97883b1db Fix for br1015 : assertion failure when task/function port is an array.
This is an error for Verilog and not yet supported for SystemVerilog.
2019-08-02 15:34:31 +01:00
Martin Whitaker 866cc46915 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.
2019-08-02 10:27:40 +01:00
Martin Whitaker b7769dd059 Merge branch 'fix-cfparse-include-order' of https://github.com/StefanBruens/iverilog 2019-08-01 19:13:31 +01:00
Martin Whitaker 10168d542c Change minimum gperf version to 3.0.
vhdlpp uses the --ignore-case option, which isn't supported in 2.7.
2019-08-01 19:11:44 +01:00
Martin Whitaker c383d2048c 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.
2019-08-01 12:34:47 +01:00
StefanBruens d58fde6f36
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
---
2019-07-26 21:26:08 +02:00
Martin Whitaker 893bb62d82 Fix broken 'make install' in MSYS2.
The commands added to copy MINGW DLLs into the install directory only
work when cross-compiling.
2019-07-26 17:29:27 +01:00
Martin Whitaker 6309674a8d Fix GitHub issue #231 - support packed array indexing in foreach statement. 2019-07-25 11:10:08 +01:00
Martin Whitaker 8402696676 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).
2019-07-25 08:58:00 +01:00
Martin Whitaker 0cb1ebddf1 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.
2019-07-24 10:22:55 +01:00
Martin Whitaker 8cd8bed22e Fix GitHub issue #243 - support arbitrary width static bit arrays in vvp. 2019-07-24 09:15:44 +01:00
Martin Whitaker 89cbc42094 Reset parser tracking variables when starting a new compilation unit.
This fixes the problem reported in GitHub issue #254, where if the
parser aborted on one compilation unit, spurious errors were reported
for the next compilation unit.
2019-07-23 22:18:39 +01:00
Martin Whitaker acdd78db7d Merge branch 'primitive_redefinition' of https://github.com/thasti/iverilog
- make primitive redefinition a warning, not an error
- make edge-sensitive ifnone a warning, not an error

This allows Icarus to be used to simulate designs using third-party
cell libraries that contain such things.
2019-07-23 21:53:57 +01:00
Stefan Biereigel ca19ebe5d5 remove Error:/Warning: prefix from VLerror/VLwarn 2019-07-23 18:58:20 +02:00
Martin Whitaker 4055752959 Fix white space errors. 2019-07-23 10:08:37 +01:00
Martin Whitaker 93ea864106 Merge branch 'antmicro-attribute_support' 2019-07-23 10:06:57 +01:00
Maciej Kurc b619b43ddd Added support for parsing attributes on function calls
Signed-off-by: Maciej Kurc <mkurc@antmicro.com>
2019-06-05 16:42:52 +02:00
Maciej Kurc e6fa2625a4 Added support for parsing attributes on port connections
Signed-off-by: Maciej Kurc <mkurc@antmicro.com>
2019-06-05 16:28:45 +02:00
Martin Whitaker 5bb6c7f53a 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.
2019-06-02 18:50:18 +01:00
Stefan Biereigel c6cf83a13a make ifnone-error a warning 2019-05-17 16:17:08 +02:00
Stefan Biereigel 0cfb66ecbc fix warning call 2019-05-17 15:32:45 +02:00
Stefan Biereigel 7f5145d758 emit only warning for primitive redefinition 2019-05-17 15:20:49 +02:00
Cary R e93ee3967e Update cppcheck suppression file 2019-05-14 22:34:58 -07:00
Cary R 4c58b88792 Update files from GTKWave 2019-05-14 22:34:34 -07:00