Commit Graph

70 Commits

Author SHA1 Message Date
Cary R e1870acfac Return the correct value when a queue or darray references an undefined element 2020-07-22 21:47:37 -07:00
Cary R a2fbdeff78 Add some pass by reference to vvp 2016-08-14 22:26:16 -07:00
Martin Whitaker 97c6339241 Ensure VPI release on net connected to island returns correct value. 2015-07-01 09:00:43 +01:00
Cary R 0611135758 Some more cppcheck cleanup/updates 2014-06-29 20:39:40 -07:00
Martin Whitaker a76be3571d Fix for br946 - procedural continuous assignment causes vvp internal error.
In the case that the RHS of a procedural continuous assignment is a simple
vector that is wider than the LHS, changes to the RHS vector cause the
entire vector to be sent to port 1 of the LHS vvp_fun_signal object. This
vector needs to be coerced to the size of the LHS. Note that this is a
stopgap fix until vvp handles arbitrary expressions on the RHS of a
procedural continuous assignment.
2014-02-21 22:48:50 +00:00
Cary R 2c2ab24c8f Fix problem when compiling with valgrind support 2013-09-23 10:29:45 -07:00
Stephen Williams 13bb927d8a Handle strings as arguments to automatic functions. 2013-09-20 20:44:56 -07:00
Cary R 1b1aa06dee Remove some more cppcheck warnings and a valgrind compile warning 2013-04-30 18:35:30 -07:00
Cary R c55eb37148 Add support to free an automatic object (valgrind)
Add missing code to free an object that is used in an automatic context.

Also remove one compiler warning.
2013-04-30 11:47:19 -07:00
Stephen Williams b9011d89ae Allow objects to work in automatic functions. 2013-03-24 15:12:35 -07:00
Stephen Williams a186e5ad31 Garbage collection of DARRAY and CLASS objects.
While we're at it, provide a stub class_new runtime.
2012-12-10 19:13:43 -08:00
Cary R f957deeca7 Get the vvp code to compile with the valgrind hooks again.
This patch updates the vvp code so it will compile with the valgrind hooks
again. There are still new constructs that need to be cleaned up correctly
and some old constructs were changed enough that the old code no longer
works, but the rest of this can be done as an incremental improvement.
2012-10-08 18:53:55 -07:00
Arun Persaud f5aafc32f9 updated FSF-address 2012-08-29 10:12:10 -07:00
Stephen Williams 813f548a4b Merge branch 'x-mil3'
Conflicts:
	vpi/Makefile.in
	vpi/sys_table.c
2012-07-30 17:02:57 -07:00
Martin Whitaker 6836068a16 Initial support for $countdrivers.
This patch implements the $countdrivers system function. It does not
yet support wires connected to islands (and outputs a suitable "sorry"
message when this is detected).
2012-07-27 18:09:32 -07:00
Stephen Williams 18714e2efd Support the delete method for objects. 2012-07-22 10:52:06 -07:00
Stephen Williams 14f229de30 Parse support for dynamic arrays.
This includes limited support for dynamic arrays down to the code
generator, and some stubs in the vvp code generator and vvp run time.
2012-07-22 10:52:06 -07:00
Stephen Williams d48362b861 First pass at getting strings to work.
In vvp, create the .var/str variable for representing strings, and
handle strings in the $display system task.

Add to vvp threads the concept of a stack of strings. This is going to
be how complex objects are to me handled in the future: forth-like
operation stacks. Also add the first two instructions to minimally get
strings to work.

In the parser, handle the variable declaration and make it available
to the ivl_target.h code generator. The vvp code generator can use this
information to generate the code for new vvp support.
2012-07-22 10:52:06 -07:00
Larry Doolittle 0aefcf9b48 Trivial fixes to grammar, spelling, whitespace 2012-02-17 16:18:22 -08:00
Stephen Williams b3ef8171e2 Short circuit propagation of part selects when possible
Full vector assigns are able to short circuit the propagation of
the value if it finds that there are no value changes. This patch
supports that behavior in writes to parts as well. Put this change
to use in logic devices as well.
2012-01-14 11:01:54 -08:00
Martin Whitaker e485ac9981 Fix for pr3465541.
vvp_net_t::send_vec8_pv() needs to call the output filter if one is
present, and vvp_wire_vec4::filter_vec8() needs to support part selects.
2012-01-07 09:19:38 -08:00
Cary R ccf01cc665 Fix a minor cppcheck initialization complaint. 2010-11-09 19:44:05 -08:00
Cary R 7dd6883992 The final vvp -Wextra cleanup
This patch resolves the last of the -Wextra warnings by either removing
the parameter or asserting that it is an appropriate value.
2010-10-14 19:18:28 -07:00
Cary R b0269fa926 Add -Wextra for C++ compiling in the vpi and vvp directory.
This patch adds -Wextra to the compilation flags for C++ files in
the vvp and vpi subdirectories. It also fixes all the problems
found while adding -Wextra. This mostly entailed removing some of
the unused arguments, removing the name for others and using the
correct number of initializers.
2010-10-14 19:18:18 -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
Stephen Williams 459593cb59 Special handling for forced tran ports.
Tran islands must do their calculations using the forced values,
if any. But the output from a port must also be subject to force
filtering. It's a little ugly, but hopefully won't hurt the more
normal case.
2010-05-04 19:20:36 -07:00
Stephen Williams d779c6d58b Remove dead class vvp_fun_signal8.
This class is no longer used. net8 nodes exist entirely within
filters (no functor at all) and strength aware variables don't
exist.
2010-05-04 17:36:44 -07:00
Cary R b1dc84ccd1 Fix release of variables.
This patch fixes the release of varaibles to work correctly.
2010-02-01 11:51:51 -08:00
Cary R d6246cf041 Add some casts in vvp 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
may as well squash as many warings as 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:43:42 -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 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 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
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 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
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 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
Stephen Williams a1295db6bf release_pv methods need t account for net_flag.
Whether and what to propagate after a release of a part needs to
match the behavior of the full-vector release. Nets need to restore
their driver, and regs need to hold their forced value.
2009-09-12 09:22:20 -07:00
Stephen Williams caab6b3834 Implement force methods for vec8 nets. 2009-09-11 21:33:24 -07:00
Stephen Williams 88668e3df5 Run vpi callbacks for force/release. 2009-09-10 20:46:33 -07:00
Stephen Williams 4522e88c27 Get the initial value of a vec4 net correct. 2009-09-10 18:51:19 -07:00
Stephen Williams a58c02899b Handle filtered part selects.
filters need to be able to cope with parts of vectors moving through
the net. It makes the most sense to handle every filter as a part-
selected filter.
2009-09-08 21:42:50 -07:00
Stephen Williams 9c516a9d53 Changes to real nets generate callbacks.
Generate the missed callbacks when real values change. In the
process, unify the use of the filterter_mask_ method for scalar
types.
2009-09-07 21:22:00 -07:00
Stephen Williams 5be1b25726 Release filter accounts for net vs variable.
When releasing a net, the release needs to propagate the driven
value. When releasing a variable, the driven value must be set
to the previously forced value.
2009-09-04 21:37:31 -07:00
Stephen Williams 3de02ede8b Remove dead code release methods.
The release methods attached to signal functors are dead code.
2009-09-03 21:24:52 -07:00
Stephen Williams 1ea0d40208 Remove "net" flag to release methods.
This flag is redundant. The behavior should be handled in other ways.
2009-09-03 21:15:35 -07:00
Stephen Williams 5f51b24c56 Force/release for real nets. 2009-09-01 20:48:57 -07:00