Commit Graph

49 Commits

Author SHA1 Message Date
Stephen Williams 29ac33493e Add support for a command line dumpfile option
The -dumpfile=<path> vvp extended argument sets the default nanme to use
for the various dumpers. If this flag is not given, the default is "dump".
The $dumpfile system task overrides the default or this command line flag.

This commit also factors out all the dumpfile selection code for the various
dumper implementations.
2023-02-26 14:05:42 -08:00
Cary R b35f9e13c7 Move the bit vector functions to the SV table 2018-09-03 08:32:28 -07:00
Cary R 40558160e7 Add support for bit vector system function in vpi 2018-08-30 22:31:15 -07:00
Larry Doolittle 6ebb57195b Fuss with C function prototypes
119 formal void parameters added to keep -Wstrict-prototypes happy.
Process found one real missing prototype in vpi/vcd_priv.h:
EXTERN void vcd_names_delete(struct vcd_names_list_s*tab);
8 such warnings left, all in Tony's code
2014-07-08 13:44:11 -07:00
Stephen Williams bc9e31a444 Cleanup of v2009.vpoi module. 2013-01-05 11:39:17 -08: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 2bef6b8624 Detect and implement string.len() method, and string[index] expressions
Implement the string.len() method in the system.vpi, and implement
the string[index] method in vvp.
2012-07-22 10:52:06 -07:00
Cary R c75d30455d Preliminary support for $table_model.
This patch adds preliminary support for implementing the $table_model()
function for Verilog-A. It is not currently functional, but the VPI
interface routines and data file parsing are mostly complete. The big
things left are building the data structures and adding the interpolation
and extrapolation routines.

We also need to fix vvp to identify constant strings/parameters in a
structural context.
2011-04-20 18:07:01 -07:00
Cary R 7a473166d9 Add the stochastic (queue) tasks/function
This patch adds full support for the stochastic tasks/functions except
the mean inter-arrival and average wait statistics are not currently
available. These will be added in a later patch. This implementation
goes a bit beyond the standard and supports the following:

 1. The job and inform arguments support 32 bit four state values.
 2. The id for all routines, the job and inform arguments for $q_add(),
    the statistic code for $q_exam() along with the queue type and
    maximum length arguments for $q_initialize() can be less than or
    equal to 32 bits. The argument will be sign extended if needed to
    fill the internal 32 bit value.
 3. The job and inform arguments to $q_remove() and the status argument
    for all the routines must be 32 bits, but do not have to be an
    integer variable (e.g. a 32 bit register or part select is OK).
 4. An undefined bit in the id argument for any of the routines will
    return a status of 2 (undefined queue id). Undefined bits are not
    automatically converted to zero.
 5. Undefined bits in the $q_initialize() queue type and maximum
    length arguments or the $q_exam() statistic code argument are also
    flagged as an error (are not converted to zero).
 6. The $q_full() function returns 2 on error, the other routines that
    return a value $q_remove() job/inform arguments and the $q_exam()
    statistic value argument will usually return x on error.
 7. An invalid statistic code will set the $q_exam() status to 8.
 8. The $q_exam() statistic value argument can be 32 bits or larger.
    This allows returning large statistical time values.
 9. All time values are internally saved in simulation time units.
    They will be converted to the calling module's time unit (with
    rounding) before they are returned.
10. If a $q_exam() statistical value is too large to fit into the
    variable the maximum positive value will be returned and the
    status code will be set to 9 (value is too large).
11. If a statistical value is currently undefined $q_exam() will
    return 10 (no statistical information) (e.g. using code 5 on an
    empty queue).
2011-04-13 18:48:57 -07:00
Larry Doolittle 6388430661 Down payment on const-correctness
Clears out the unambiguous and easy-to-fix const faults,
so we can focus better on the fundamental ones.
2010-09-29 17:15:40 -07:00
Cary R 4192941748 Add fst dumper options and document lxt2 options.
This patch documents that the lxt2/lx2 dumper supports -speed and
-space options. It adds -speed, -space, -space-speed and
-speed-space options for the fst dumper. Here are results for a
gate level back annotated design using the fst dumper.

