Commit Graph

180 Commits

Author SHA1 Message Date
Martin Whitaker 36eef5154f Implement supply->strong strength reduction for non-resistive switches.
As specified in 1364-2005 section 7.11.
2018-02-23 22:07:59 +00:00
Cary R a2fbdeff78 Add some pass by reference to vvp 2016-08-14 22:26:16 -07:00
Martin Whitaker 6e5ed73b09 Extended fix for GitHub issue #99.
Most vvp functors need to support recv_vec4_pv. Any that are strength-aware
also need to support recv_vec8_pv. Note the simplifying assumption that is
documented in the base class recv_vec4_pv_ implementation.
2016-04-18 23:47:43 +01:00
Frederick C. Kurz d766e82aa1 Changes for vvp/vvp_net.h
"# include  <string>" was added so "Microsoft Visual Studio Express 2015 RC Web" could compile it without error. "static void operator delete[](void*); was preprocessed so "Microsoft Visual Studio Express 2015 RC Web" could link it without error for a function not yet implemented.
2015-07-22 18:02:52 -07:00
Martin Whitaker 97c6339241 Ensure VPI release on net connected to island returns correct value. 2015-07-01 09:00:43 +01:00
Martin Whitaker 45dc13e496 Use uintptr_t/intptr_t when casting between pointer and integer.
The code was using (unsigned) long, but a long is 32-bits in the
Windows 64-bit ABI.
2015-05-05 23:00:09 +01:00
Stephen Williams b1d2393789 Optimize the %sub instruction by integrating it with vvp_vector4_t class 2014-12-04 17:01:16 -08:00
Stephen Williams 0f740289e9 Optimize %mul instructions by integrating with vvp_vector4_t class. 2014-12-04 16:00:57 -08:00
Stephen Williams 46ce236cfb Optimize the %add and %addi instructions
Tightly integrate with the vvp_vector4_t class to get much
better add performance.
2014-12-04 12:38:08 -08:00
Stephen Williams 86139c855d Optimize the vec4-stack %cmp/s and %cmpi/s instructions.
Magnitude compare is called a LOT, so it is worth putting some
special effort into it.
2014-12-04 10:42:48 -08:00
Stephen Williams a57e0a1e3f vvp implementation of copy from vec4 to vec2 can use subarray method. 2014-12-02 14:52:37 -08:00
Stephen Williams f3392561ed Optimize the vvp pad implementation. 2014-11-22 09:59:02 -08:00
Stephen Williams 0601b4e43b Optimizations for %pushi/vec4 and %load/vec4
- Have %pushi/vec4 handle some special cases optimally.
- Eliminate some duplicated method calls in %load/vec4.
- Optimize the vvp_vector4_t::copy_from_ method by inlining
some parts.
2014-11-14 14:41:04 -08:00
Stephen Williams 8aca66b109 Performance tweaks
Better performance for %cmp/s and the vvp_fun_part_sa node.
2014-11-14 11:48:36 -08:00
Cary R d6b6b76015 Update header files to use a more standard name to prevent rereading
This is from github report #16. There are likely a few more issues
that need to be addressed though this takes care of the major ones.
2014-07-23 13:42:56 -07:00
Martin Whitaker 68f8de28af Fix for GitHub issue 7 : Undef propagation in power operator.
The vvp_vector2_t constructor that takes a vvp_vector4_t value was
documented as creating a NaN value if the supplied vector contained
any X or Z bits, but instead used the standard Verilog 4-state to
2-state conversion semantics (X or Z translate to 0). I've added an
optional second parameter to the constructor to allow the user to
choose which semantics they want, as both are needed.
2014-02-15 13:14:45 +00:00
Stephen Williams 13bb927d8a Handle strings as arguments to automatic functions. 2013-09-20 20:44:56 -07:00
Cary R e4cc12f3b9 Remove old comment and enclose sizeof value in parenthesis (vvp_vector8_t) 2013-07-12 10:57:39 -07:00
Stephen Williams b9011d89ae Allow objects to work in automatic functions. 2013-03-24 15:12:35 -07:00
Stephen Williams 751587e112 PV-to-concat belnding should use a strength-aware concat. 2013-02-02 10:44:16 -08:00
Martin Whitaker b176a6410d Fix logic value returned for unambiguous HiZ1 strength.
If a strength aware net has an unambiguous HiZ1 strength, VVP treats
it as a logic '1'. It should be treated as a logic 'z'. An ambiguous
HiZ1/HiZ0 strength should also be treated as a logic 'z'.
2013-01-28 19:06:59 -08:00
Stephen Williams 1527b87595 Remove useless vvp_realarray_t
The vvp_darray_real class cal be used for static arrays as well
and this is a more general solution anyhow. Kill the now useless
vvp_realarray_t class.
2013-01-02 19:02:02 -08:00
Stephen Williams 1326f9aef1 Handle darray objects of all integral atom types.
Clean up the vector4_to_value to use templates and explicit
instantiations. This makes the interface much cleaner for a
wider variety of integral types.
2012-10-14 17:16:47 -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 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
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 eab5bacf9f Remove clang/clang++ warnings.
This patch makes the code consistently use struct/class in the C++ files,
it removes a couple shadow warnings and where a class pointer is passed to
the C routines, it defines the pointer as a class for C++ and as struct for
C and it removes a namespace std duplication.
2011-09-25 10:14:04 -07:00
Cary R c2225f679b Remove some cppcheck warnings.
This patch removes some cppcheck warnings.
2011-05-07 11:40:16 -07:00
Larry Doolittle e9fda22ad9 Spelling fixes
Mostly then/than confusion.  All comments or README files,
except for one user-visible change in a tgt-vlog95 error message.
2011-03-14 16:28:36 -07: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 8a91931d49 Properly handle base-type logic enumerations.
The next()/prev() methods need to know of the base type
so that the comparisons can go right.
2010-11-21 17:24:46 -08:00
Stephen Williams 0c72dfe60f Initial implementation of $ivl_method$next/prev
Create the v2009.vpi module to include SystemVerilog core
functions, and start out with some of the enum methods.

