Commit Graph

5495 Commits

Author SHA1 Message Date
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
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
Martin Whitaker 9950704735 Fix vvp code generator bug for CA function calls with array word arguments.
If a function in a continuous assignment is passed an array word as
an argument, syntactically incorrect vvp code is generated. This is
because the code calls draw_net_input to generate the input labels
part way through writing out the .ufunc statement. If an input is
an array word, draw_net_input causes a .array/port statement to be
emitted, which gets written out in the middle of the .ufunc statement.
This patch fixes the problem by collecting the necessary input labels
prior to starting writing the .ufunc statement.
2009-11-01 11:06:33 -08:00
Stephen Williams 1b7a42ffcd Implement cbAtStartOfSimTime callback. 2009-11-01 09:26:09 -08:00
Cary R a5060b8adc Add a waring that timing check delayed signals will not be driven.
The $setuphold and $recrem timing checks can create delayed signals
that are needed to get a model to work correctly when negative timing
check values are used. Since we do not support timing checks and just
ignore them this can create simulation problems when a user tries to
use these delayed signals since they are not driven.

This patch adds a waring when the circuit is being compiled that these
delayed signals will not be driven. This will be needed until we get
time to add the real timing checks are mimic the delayed properties of
the timing check.
2009-10-31 20:50:43 -07:00
Cary R ae49197a14 Cleanup a few more issues found with cppcheck.
Minor fixes and code reorganization to remove a few more issues
that cppcheck is complaining about. It has a few false warnings
and some issues that need more investigation.
2009-10-31 20:42:43 -07:00
Stephen Williams 5fb89262df Fix the vpiObjTypeVal for signals to be scalar or vector.
Scalar signals have a preferred type of vpiScalarVal, but vectors
have a preferred type of vpiVectorVal. Use the signal width to
distinguish.
2009-10-29 11:53:31 -07:00
Stephen Williams 711365521d Fix vpi_control operation codes to be standard
Apparently, the vpi_user.h definitions for vpiStop et al were added
before they were standardized by 1364-2000, and never corrected.
Change the values to be standard. (Submitted by Matt Trostel.)

I also added some binary compatibility for existing .vpi modules
that were compiled with the older constant values.
2009-10-29 11:16:26 -07: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
Cary R 9dc4c8cbe1 Fix memory.h include issues.
The local "memory.h" file is no longer used in V0.9 or development,
so it does not need to be included in vvp/codes.h. The VHDL target
does not use the system <memory.h> header file so there is no need
to have a define for it in the vhld_config.h.in file.
2009-10-26 11:09:02 -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
Cary R 1f0857606a Add error message that only 32 bit immediate CA delays are supported.
The .delay (x,y,z) functor and the get_number_immediate() function
only supports 32 bit delay values. This patch adds an error message
if the user passes a larger, but valid value.
2009-10-23 11:00:56 -07:00
Jared Casper c167b3a01f Still more build system cleanup.
- Add missing dependency of configure on aclocal.m4.

- Remove config stamp files in make distclean (and fix another for
  loop in base make distclean that I missed)

- Add stamp files to .gitignore
2009-10-23 10:57:41 -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
Cary R c7d05eefb4 More valgrind cleanup (local nets).
This patch adds code to cleanup local nets and changes a few of
memory cleanup messages.
2009-10-20 09:38:55 -07:00
Jared Casper d098db0a06 Base Makefile improvements.
Instead of calling make in subdirectories using a sh for loop, use GNU
make's $(foreach ) to create a string of commands connected with &&.
This way an error in a subdirectory will stop the build, instead of
continuing on to the next subdirectory, which the old version does.