<none>  12.88 seconds 3.5 Meg dump file.
-space  12.89 seconds 2.9 Meg dump file.
-speed  12.36 seconds 4.6 Meg dump file.
-<both> 12.84 seconds 3.2 Meg dump file.
2010-05-23 17:18:27 -07:00
Cary R f11ba81202 Add initial fst support.
This patch is a slight modification to files Tony Bybell (the author of
GTKWave) send to me. We still have a few more changes we plan to make,
but this should be functional enough for initial testing. Multi-treading
and speed/size flags will be added shortly.
2010-05-21 17:26:44 -07:00
Stephen Williams f900b6d541 Add the Verilog-2005 and Verilog-AMS constant system functions.
This patch adds the constant system functions for Verilog-2005
and Verilog-AMS. These are evaluated at compile time. $abs(),
$min() and $max() support their polymorphic behavior in the
compiler where it really matters. They are always evaluated
as reals in the run time and the result/argument(s) will be
converted as needed.

The Verilog-2005 functions are available if using the 2005
generation (default) and if either the icarus-misc (also on
by default) or verilog-ams flags are set.

The Verilog-AMS functions are available if either the
icarus-misc or verilog-ams flags are set.
2008-08-29 21:11:44 -07:00
Cary R 768633e464 Add $clog2 function.
This patch adds the $clog2 system function. It also makes this
function work as a constant function. The runtime version still
needs to be updated to use an integer based version instead of
the current double based method. The double method suffers from
rounding errors.
2008-08-20 08:59:36 -07:00
Cary R 4010f6e710 Add $simparam and other fixes.
This patch adds $simparam and $simparam$str from Verilog-A.
The analog simulator parameters return 0.0 or N/A. The
vvp_cpu_wordsize system function has been moved into the
$simparam call and is now named CPUWordSize.

This patch also starts the factoring of common code in the
vpi directory. Some routines were renamed.

The priv.c file was renamed to sys_priv.c to match the
include file.

System functions can now have strings put to their output.
2008-06-03 20:56:37 -07:00
Cary R 3a8a6976e1 Add $vvp_cpu_wordsize function
This patch adds a new system function $vvp_cpu_wordsize. It returns
the size of the underlying CPU word (long) in bits. This function
can be used to write fully portable tests for the test suite. Other
functions will be added as needed.
2008-05-07 09:42:02 -07:00
Cary R d3880d02c7 Cleanup dumper code (VCD/LXT/LXT2/none)
This patch fixes a number of problems associated with the various dumpers.

1. It catches the problem uncovered in pr1809904 and prevents the core
   dumps from happening. It prints a warning message if you try to change
   the file after the program has started dumping data to the file.

2. It makes all the dumpers work in the same manner. Before the VCD
   $dumpfile was processed at compile time, but the LXT/LXT2 versions
   did this at run time. The correct place for this is the run time so
   that you can pass the task a calculated name.

3. All the dumpers use common compiletf routines located in vcd_priv.c

4. Make the LXT/LXT2 $dumpfile commands only get the file name and
   let $dumpvars actually open the file. This matches the VCD code.

5. Fix the $dumpfile code to allow calculated file names.

6. Make dumpvars without a scope/variable match all toplevel modules
   not just the toplevel module the $dumpvars was located in. This
   now matches the standard (2001).

7. Simplify the no dumper code (vcdoff.c) and add missing functions.

8. Cleanup the code and messages.

9. vvp can take -none for no dumper.
2007-12-13 20:48:16 -08:00
Stephen Williams c5950e3aa6 Add stub $sdf_annotate function.
Add the $sdf_annotate function infrastructure, and a stub parser
that can parse miniman SDF files.

