Commit Graph

323 Commits

Author SHA1 Message Date
Martin Whitaker c8a85877c2 Allow io-range-error warnings to be disabled (issue #788)
It was common practice in the past to just declare a port direction
and declare it as a vector in a subsequent type declaration. Versions
of the standard up to and including 1364-2005 include an example that
does this (e.g. 1364-2005 section 12.3.7). Users may have old or
third-party code that they can't or don't want to modify, so allow
the warning to be suppressed by including it in the anachronisms
category.
2022-12-18 12:12:26 +00:00
Jevin Sweval 5a90b7857a Add -R option to print runtime paths (for now, includedir only)
This allows for, e.g., a Makefile to find the location of vpi_user.h in a portable manner. Similar to pkgconfig.
2022-07-02 18:05:26 -07:00
Miodrag Milanovic 57cfbc0cea Fix find_ivl_root for OSX 2022-01-05 09:23:48 +01:00
Martin Whitaker 56d2d798ec Don't exit when ivl_root not found - the user may have supplied it.
When running 'make check' without having an installed copy, find_ivl_root()
will fail on Unix systems that don't provide /proc/self/exe (e.g. MacOS).
2021-01-28 00:13:23 +00:00
Cary R e02410d519 Add define to indicate Icarus synthesis 2021-01-14 00:15:48 -08:00
Cary R c978d28c09 Update main component Copyright to 2021 2021-01-10 14:32:30 -08:00
Cary R dbd63450d9 Cleanup space in ivlpp command generation 2021-01-10 14:32:23 -08:00
Cary R e0313cecbd Update driver and acc/tf directories with changes suggested by cppcheck 2021-01-02 13:45:41 -08:00
Cary R 1d318c4393 Update cppcheck to not run posix and add some -U flags 2021-01-02 13:23:59 -08:00
Martin Whitaker 2e4bf05e21 Avoid possible truncation of path strings when writing config file. 2021-01-01 19:31:05 +00:00
Martin Whitaker 8f736c7df7 Fix syntax in fprintf calls ("<" -> ","). 2020-12-02 11:32:19 +00:00
Stephen Williams 99bb0d15b2 Report error if command file is not properly terminated.
Command file lines must all be terminated by EOL. If the last line
is not properly terminated, report an error.
2020-11-26 16:11:59 -08: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
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 ed7734c795
Merge pull request #328 from purdeaandrei/f_allow_libext_and_y_commands_to_be_given_in_any_order
Allow +libext+ and -y commands to be given in any order (and small fix in manpage)
2020-06-03 14:57:09 +01:00
Cary R fb237fb006 Update the user visible copyright to be 2020 2020-05-31 13:41:38 -07:00
Purdea Andrei 13f6a916b3 man page: fix typo regarding +libext+ command 2020-05-19 22:49:35 +03:00
Huang Rui 11001f58d5
Thoroughly fix parallel installation issues
In PR #300, @xdch47 pointed out a stable way to fix parallel
installation problems.

This fix applied the method, thanks!

Signed-off-by: Huang Rui <vowstar@gmail.com>
2020-02-12 22:42:04 +08:00
Huang Rui 0602ef46c6 [17/20]driver/Makefile.in:fix install timestamp check
Fix tgt-fpga/Makefile.in vvp/Makefile.in doc

Fix bug: https://bugs.gentoo.org/705412
Fix bug: https://github.com/gentoo/gentoo/pull/14096
Related: https://github.com/steveicarus/iverilog/pull/294

Signed-off-by: Huang Rui <vowstar@gmail.com>
2020-02-12 22:08:40 +08:00
Huang Rui d49d26a5c5
Fix fails to build with -fno-common or gcc-10
See also: https://bugs.gentoo.org/706366

gcc-10 and above flipped a default from -fcommon to -fno-common:
https://gcc.gnu.org/PR85678

Usually all it takes is to add a few 'extern' declarations and
move definitions from header files to modules. I've port iverilog
to gcc-10 accroding to this guide:
https://wiki.gentoo.org/wiki/Gcc_10_porting_notes/fno_common

To fix this, I analyzed the code, and found ``pli_trace`` has been
defined at here:
https://github.com/steveicarus/iverilog/blob/v10_3/libveriuser/priv.c#L24

So I changed ``FILE* pli_trace;`` to ``extern FILE* pli_trace;``.

The var ``current_file`` only in ``cfparse_misc.h``, I changed it
from ``char *current_file;`` to ``extern char *current_file;`` and
declaring it in cflexor.lex

And then it works.

Signed-off-by: Huang Rui <vowstar@gmail.com>
2020-01-29 00:08:59 +08:00
Martin Whitaker f0326bc9c2 Fix bug in converting directory separators for MinGW. 2019-10-23 13:05:48 +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 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 9f93989944 Extract system function return types from VPI modules, not SFT files. 2019-10-21 13:40:40 +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 c9d849ed7b Fix style in iverilog man page. 2019-10-05 13:41:50 +01:00
Martin Whitaker 05641f386f Add -g option to only enable supported assertion statements. 2019-10-05 13:37:03 +01:00
Cary R ea4e41207c Update cppcheck standards that are checked 2019-09-30 22:14:15 -07:00
Martin Whitaker 714b211d9f Document the iverilog '-i' option in the man page. 2019-09-23 20:10:38 +01:00
Martin Whitaker 791c056b77 Document -gassertions/-gno-assertions in driver man page. 2019-09-20 21:30:43 +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
Konst Mayer f95ae911d0 Fix a typo in the man page 2019-03-13 00:16:41 +07:00
Cary R f03033e612 Update flex destroy routines to work for version 2.6 and greater 2017-11-16 19:11:50 -08:00
Martin Whitaker 02daffc97e Add option to only warn about macro redefinitions that change the text.
A common use case (prior to the introduction of localparam) was to
use macros to define constant values, and to put global constant
values in an include file that gets included by each source file.
This will generate a lot of spurious warnings if we warn about all
redefinitions. Make this new option the default for -Wall.
2017-11-08 19:50:42 +00:00
Martin Whitaker e408550d9d Merge branch 'master' of https://github.com/nekromant/iverilog into nekromant-master 2017-11-06 20:59:27 +00:00
Martin Whitaker dfddbea26b First step towards supporting separate compilation units in SV.
This adds a -u option to the driver to allow the user to specify that
they want each source file to be treated as a separate compilation
unit, and modifies the compiler to accept a list of files (either on
the command line or via a file specified by a new -F option). This
list of files is then preprocessed and parsed separately, causing all
compiler directives (including macro definitions) to only apply to the
file containing them, as required by the SystemVerilog standard.
2017-10-31 20:36:27 +00:00
Andrew Andrianov 3e87a4d242 driver: Add -Wno-macro-redefinition, properly pass -Wredef to ivlpp
Signed-off-by: Andrew Andrianov <andrew@ncrmnt.org>
2017-10-22 13:53:07 +03:00
Andrew Andrianov 94e42e5bfc driver: Update manpage
Signed-off-by: Andrew Andrianov <andrew@ncrmnt.org>
2017-10-19 11:40:50 +03:00
Andrew Andrianov 6c2fba1139 driver: Implement -Wr handling for macro redefinitions
Signed-off-by: Andrew Andrianov <andrew@ncrmnt.org>
2017-10-19 11:40:07 +03:00
Cary R 917d754e37 Fix space issue 2017-07-22 13:00:50 -07:00
8tab cac5388451 Return if unable to open dependencies file
Return and print an error if iverilog is unable to open dependencies
file. User can pass e.g path to existing directory in '-M' option,
which makes fopen to return NULL followed by crash in fclose.
2017-04-09 23:18:49 +02:00
Mikael Tuomisalo c967ed238c Added option for ignoring errors about missing modules 2017-03-21 17:34:44 +02:00
Martin Whitaker 7ddc514518 Allow library files to be specified on the iverilog command line.
This was already supported in command files, using the '-v' flag.
'-v' is already in use on the command line, so use '-l' instead,
and make that an alias for '-v' in command files.
2016-10-02 18:57:32 +01:00
Martin Whitaker 41075a45e6 Fix for GitHub issue #121 - correctly determine ivl_root.
Pull request #116 added the ability for the iverilog driver to determine
ivl_root from the location of the iverilog executable (this is needed to
support relocation at the time iverilog is installed). However, the code
did not support the possible variations in the library path name.
2016-08-24 00:00:24 +01:00
Cary R 9cf23b4c3b Make getting ivl_root more robust 2016-08-14 19:41:35 -07:00
Cary R 446e825ed3 Fix space issues 2016-08-14 19:37:40 -07:00
Martin Whitaker 7d5f6c551a Fix unused variable warning and assumed buffer size from last merge. 2016-07-23 12:01:58 +01:00
Thomas Fors cada40ebd1 Updated comments 2016-07-18 08:10:41 -05:00
Thomas Fors 3afbb903d6 Use /proc/self/exe on linux, if it exists, to find ivl_root 2016-07-18 08:05:16 -05:00