Commit Graph

47 Commits

Author SHA1 Message Date
Stephen Williams 0abf91ca4e Make vvp exit with FAILURE if $fatal is used to exit the simulation. 2019-10-14 14:11:50 -07:00
Martin Whitaker f1608e163f Fix implicit fallthrough warnings when building with recent GCC. 2018-10-06 20:15:42 +01:00
Cary R e44010c2a3 Remove redundant class keyword 2015-12-29 13:02:58 -08:00
Cary R 8367285f3b Fix some struct versus class warnings for vpiScope 2015-12-29 12:29:10 -08:00
Stephen Williams 2fedb4942e C++-ify more __vpiScope members. 2015-12-23 17:38:13 -08:00
Stephen Williams fff69390ac C++-ify the __vpiScope classes. 2015-12-20 20:26:57 -08:00
Stephen Williams a98f21aa65 Merge branch 'master' into vec4-stack
Conflicts:
	elab_lval.cc
	netmisc.cc
	tgt-vvp/eval_object.c
	tgt-vvp/vvp_process.c
	vvp/codes.h
	vvp/compile.cc
	vvp/opcodes.txt
	vvp/vpi_tasks.cc
	vvp/vpi_vthr_vector.cc
	vvp/vthread.cc
2014-10-21 09:12:02 -07:00
Stephen Williams b991a991a7 Implement vpi_handle(vpiLeft/RightRange, ...) for signals.
This returns a constant object that can be treated like an
expression, so following the letter of the LRM.
2014-07-14 17:15:16 -07:00
Stephen Williams d55e4c0552 Redesign support for system functions that return vec4
Redsign the handling of the return value, including a rework of
the %vpi_func syntax to carry the needed information.

Add a few more arithmetic operator instructions.
2014-01-04 22:06:58 +00:00
Cary R 54cb85adfc Add support for a generate scope to vvp and the vpi routines.
Instead of just translating a generate scope to a named begin/end scope
this patch creates a generate specific scope (vpiScopeGenerate) that is
of the vpiGenScope type. This may not match the standard 100%, but does
allow the FST dumper to denote generate scopes differently than the
other scope types. Most of the VPI code treats a vpiGenScope just like a
named block so only the FST dumper should have different behavior.
2013-07-17 10:57:02 -07:00
Stephen Williams a5fd5363b3 Rewire real value expressions to use a stack instead of register space.
This will hopefully improve performance slightly, but also this
intended as a model for what to do when I get around to doing the
same thing to other data types.
2012-10-22 17:20:43 -07:00
Arun Persaud f5aafc32f9 updated FSF-address 2012-08-29 10:12:10 -07:00
Cary R 391073a750 Update __vpiNamedEvent to remove struct and remove extra class statements
The clang compiler does not like using struct to reference a class object.
This patch removes all the struct keywords for __vpiNamedEvent objects
since they are now a class and can be called without a struct/class
qualifier.

This patch also removes all the extra class qualifiers from the rest of
the source code.
2012-02-12 13:22:32 -08:00
Cary R bb58ace6d6 Update __vpiHandle to use class vs struct
The clang compiler does not like mixing class and struct references. This
patch updates all the struct __vpiHandle, etc. to use class since that is
how they are now defined.
2012-01-21 14:50:27 -08:00
Stephen Williams a48c9c3b4a Reword __vpiHandle objects to create a class structure.
Instead of C-like data structures where the __vpiHandle base is a
leading member, make the __vpiHandle a derived class. Give the base
class a virtual destructor so that dynamic_cast works reliably, and
now pretty much all of the junk for testing if an object really is
of the derived class goes away. Also, problems with casting up to
a vpiHandle become trivial non-issues.
2012-01-19 10:16:39 -08:00
Cary R 78f985af0e Add trace command to interactive prompt to control statement tracing.
This patch adds a trace command to the interactive prompt that can be
used to control statement tracing when the code is instrumented (has
%file_line opcodes).
2011-03-04 10:36:26 -08: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
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
Cary R 3f6aff47c9 Add run time support for calling system functions as task.
This patch adds two new opcodes and the infrastructure needed to call
system functions as tasks. The normal %vpi_call will generate an error
if a system function is called as a task. %vpi_call/w will generate a
warning and will ignore any value returned by the function. %vpi_call/i
will ignore the system function return value and will not print a
message. Adding this is a feature request and is supported in
SystemVerilog. Next I need to add flags to control this depending on
the compiler generation and possibly other flags.