Signed-off-by: Stephen Williams <steve@icarus.com>
2007-11-18 17:36:03 -08:00
Cary R 17960013e5 Add a mark at simulation end for vcd/lxt/lxt2 files.
This patch adds marks at simulation end if needed and enabled (on
and not over the limit) for vcd/lxt/lxt2 files. End of simulation
callbacks also now have the correct simulation time. The default
file names for lxt and lxt2 now match the vcd file except for the
extension. lx2 is also an alias for lxt2 and the default lxt2 file
extension is lx2. This matches what GTKWave expects. Any lxt2
diagnostic output print LXT2 instead of LXT to make it clear which
dumper you are using.
2007-11-10 16:27:45 -08:00
Cary R 3543c0605c Disable lxt support if libbzip2 is not found.
Configure was checking for libbzip2, but it was not doing anything with
the result. This patch disables lxt support if libbzip2 is not found.
2007-10-18 21:17:50 -07:00
steve 382c4d74fd Add the scanf functions. 2006-08-03 05:06:04 +00:00
steve 50bf2095df Move Mersenne Twister to $mti_random, and make
the standard $random standard. Also, add $dist_poisson.
2004-06-09 22:14:10 +00:00
steve 4987970af4 Give the vip directory its own configure and vpi_config.h 2004-01-21 01:22:51 +00:00
steve 5aadc310f7 Call register for fileio functions. 2003-10-30 04:52:54 +00:00
steve 1c51e1787c Disable lxt when zlib is missing. 2003-09-13 01:28:47 +00:00
steve af806ed9c3 Add lxt2 support. 2003-09-01 04:04:03 +00:00
steve f40ea15cce Implement $realtobits. 2003-03-07 02:44:33 +00:00
steve cc1e952d0b Add means to suppress wveform output 2003-03-06 20:04:42 +00:00
steve 62ef34ea04 Update lxt_write implementation, and add compression control flags. 2003-02-20 00:50:06 +00:00
steve 52bf4e613f conditional ident string using autoconfig. 2002-08-12 01:34:58 +00:00
steve 07bee5ca72 Add $plusargs system functions. 2002-04-07 04:37:53 +00:00
steve ac4fbb3e41 allow runtime selection of VCD vs LXT. 2002-04-06 21:33:29 +00:00
steve 0dc5e5e29d Add LXT dumper support. (Anthony Bybell) 2002-03-09 21:54:48 +00:00
steve cbd501b865 Fix some Cygwin DLL handling. (Venkat Iyer) 2001-09-30 16:45:10 +00:00
steve b825f8d2b2 Create a config.h.in file to hold all the config
junk, and support gcc 3.0. (Stephan Boettcher)
2001-07-25 03:10:48 +00:00
steve 660fd7c1d4 Update the mingw build to not require cygwin files. 2001-05-22 02:14:47 +00:00
steve de8c725890 Mingw32 support (Venkat Iyer) 2001-05-20 15:09:39 +00:00
steve 8b5f62a5e5 Support $deposit to a wire or reg. 2001-04-26 00:01:33 +00:00
steve 4abf4b0a9a include vpi_user.h. 2000-12-14 23:36:34 +00:00
steve 4d27b947bc Add the general $time system function. 2000-11-01 03:19:36 +00:00
steve b34a451cbc Cygwin port changes from Venkat 2000-09-30 03:20:47 +00:00
steve fbe475ef7d Add infrastructure for system functions, move
$time to that structure and add $random.
2000-05-04 03:37:58 +00:00
steve b734ecf02f Macintosh compilers do not support ident. 2000-02-23 02:56:53 +00:00
steve 5fa7e1c31b Add the VPI implementation of $readmemh. 1999-12-15 04:01:14 +00:00
steve 02f8099aa7 Add VCD output and related system tasks. 1999-11-07 20:33:30 +00:00
steve 2d0e11283d Convert vvm to implement system tasks with vpi. 1999-08-15 01:23:56 +00:00