Add to vvp support for creating enum types, including some
vpi access methods.
2010-11-17 20:00:23 -08:00
Cary R 8f7ca60e5f Also clear the __ivl_alloc_H define in vvp_net.h
We need to clear the __ivl_alloc_H define so that a later include
of ivl_alloc.h will reload the definitions.
2010-11-02 10:52:03 -07: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
Stephen Williams 3733c59e49 Merge branch 'work1' 2010-10-21 19:31:49 -07: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 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 67000e46a8 Implement atom2 types with vvp_vector2_t.
This reflects the SystemVerilog intent, and also washes away
the 'bx and 'bz values properly.
2010-10-12 20:49:38 -07:00
Stephen Williams ec49f10e2d Revert bad merge from vhdl branch 2010-10-02 11:02:27 -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 128f3d29cc Fix new shadow issues and add -Wshadow to gcc compile.
Some new shadow issues have crept in. This patch fixes these new
issues and adds -Wshadow to the normal warning flags to keep any
new occurrences from happening.
2010-05-13 19:04:13 -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
Martin Whitaker 483afd5dc9 Fix for pr2973532.
Under certain circumnstances, the vvp code generator can generate
a .part/pv that directly feeds an input port of a .concat. This
patch adds a recv_vec4_pv method to the vvp_fun_concat class to
handle this case. It also changes the initial value of the stored
vector from X to Z to correctly handle bits which are not driven.
2010-04-13 19:15:04 -07:00
Stephen Williams 9fbb12d9cf Make sure all vvp_vector8_t::val_ bytes are initialized
Often the val_ array is treated as a word (for speed) so make sure
all the bytes of val_ are initialized, even if not used.
2010-01-12 14:45:57 -08:00
Stephen Williams d0b1936fb5 Optimize handling of invert gates / Tweak vvp_vector8_t performance
The process of inverting and copying can be collapsed into a single
operation that should run a little faster. Also, inverting readily
vectorizes itself. I've also possibly reduced useless vvp_not_fun
iterations.

Also, include some minor tweaks to the vvp_vector8_t handling of
vector copies. This is more to clean up code, although it should
slightly improve performance as well.
2010-01-11 11:42:25 -08:00