I may leave the cast to void (%vpi_call/i) functionality unimplemented
for now.
2010-06-11 15:39:16 -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 3ddb421fbf Add some single-step debugging
Work out the basis for single-stepping events in the scheduler,
and fill in some basic single-step results.
2010-01-06 16:08:20 -08:00
Patrick Doyle f379cd0a14 Teach vvp about -N
Added support for the -N option, which causes $stop and ^C to behave
like $finish with an exit code of 1.

While I was at it, I noticed that the summary line in the man page for
vvp was missing a couple of options, so I fixed that.
2009-06-19 21:30:33 -07:00
Larry Doolittle 9619eb3a0d Remove fresh const lint
It looks pretty stupid and non-c++-y, but it does remove two compiler warnings
vvp/stop.cc: In function 'void stop_handler(int)':
vvp/stop.cc:492: warning: deprecated conversion from string constant to 'char*'
vvp/stop.cc:493: warning: deprecated conversion from string constant to 'char*'
2009-05-23 14:00:47 -07:00
Cary R e23d14269a Dump the streams when entering interactive mode.
This patch adds code to automatically dump the output stream
including any dump file when entering interactive mode. When
the user typed ^C or $stop was executed.
2009-04-17 18:30:25 -07:00
Cary R 1ef6c405c3 Handle $stop and $finish at the interactive prompt.
This patch adds interactive support for $stop and $finish.
$stop displays a message that the simulator is already stopped.
$finish acts exactly like (calls) the interactive "finish"
command. Having $stop do nothing and $finish not finish until
you exit interactive mode is not very intuitive.
2009-04-17 18:08:55 -07:00
Cary R 4b2e5e5914 Check for both the library and include file when adding history.
When adding history (add_history) use both the existence of the
library and the header file to determine if history can be
supported. Add a new USE_HISTORY that is the and of these two.
2009-04-08 17:43:00 -07:00
Cary R 10f106f354 Make vvp use inttypes for the 64 bit printing info.
To get the correct print format for a 64 bit value it is much
better to use <inttypes.h> (when available) than building our
own value. This allows MinGW to use the non-standard I64.
(cherry picked from commit d237e35076)
2009-03-24 07:59:26 -07:00
Cary R d95c77a58a Add vvp flag that allows $stop to act like $finish.
This patch adds a new flag to vvp "-n" that can be used to make
$stop and hence <Control-C> act like $finish. This may be desired
when using vvp in a non-interactive environment.
2008-01-07 18:23:18 -08:00
Cary R 77061faa5c Add vpiFile and vpiLineNo for system functions.
Add the vpiFile and vpiLineNo properties to system functions.
Most other objects have stubs that return "N/A"/0. Interactive
functions (called from the debugger) use <interactive> for the
file name.
2008-01-01 17:27:03 -08:00
Cary R 78b2eb5026 Generate array word names with new array VPI functionality
Use the new array VPI functionality (vpiIndex, vpiParent, vpiArray)
to dynamically generate array word names. The old patch to implement
was mostly reverted.
2007-12-05 18:38:28 -08:00
steve 80f30be9d0 Add support for system functions in continuous assignments. 2006-06-18 04:15:50 +00:00
steve 7efa6be236 stop/continue messages go through MCD for logging. 2005-11-25 18:35:38 +00:00
steve bf8b085159 Clean up compiler warnings. 2005-09-20 18:34:01 +00:00
steve 07f64bc603 Support interactive mode even without readline. 2005-01-29 06:29:17 +00:00
steve e4ae832153 Clean up spurious trailing white space. 2004-10-04 01:10:51 +00:00
steve efef8fba85 Add load command to interactive stop.
Support decimal constants passed interactive to system tasks.
2004-02-21 00:44:34 +00:00
steve 1dfbe0f7f2 Fix conditional compilation of readline history. 2003-11-07 05:58:02 +00:00
steve 3e44a7121d Include net objects in list display. 2003-10-15 02:17:39 +00:00
steve 218d74f7bb Fallback functionality if readline is not present. 2003-05-16 03:50:28 +00:00
steve e6db4113a5 Warnings about long long time. 2003-03-13 20:31:40 +00:00
steve 654ad4c97e Direct support for string parameters. 2003-03-10 23:37:07 +00:00
steve 2b543ddf16 Missing include ctype.h. 2003-03-08 20:59:41 +00:00
steve 70daee399f Interactive task calls take string arguments. 2003-02-24 06:35:45 +00:00
steve 7f8433148c Add to interactive stop mode support for
current scope, the ability to scan/traverse
 scopes, and the ability to call system tasks.
2003-02-23 06:41:54 +00:00
steve 5b7c1bc7e2 Basic support for system task calls. 2003-02-22 06:32:36 +00:00
steve 2de0597038 Add vpiStop and interactive mode. 2003-02-21 03:40:35 +00:00