Commit Graph

1320 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
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
Stephen Williams 1b7a42ffcd Implement cbAtStartOfSimTime callback. 2009-11-01 09:26:09 -08: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 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
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
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
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
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 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 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 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 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 1c8a1bbf7f Clean up a couple of memory leaks in the new net rework code.
This patch fixes a couple of minor memory leaks in the new
net rework code.
2009-09-25 13:50:30 -07:00
Cary R a84faabdb0 A real wire needs an explicit initial value.
To keep valgrind happy we need to give real wires an explicit
initial value of 0.0.
2009-09-25 13:50:20 -07:00
Stephen Williams 91a16764e7 Merge branch 'master' of ssh://steve-icarus@icarus.com/~steve-icarus/git/verilog 2009-09-24 19:09:27 -07:00
Stephen Williams 18d7a7f859 Release of nets needs to force propagation
When releasing a net, the release method must force that the
filter propagate the released value to the output. Use the
needs_init_ flag to do that force.
2009-09-24 18:57:15 -07:00
Cary R d7ef9718e7 Fix valgrind error in new net rework code.
This patch fixes a valgrind error and fixes some of the test suite
issues in the new net rework code.
2009-09-24 17:51:22 -07:00
Stephen Williams 8a3df7c4ff Fix build errors when configured --with-valgrind
The vpi_callback base class is parent of the filter object of nets,
and not the functor. The good news is the clear_all_callbacks method
can now be got at without casts.
2009-09-24 15:11:56 -07:00
Cary R 8d2913ac97 Remove unsigned/signed compile warning. 2009-09-24 12:05:28 -07:00
Stephen Williams 6cc16711db Merge branch 'master' into vvp-net-out-rework 2009-09-22 17:48:33 -07:00
Cary R 98c39cfa24 Add support for .part/v.s
This patch adds support for .part/v.s. A variable part select with
a signed select expression in a continuous assign.
2009-09-22 17:31:37 -07:00
Cary R e54fd4df51 Add support for signed thread base index for &A<>
This patch adds support for getting a signed index for &A<> from
thread space. This mimics what was done for &PV<>.
2009-09-22 17:20:31 -07:00
Cary R c82baa2793 Only process the first 32 bits of the part select base.
When reading from thread space only read the first 32 bits
(sizeof int) for the part select base. This matches the other
parts of the PV_get_base() code.
2009-09-22 17:18:04 -07:00
Cary R 617897f3bf Add support to &PV<> for signed base values from thread space.
When calculating a value from thread space we need to tell &PV<>
if the base value is signed or not. This patch adds support for
that functionality.
2009-09-22 17:11:55 -07:00
Stephen Williams b75f02c889 Handle automatic real variables like automatic logic vectors. 2009-09-15 21:28:21 -07:00
Stephen Williams 21b1f620ba Automatic variables cannot use wire filters.
Make vec4 variables use stub filter functions so that the filter
does not interfere with automatic values.
2009-09-15 17:10:59 -07:00
Stephen Williams 0a72df2025 Remove vvp_signal_value from the vvp_fun_signal hierarchy.
We no longer need to access values from the signal functor. Use
the filter (the wire part) everywhere to access signal values.
2009-09-13 18:30:13 -07:00
Stephen Williams 3d5d312786 Merge branch 'master' into vvp-net-out-rework
Conflicts:
	vvp/vpi_signal.cc
2009-09-13 12:31:17 -07:00
Cary R 43f41572cb Fix 64 bit problem in vvp/vpi_signal.c
This is based on a suggested fix from Martin. It fixes the crash
for two tests in the test suite. As a bonus it is more efficient.
2009-09-13 08:18:11 -07:00
Cary R 6d5d06cae4 Squash some gcc 4.3.3 warnings.
This patch clears all the gcc 4.3.3 warning that can be fixed.
The remaining warning is dictated by older versions of the
1364 standard.
2009-09-13 08:15:59 -07:00
Cary R 5a11a8a9c2 Revert one change from previous patch.
I was mistaken in changing the cast in the comparison.
2009-09-13 08:04:04 -07:00
Cary R 1b300cb2f6 Fix another 64 bit problem in a part select.
This patch fixes a problem in the .part/v select when the index is
undefined. The default value needs to be INT_MIN, so when the long
is cast to an int the value is in range.
2009-09-13 08:03:58 -07:00
Cary R 27f032760e Fix .part/v to only use a 32 bit value.
To get better functionality in V0.9 and development until we
add a select that is sign aware to .part/v this patch uses
a 32 bit integer (int) for the select value. This allows a
normal Verilog integer to produce the correct results. A
warning for smaller signed index vectors is planned, but it
needs more input.
2009-09-13 08:03:48 -07:00
Stephen Williams 72ab7b6515 Handle initialization propagation of wires.
The first input through a net needs to be propagated, since this
is used as an initialization for the net. This patch also cleans
up wires to not need the width_ member, instead inferring the
width from the saved bit value.
2009-09-12 18:46:48 -07:00
Stephen Williams 03f2432f6e Fixup real value output from user defined functions
User defined functions need to check the output from the function,
which is an unfiltered signal.
2009-09-12 12:25:18 -07:00