Commit Graph

245 Commits

Author SHA1 Message Date
Stephen Williams fb3969b5b8 Add command line control over anachronism warnings. 2012-04-30 16:30:24 -07:00
Cary R 9c99bce054 Update lex/yacc builds to be consistent and to support parallel builds
Not all the lex/yacc (flex/bison) targets were using a consistent syntax.
This patch fixes that and explicitly serializes the *.c/*.cc and *.h build.
Not doing this was causing problem when using make -j. The issue appears to
be that if two targets are specified for a rule (e.g. file.cc file.h: file.y)
make does not realize they are both built by the same call so the rule is
executed twice. Once for the .cc target and once for the .h target. This is
not a problem for a serial build. To work around this only use the .c/.cc
file in the main target and then make the .h file depend on the .c/.cc file
as a sub-target.
2012-01-04 18:21:40 -08:00
Cary R 8f17e79b7e Remove a few cppcheck warnings.
This patch removes a few cppcheck warnings.
2011-10-14 18:40:24 -07:00
Cary R f3522e98f1 For MinGW driver report an error if the two \\ are not found in the exe path
We need to print a message and fail if the two \\ characters are not found
in the executable path.

Also update the generation warning to include -g2005-sv.
2011-09-11 11:29:12 -07:00
Stephen Williams 13ecb67717 Add support for vhdl named libraries.
Put libraries in a directory of libraries, support a search path
of library directories, and read those libraries as needed.
2011-07-30 18:18:03 -07:00
Stephen Williams 521005caf6 Add +vhdl-work+ control to the config file.
Presumably, the user will want the ability to explicitly set the
working library location, so create a +vhdl-work+ plusarg setting
for exactly that purpose.
2011-07-24 15:24:32 -07:00
Stephen Williams 19099c944f Automatically include vhdl_sys vpi module. 2011-07-24 12:04:23 -07:00
Greg Steuck f186c81403 Moved lex prefixes from Makefile.in into the corresponding .lex files.
Added an explicit option prefix="yy" to files that were generated
without an explicit -P.

This makes the lex-generated symbol names self contained without any
help from from build system.
2011-05-07 11:38:32 -07:00
Stephen Williams c02d6953ef cfparse.y needs stdio.h
Based on patch subbmitted to sourceforge tracker by
Greg Steuck (gnezdo)
2011-04-27 11:03:08 -07:00
Cary R 2b95e9b463 Forward port the LEX/YACC definition changes from V0.9
It's best to use the LEX and YACC definitions instead of hard coding
flex/bison so they can be overridden if needed.
2011-04-13 18:46:57 -07:00
Cary R 06447817d3 Add support for tracing procedural statements.
This patch adds support for tracing procedural statement execution in vvp.
This is accomplished by adding a new opcode that is inserted before the
code that represents a procedural statement. These opcodes also trigger
a message whenever time advances. By default these opcodes are not added.
To add them, pass the -pfileline=1 flag to the compiler. In the future we
may add support for turning the debug output on and off once the opcodes
have been added with a system task or from the interactive prompt.
2011-03-01 18:45:29 -08:00
Stephen Williams 1f6bf09984 Iverilog driver tells ivlpp how to find vhdlpp. 2011-01-18 17:03:51 -08:00
Cary R d4a97b4a9c Add a generation for 1800-2005, etc.
It was a poor choice to only add -g2009 for 1800-2009 and ignore the
previous version of System Verilog 1800-2005. This patch adds a
generation for 1800-2005 and also adds `begin_keywords support for
1800-2005. The previous SystemVerilog keywords have been put under
the 1800-2005 generation and the new one from 1800-2009 have also
been added.
2011-01-12 16:36:17 -08:00
Martin Whitaker b89ab1f2b0 Cleanup after parameter expression rework.
This patch removes some code made redundant by the rework of
parameter expression evaluation. It also documents the new
-g option.
2010-12-06 14:56:59 -08:00
Martin Whitaker 275dde7712 Rework of parameter expression elaboration.
The compiler currently performs parameter expression elaboration before
performing parameter overrides. This means that the information needed
to correctly determine the expression type and width may not be available
at the time elaboration is performed. This patch reworks the code to
delay elaboration until after all overrides have been performed. It
also provides a new -g option that controls how the width of parameter
expressions is calculated when the parameter itself is unsized.
2010-12-06 14:56:50 -08:00
Stephen Williams 16e1570737 Merge branch 'master' into work2
Conflicts:
	elab_scope.cc
	net_nex_input.cc
	t-dll-api.cc
	vvp/parse.y
2010-11-28 08:38:40 -08:00
Stephen Williams f636699bb9 Automatically include v2009 module for -g2009. 2010-11-21 17:33:14 -08:00
Cary R a4a7b0a09d Make ivl_alloc.h the last include so it doesn't effect any system includes.
In ivl_alloc.h we redefine malloc(), realloc() and calloc() to have
standard error checking. We don't want to do this for anything that
comes from the standard headers. This specifically doesn't work if
a C++ header files does std::malloc, etc.

Also change to -W instead of -Wextra since that is more portable. I
plan to add a check from -Wextra and use it when available since it
is more descriptive.
2010-11-02 10:51:57 -07:00
Cary R be44214598 Add cppcheck target to the Makefile
This patch adds support for running cppcheck from the Makefile. It also
standardizes the order of some of the targets. It renames vpip_format.c
to vpip_format.cc and fixes the size of the array tables to make room
for the trailing NULL. Found when using a C++ compiler.
2010-10-14 19:11:32 -07:00
Cary R cb86fb15bf Add error checking definitions for malloc(), realloc() and calloc()
This patch adds defines that translate all malloc(), realloc() and calloc()
calls into ones with error checking when ivl_alloc.h is included.
2010-10-14 17:39:23 -07:00
Stephen Williams ec49f10e2d Revert bad merge from vhdl branch 2010-10-02 11:02:27 -07:00
Cary R 7f2cb6afcd Warn the user that synthesis is no longer maintained.
Add code to print a warning if the user tries to use the -S flag.
We need this warning since synthesis is not currently being actively
maintained or supported in any branch after V0.8.
2010-10-02 10:49:37 -07:00
Cary R 1993bf6f69 Remove malloc.h support and for C++ files use <c...> include files.
The functions (malloc, free, etc.) that used to be provided in
malloc.h are now provided in cstdlib for C++ files and stdlib.h for
C files. Since we require a C99 compliant compiler it makes sense
that malloc.h is no longer needed.

This patch also modifies all the C++ files to use the <c...>
version of the standard C header files (e.g. <cstdlib> vs
<stdlib.h>). Some of the files used the C++ version and others did
not. There are still a few other header changes that could be done,
but this takes care of much of it.
2010-06-01 08:56:30 -07:00
Cary R 09d59d744d Fix memory leak on error in driver/main.c. 2010-05-19 07:51:08 -07:00
Cary R 2aa627d89f Update all Makefile.in files to support OpenSolaris
This patch updates all the Makefile.in files and configure.in
as follows:

Do not use the -Wall warning flag when using the SunPro compiler.

The SunPro compiler uses -xMD instead of -MD.

There are still more fixes needed before Icarus will compile
on OpenSolaris.
2010-05-13 18:54:09 -07:00
Stephen Williams 8cbff6def0 Cleanup various style issues.
This patch cleans up some style issues: no need to check that a value
is defined before freeing or deleting it, use C++ style casts, make
sure to NULL terminate strncpy(), empty() is faster than size() for
size == 0 or size >= 0 checks, re-scope some variables, etc.
2010-04-13 21:29:15 -07:00
Cary R 7a0e23179b Remove some gcc-4.3.4 warnings (Cygwin)
The latest gcc with the latest Cygwin complains when passing a char to
the toupper, tolower, isspace, isalnum, isprint, isdigit or isalpha
functions/macros. These functions are defined to take an integer. This
patch adds cast to int as needed to remove the warnings. After this
there are still two warnings related to signed/unsigned comparison in
yy_get_next_buffer() (part of flex).
2010-04-13 20:51:21 -07:00
Jared Casper 248fb32b9a Adding ability for generation to be 2009.
Added generation flag -g2009 which enables support for 1800-2009
constructs.  Added related support such as "1800-2009" in the
`begin_keywords directive.

Keeps 2005 as the default generation for now.

Removed the -gsytem-verilog flag and folded the 1800-2005 stuff into
1800-2009.  The rationale behind this is we have so little of
1800-2005 actually implemented that it does not make sense to
distinguish between 1800-2005 and 1800-2009 SystemVerilog extensions,
so we just count them all as the new 1800-2009 Verilog language.
2010-03-05 16:09:04 -08:00
Stephen Williams 8d65d0735a Fix broken $() substitution in command files. 2010-02-04 16:07:27 -08:00
Cary R 3cef85b06b Add +timescale to the command file.
This patch adds a +timescale command to the command file
syntax that can be used to set the default time scale of
the simulation.
2009-12-30 08:35:29 -08:00
Stephen Williams d2dd0daa3c Fix references to version_base.h in Makefiles. 2009-12-28 09:49:35 -08:00
Cary R 5fad844c30 Add support for a suffix to MinGW.
This patch adds support for a suffix in the relative path for the
MinGW compile of iverilog and vvp.
2009-12-18 13:28:46 -08:00
Cary R 8144283b0d Fix out of bounds select warning text in man page. 2009-12-14 12:09:45 -08:00
Cary R 392ac1200c Remove unused MinGW variable.
There was an unused variable in driver/main.c under MinGW.
2009-12-09 22:05:06 -08:00
Cary R e9c653dfa3 For MinGW make driver/main.c always create a path with a back slash
The MinGW executable should be able to support a path with mixed
separators, but to make things consistent all the path in the main
driver program (driver/main.c) now always use a '\' or convert a
path to use '\' (e.g. getenv() returns a path with a '/').
2009-12-08 21:21:27 -08:00
Stephen Williams a720b2309e More portable use of tail.
Apparently, tail +2 is not portable, but tail -n +2 should work.
(cherry picked from commit b85b2d8a26)
2009-12-07 16:28:41 -08:00
Cary R dba2a6e434 Add support for spaces in many paths/files names
This patch adds support for spaces in the path to the temporary files.
Adds support for spaces in output files and in library paths.

A space in the installation path is only supported under MinGW
(windows) at this time.
2009-12-02 17:13:00 -08:00
Cary R f44c1cadde Convert a few sprintfs to snprintf
This patch converts a few sprintf statements to snprintf
to protect against buffer overflow.

It also converts a few sizeof calls from sizeof(x) to
sizeof x like other places in the code.
2009-12-02 17:08:34 -08:00
Cary R 849b241ffa Remove unneeded definitions in drivers/globals.h
There were a bunch of unneeded definitions in drivers/globals.h.
All of these were only used in main.c so do not need to be in a
header file.
2009-12-02 17:03:56 -08:00
Cary R dd425e8945 Add basic support for spaces in the install path for MinGW.
This patch adds support for spaces in the install path on MinGW.
It does this by converting the Long version of the iverilog path
into a Short version that does not have spaces in it. If we don't
do this then we can not add support for other arguments with
spaces in the path or filename. It also modifies the driver-vpi
program to support spaces in the saved ivl path. This is done by
just enclosing the include and library path argument in double
quotes.

The issue on MinGW is that if you put the executable argument to
system in double quotes to escape embedded spaces then you can
not put the arguments in double quotes as well. If you convert
to a Short name then the spaces are removed and we can in the
future escape the arguments as needed.
2009-11-28 20:27:32 -08:00
Stephen Williams 966e29db3b Unify the version stamp in the version_*.h header files.
Try to put all the version stamps into common version_base.h
and version_stamp.h header files. All the source programs then
get their version from these header files.

Also handle the version stamps in the man pages by using the
version_*.h header file contents to edit the version strings
in the man page title bar markers.
2009-11-27 09:25:50 -08:00
Stephen Williams 0fc136fad9 Merge branch 'master' of ssh://steve-icarus@icarus.com/home/u/icarus/steve/git/verilog
Conflicts:
	driver/iverilog.man
2009-11-20 14:42:21 -08:00
Cary R 74634864cf Fix some extra/invalid font switches in iverilog.man.
Cleanup some unneeded \fP statements and remove the invalid and
unneeded \fp statement. Slightly reword the __ICARUS__ definition.
2009-11-18 20:26:47 -08:00
Stephen Williams c90df71301 Document the iverilog -P command line flag. 2009-11-03 15:11:57 -08:00
Cary R c72ae1b3ea Add more non-breaking hyphens in the manual pages.
This has been started, but this patch adds a bunch more (all?) of
the non-breaking hyphens needed in the manual pages.
2009-11-03 14:36:32 -08:00
Cary R cf2f99ec3d Cleanup Makefile clean targets.
This patch removes bin32 from the clean targets since it is no
longer user/created. It adds autom4te.cache to the distclean
target in the main directory. It removes the files in driver
that are not created (lexor.c parse.c, etc.). The *.cc.output
files are no longer created so removing them is not needed.
2009-10-29 10:48:04 -07:00
Cary R 83aa1363ea Add a warning message if an environment variable is not found.
Instead of silently skipping the substitution we now print a warning
message if an environment variable substitution is not found.
2009-10-29 10:46:25 -07:00
Cary R 4cb39f584d Add support for ${var} substitutions in the command file.
We still support $(var).
2009-10-29 10:46:16 -07:00
Martin Whitaker d0cb963994 Provide different modes for dependency list output.
This patch modifies the iverilog -M command line option to allow
the user to specify an optional output mode that controls which
files get added to the dependency list. This allows the user to
either get a list of all files that contribute to the design,
or a list of the include files, or a list of the module files.
2009-10-26 11:05:01 -07:00
Jared Casper 7ead2aa88b More build system tweaks, fixing pr2881797.
Use the time stamp file technique recommended by the autoconf manual
to prevent unneccesary rebuilds because of an unchanged config.h.
Uses the automake trick of generating the stamp files in the
_AC_AM_CONFIG_HEADER_HOOK macro instead of littering the source
directory with stamp-h.in files.

Add an extra ./config.status run after ./config.status --recheck
because with --recheck it doesn't actually try to remake the generated
files (and thus doesn't make the timestamp files).  Thus without the
extra run, each stamp-*-h target would need to independently run
./config.status to make sure it wasn't changed by the configuration
change.

An orthogonal fix of how config.status is called in subdirectories.
When in a subdirectory and config.status is called with
../config.status and $(srcdir) is a relative path, config.status gets
confused.  Fixed by replacing '../config.status --file=Makefile.in'
with 'cd ..; ./config.status --file=<dir>/Makefile.in'
2009-10-20 09:45:42 -07:00