Commit Graph

6240 Commits

Author SHA1 Message Date
Cary R 81d4cbc4bd Add some casts in main directory to remove warnings.
The Cygwin compiler is a bit picky. This patch adds some casts
to remove compilation warnings. In the past I have had warnings
off because of problems with the STL, but for this directory we
mas as well remove the warnings we can. It also does not
recognize that an assert(0) or assert(false) ends a routine so
it complains about no return at end of function or variables
not being defined.
2009-12-11 21:41:46 -08:00
Cary R 1f375ef16a Remove extra MinGW only varaible in t-dll.cc. 2009-12-11 21:40:05 -08:00
Cary R 05a3929b1a Remove version.exe with a -f to avoid a warning.
If version.exe does not exist and we don't have a -f then we
will get a warning.
2009-12-11 21:39:24 -08:00
Martin Whitaker e2be397aa8 Fix for pr2909414.
Currently the compiler only applies defparam statements that are
found in the initial root module hierarchy. This patch ensures that
defparam statements within scopes created by generate constructs or
instance arrays are also applied.
2009-12-11 21:30:42 -08:00
Stephen Williams 709f6e71a6 Include climits for HName.h portability. 2009-12-11 17:17:52 -08:00
Stephen Williams e560b99a69 Don't repeat nodangle for signals.
Deleting a signal does not cause a new signal to dangle, so don't
use the deletion of a signal as an excuse to iterate nodangle.
2009-12-11 17:17:24 -08:00
Stephen Williams 38cce38e04 Slightly improve performance of collapsing NetEvent objects
The NetEvent::find_similar_event method should limit its impact
on the netlist (and Nexus objects) by reducing the candidate event
list as it goes, instead of collecting data and testing later.
2009-12-11 17:03:05 -08:00
Stephen Williams 4622f304d5 Remove dead init values from NetNet and Link objects.
It turns out that although there was all kinds of code to manage
these members, there were no uses anywhere. It must have been a
legacy from a previous era. So remove the dead code so that it
doesn't confuse me again.
2009-12-11 13:44:29 -08:00
Stephen Williams 1985bc5821 More verbose detail for nodangle functor. 2009-12-11 13:00:55 -08:00
Stephen Williams 6225e2f405 Fix uninitialized counters.
The count_io method adds its count, so initialize the inout counts
to zero.
2009-12-11 11:25:07 -08:00
Stephen Williams 7403dab028 Optional debug aid of trapping SIGINT
Normally ifdef'ed out.
2009-12-11 08:01:49 -08:00
Stephen Williams 4cda5ae6e9 Clean up some optimizer formance around the fringes.
Remove some wasteful and excess scans of the Nexus of some links,
and remove dead code so we can see what we're doing. Also inline
some commonly used and trivial functions.
2009-12-11 07:56:27 -08:00
Stephen Williams 2ddbf35869 Merge branch 'master' of ssh://steve-icarus@icarus.com/home/u/icarus/steve/git/verilog 2009-12-10 13:24:50 -08:00
Stephen Williams 7311047f80 Optimize code generator scope access / tweak ivl_net_const performance
Child scopes need to be accessed quickly, so use O(LogN) maps for
the children instead of O(N) lists.