Also added rules to regenerate configure when configure.in changes,
and to run config.status --recheck when that happens.
2009-10-18 18:00:53 -07:00
Cary R dec524a151 More valgrind cleanup.
This patch adds code to cleanup system functions driving a
continuous assignment. It also modifies the user function
cleanup to not interfere with this. It also adds a count
of the nets and signals that were not cleaned up that is
pnly printed when running valgrind. They are not flagged
y valgrind since they are pool managed objects. There are
a few signals that need to be cleaned up and local nets
are missed so there are a lot of nets.
2009-10-16 20:03:26 -07:00
Cary R c54cd4b473 Update simulator version for V0.10. 2009-10-16 20:00:55 -07:00
Stephen Williams 9164b7719b Add driver for the HiZ of open nets.
Even open nets have a driver for HiZ. The BUFZ is needed as something
to hang .net objects. This is another step closer to not needing the
"create_constant_node" hack in vvp/words.cc.
2009-10-15 21:19:19 -07:00
Stephen Williams 8247d3ef45 The .alias for nets is no longer useful.
In the olden days, the .alias was necessary to create a net name
that is an alias to an existing net in the netlist. But now that
the .net no longer creates a node in the netlist, ALL .net objects
are aliases of a sort, so this (mis)feature gets in the way.
2009-10-14 21:40:15 -07:00
Cary R 02ca7fe7fc Clean up user function calls from thread space.
This patch adds cleanup code that cleans up the memory that is
allocated by the of_EXEC_UFUNC command. This knocks a few more
files off the valgrind list.
2009-10-13 21:38:47 -07:00
Cary R 8abf303753 Don't replace parameter overrides that did not evaluate.
Trying to replace a parameter override that did not evaluate
correctly can lead to a crash, so just skip the substitution.
2009-10-13 21:28:37 -07:00
Cary R bc60536eb9 $clog2() should return an integer value.
The constant $clog2() was returning a value that had an integer
width, but it did not have the sign bit set. This could result
in incorrect math expressions. This patch sets the sign bit for
the constant $clog2() result.
2009-10-13 21:23:37 -07:00
Cary R d9d8d4b093 In driver-vpi only look at the first CC word when checking compiler path.
In the MinGW version of iverilog-vpi (C version located in driver-vpi)
we must only look at the first word of the IVERILOG_VPI_CC definition.
A recent change to the configuration process made this equal to
"gcc -std=gnu99" which will not be found when looking for the
gcc executable. We nee to look for "<path>\\bin\\gcc.exe". This
patch modifies the driver to only use the first word when looking for
the compiler, but uses the full value when compiling.
2009-10-13 21:16:32 -07:00
Stephen Williams 33158355ba Add appropriate hysteresis to tranif input pins.
The tranif input pins are normally nothing special, but sometimes
they are fed back from the switch body. In this case, the control
needs to see the current *output* from the fed back port, in order
to get the results that people expect.
2009-10-13 19:01:02 -07:00
Stephen Williams 6b17dcc587 Get drive of pull-ups right.
The drive for a pullup comes from ivl_nexus_pt_drive1. Get this
wrong and a pullup turns into a HiZ.
2009-10-12 22:01:56 -07:00
Stephen Williams 65f8f3caa8 Merge branch 'master' of ssh://steve-icarus@icarus.com/~steve-icarus/git/verilog 2009-10-11 16:51:45 -07:00
Stephen Williams 815e22908b Make control inputs to islands use .import records.
Control inputs (i.e. the control input to tranif switches)
are not driven in any way by the island, so use .import records
instead of .port records to bring them into the island. Properly
handle the now potentially different bindings within the island
and outside the island. This means the draw_net_input_x function
is a little more sophisticated, and the node data more complex.
2009-10-11 16:51:06 -07:00
Cary R ff39575dc0 We must have autoconf version 2.60 or later.
When AC_PROG_CC_C99 was added recently we created an implicit
requirement for autoconf version 2.60. This patch makes that
implicit requirement and explicit requirement.
2009-10-08 17:00:00 -07:00
Cary R 3303cc144f Fix obscure valgrind memory leak. 2009-10-08 16:55:36 -07:00
Cary R 39f243b18e Add a configure check to see if uint64_t and unsigned long are identical.
This is needed to get vvp to compile under MacOS 10.6 and possibly other
64 bit systems that define uint64_t as unsigned long long vs unsigned
long (both are 64 bits).
2009-10-08 11:50:05 -07:00
Stephen Williams 2229ad896b tranif control ports handle nil inputs
In certain special cases, it is possible for the tranif control input
to be nil. (probably only during startup.) Treat that case as HiZ.
2009-10-07 12:58:19 -07:00
Cary R 537ba93fe4 Format the --enable-suffix help correctly. 2009-10-06 20:43:29 -07:00
Stephen Williams abc4eb9d52 Do not cprop through ternaries if the selector is an l-value.
It turns out that it is possible for an otherwise constant net
mux to be non-constant if there is a force that can drive the
net. This can be detected as an l-value reference to an otherwise
constant selector.
2009-10-05 19:46:47 -07:00
Cary R 9ea6604439 Fix bug in vector8 operator=
operator= would try to overwrite it self under some circumstances.
This was found with valgrind and using -O0. It works with -O2.
2009-10-03 08:59:35 -07:00
Cary R 27f96bd6f3 Fix the last of the net rework memory leaks.
This patch fixes the last of the memory leaks introduced by the
net rework.
2009-10-03 08:54:44 -07:00
Cary R ed7e9f8be5 Check if the compiler supports C99 and better check for some math functions.
Add a configuration check that says we would like to use C99 if the
compiler supports it. Also change the lround(), nan(), fmin() and
fmax() checks to look in the default libraries as well as the math
library.

Update the iverilog-vpi sh script to correctly quote CC since it
may now have two words (gcc -std=gnu99).

Add a missing int for main in draw_tt.c.
2009-10-01 11:51:52 -07:00
Stephen Williams d64b1f0275 Unify some duplicated heap management.
Create the permaheap class to hold common code from the vvp_net_fun_t
and vvp_net_fil_t classes.
2009-09-30 22:10:35 -07:00
Stephen Williams 5a96b397e4 Elide local nets that have no drivers.
Local nets that have no (zero) drivers are dead weight. Since
they have no drivers, they are not being used anywhere. Since
they are local, they are not force-able.
2009-09-30 19:51:05 -07:00
Stephen Williams e076087320 Draw PULLUP constants with their own BUFZ.
This doesn't have any significant runtime consequence other then
to create a functor that is otherwise stable. But this does connect
to .net nodes more naturally, and gets me a step closer to banning
Cx<> labels as arguments to .net records.
2009-09-30 19:48:36 -07:00
Stephen Williams 92fe0e0fc7 vvp_net_fil_t objects are permallocated. 2009-09-29 21:17:08 -07:00
Stephen Williams 025f93e321 Attach generated nets to the right scopes.
Nets that are created after being put off for later processing to
allow the vvp_net to be created, need to be more carefully placed
in the correct scope.
2009-09-27 18:29:07 -07:00
Cary R 3259354d29 The concat object can get out of sequence so don't optimize a repeat.
Under some situation the optimized repeat expression can get out
of sync while it is being processed this causes the code to
reference freed memory. This happens when the repeat expression
is converted to an unsigned integer, but the repeat expression
is used in a different path. It was easier to just remove the
optimization then track down the convoluted call sequence that
was causing this and then figure out what needed to be fixed.
The repeat expression must be constant, so is likely not too
complicated so this optimization is very minor and should not
be missed.
2009-09-26 18:34:25 -07:00