Also, ivl_net_const_s objects exist in huge abundance for some kinds
of designs, so put some effort into reducing their memory footprint.
2009-12-10 13:24:27 -08:00
Stephen Williams 534207bb83 Optimized Nexus handling during code generation.
Once code generation starts, the Nexus structure no longer needs to
support fast insertion/connect operations. So have the code generator
lock down the Nexus structures and adjust the Link lists for optimal
access during readout.
2009-12-10 13:20:38 -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
Stephen Williams f7aef3f966 Merge branch 'master' of ssh://steve-icarus@icarus.com/home/u/icarus/steve/git/verilog 2009-12-09 18:20:19 -08:00
Stephen Williams 69f3219f49 Suppress redundant warning messages about input coerced to inout
A message for each signal name at a given source/line need only
have this message emitted once.
2009-12-09 17:17:52 -08:00
Stephen Williams 782c55f7b5 Restructure Nexus lists of Links to handle large net lists.
When netlists get very large, the Nexus::connect() method tickles
the O(N) performance and elaboration gets very slow. Rework the
connect method to be O(C), for a drastic performance boost for
large designs.
2009-12-09 15:49:52 -08:00
Stephen Williams 4db4a467ee Speed up the connect(Nexus*,Link&) function somewhat.
This simplifies and reorganizes this function in order to improve
the performance of this function by a constant factor. I think we
really need to improve this by an entire order (and not just a
simple factor) but this helps.
2009-12-09 08:22:18 -08:00
Stephen Williams 94fa8955e5 Minor code cleanup. 2009-12-09 07:37:02 -08:00
Cary R a85880a8bb Add debug_eval_tree code for the pow operator.
The power operator was missing eval_tree debug information.
This patch fixes that deficiency.
2009-12-08 21:24:59 -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
Martin Whitaker c7b0aef414 Reduce memory use for simulations that run in zero time.
The fix for pr1830834 causes vvp to only delete a completed thread
when the simulation time next advances. If a procedural model is
being simulated which makes many task or function calls within a
single time step, this can lead to excessive memory use. This patch
modifies the behaviour so that thread deletion is only delayed if
that thread has caused a sync event to be placed in the event queue.
This should catch all cases where the thread private data can be
accessed after a thread has terminated.
2009-12-08 21:13:19 -08:00
Cary R eea816e423 Make the verinum pow operator work correctly.
The functionality of the integer power operator is specified in
1364-2005 on page 45-46 and specifically Table 5-6. This patch
fixes the verinum pow operator to work as specified in this
table. It also fixes an error in the == operator when both
operators are signed and only the left argument is negative.
2009-12-08 21:04:11 -08:00
Cary R 59ebd47ba6 Update wavealloca.h to fix MinGW compilation warning
This patch fixes a warning when compiling vpi/sys_lxt2.c under
MinGW regarding the definition of alloca().
2009-12-08 20:58:53 -08:00
Stephen Williams b1d9d1bda2 Dramatically improve NetScope child lookup.
In physical models, there are often very many child scopes in any
given scope. The lookup for child scope needs to be optimized.
2009-12-08 15:14:55 -08:00
Stephen Williams 26ab32ac3b Add explicit dependencies on generated header files.
These explicit dependencies are not normally needed (because they
are covered by automatic dependency generation) but when the "-jN"
flag is passed to gmake, they help gmake schedule parallel builds.
(cherry picked from commit 5479aaf721)
2009-12-07 16:29:37 -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 b6f7354cee Update lxt/lxt2 files to latest from GTKWave.
This patch updated the four file lxt_write.{c,h} and
lxt2_write.{c,h} to the latest ones from GTKWave. This
required adding the wavealloc.h include file and an
update to configure.in and vpi/vpi_config.h.in to add
checks/definitions for ALLOCA and FSEEKO.
2009-12-02 17:21:19 -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 145133bdb0 Minor rework of how driver-vpi is supported.
Add driver-vpi to either SUBDIRS or NOTUSED depending on if we
are building for MinGW or not. This is more logical and allows
the clean and distclean targets to be simplified.
2009-12-02 17:01:44 -08:00
Stephen Williams 9bcc658e37 Detect and handle unpropagated ufunc input.
During startup it is possible for input port to not yet be
initialized even after some other input ports trigger the
function to be evaluated. Handle this case by substituting
a vector of 'bx for the uninitialized inputs. This will shake
out when the simulation gets going, and only matters for user
defined functions in continuous assignments.

While we're at it, have vec4_unfiltered_value return a reference
to reduce copying of vectors.
2009-11-29 09:59:51 -08:00
Stephen Williams 734124e653 Remove dead code in pointers.h. 2009-11-28 21:39:35 -08:00
Stephen Williams 2e60a181c0 Make all should build the iverilog-vpi.man file.
The "make install" target may not in general be able to build
the iverilog-vpi.man file, so make sure it it build by make all.
2009-11-28 20:32:29 -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
Cary R 6909737bf2 Some more generic fixes for building in a remote directory
This patch fixes a few more issues related to building
in a remote directory. The start of the problem was
that the version file was not getting built correctly.
This necessitated using vpath instead of VPATH to only
allow the %.cc files. After that a few other places
needed to have $(srcdir) added.

The distclean target was also enhance so that when
building from a remote directory (srcdir != .) we
remove all the extra files and directories.
2009-11-28 20:14:34 -08:00
Cary R 8abe0d7d71 Make MinGW compile using a remote build directory.
This patch fixes a few MinGW specific issues that prevented it
from building in a remote directory.
2009-11-28 20:09:09 -08:00
Stephen Williams 342ec152bc Make version.exe so that subdirs can get access to it. 2009-11-28 20:01:58 -08:00
Stephen Williams ba58e57dc8 Merge branch 'master' of ssh://steve-icarus@icarus.com/home/u/icarus/steve/git/verilog 2009-11-27 09:26:35 -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 de1f17d429 Fix delays in continuous assignment to support 64bit delays.
Remove the 32bit restriction on a few cases of delays in continuous
assignment expressions.
2009-11-26 18:28:19 -08:00
Stephen Williams 1ada697e45 Fix signed/unsigned errors in %shiftl/x0 and %shiftr/x0
Fix these warnings once and for all. Just use only signed integers
for all the variables and arithmetic.
2009-11-26 09:43:35 -08:00
Stephen Williams c73925e775 Handle word aligned bit moves more efficiently
If the source and destination of a subvector to be moved in the
vvp_vector4_t::mov method is nicely word aligned, and the transfer
size is a full word, then we ar much better off handling that as
a special case. This makes the move faster, and also avoids some
shift overflow errors.
2009-11-26 09:34:45 -08:00
Stephen Williams f07577db11 Handle case that delay output is pending when new event arrives
If the delay has an event pending for the current time, then use
that as a reference for calculating the next delay. If that is not
done, then the delay calculated against the wrong reference might
result in zero, and bad results.
2009-11-23 18:27:14 -08:00
Stephen Williams 971179d617 Performance optimizations
For the %mov instruction, implement a vvp_vector4_t::mov method to
manipulate the thread vector directly.

For the %load/v instruction, rework the vec4_value() methods to
avoid creating vvp_vector4_t temporaries, and therefore reduce the
copy overhead.
2009-11-20 17:54:48 -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