Commit Graph

568 Commits

Author SHA1 Message Date
Cary R 82e946b51a Free the iterator if there are extra arguments.
To avoid extra memory usage on error free the iterator if there are
extra arguments.
2011-10-14 18:02:37 -07:00
Cary R cff0deeacc Update lxt_write and lxt2_write files from GTKWave
Update the lxt_write.[ch] and lxt2_write.[ch] files to the latest from
GTKWave. This is just comment changes.
2011-10-01 09:48:41 -07:00
Cary R 64e16d34f3 Add vhdl_sys.vpi to the make clean target 2011-09-11 12:08:06 -07:00
Cary R 8383188292 Add support to dump the two-state variables.
Add support to dump the two-state variables (bit, byte, short, int and
long) using the fst, lxt, lxt2 and vcd dumpers.
2011-09-11 12:07:02 -07:00
Cary R 507621ef30 Update $scanf, $printtimescale and the general is_numeric check for 2-state
This patch updates the $scanf and $printtimescale routines to work with
two-state variables. It also updates the general is_numeric check to
recognize two-state variables as numeric.
2011-09-11 11:58:16 -07:00
Cary R 746a21b437 Update the $random routines to allow an int, long or bit as a seed.
Modify the $random code to allow the seed to be either an int, long or
bit that is 32 bits or longer. The 32 bit check is new and also applies
to reg/logic variables.
2011-09-11 11:58:09 -07:00
Cary R dc0e66ab90 Update $clog2() to add support for two-state variables.
The $clog2() routine can consider any two state variable argument
as numeric.
2011-09-11 11:57:50 -07:00
Cary R 57f296455a The $value$plusargs() routine can put to a two-state variable.
Update the $value_plusargs() routine so it can put the extracted value
to a two-state variable.
2011-09-11 11:57:30 -07:00
Cary R e7a705d8e6 The $queue routines can use two-state variables.
Update the various $queue routines to use the appropriate two-state
variables depending on the context.
2011-09-11 11:57:08 -07:00
Cary R 45d8925ad2 Add the ability to $display and $monitor a bit, byte, short, int or long var.
Add code so that we can $display and $monitor the two-state variables.
2011-09-11 11:53:19 -07:00
Cary R dcfe1f0c2c Properly define the $ivlh_attribute_event() function.
Technically the sized function is not currently needed by Icarus since
the SFT file handles this type of information, but lets define this so
that things work correctly if we ever switch to using the standard VPI
interface. Also mark this as a system defined function.
2011-07-27 18:33:15 -07:00
Cary R 0d9c04854f Fix reported Mac compile problem.
This patch removes the space between -L and the directory in the vpi
Makefile. It also fixes the line to use the correct variable name
for the LDFLAGS.
2011-07-08 18:19:57 -07:00
Cary R d07db53f0e Further update for the extern "C" declarations.
This patch wraps the routine declarations, etc. in an extern "C" block
instead of giving the individual routines an extern "C" definition.
2011-07-05 19:27:23 -07:00
Cary R f9a611c0cd C++ routines called from C must be defined as extern "C"
A C++ routine that is called from C code must be defined as extern "C".
Also clean up a couple other minor issues.
2011-07-05 19:27:17 -07:00
Stephen Williams 6f10a02b40 Merge branch 'work6' 2011-06-29 19:56:50 -07:00
Cary R ad13fa89dc Remove space issues.
This patch just removes a few spacing issues.
2011-06-26 11:17:31 -07:00
Stephen Williams 91ffc68e95 Add $ivlh_attribute_event for VHDL support
The $ivlh_attribute_event system function helps the Verilog runtime
support <name>'event expressions in VHDL. The vhdlpp generates a
call to $ivlh_attribute_event, which in turn uses callbacks to handle
the support.

This is also the start of the vhdl_sys vpi module. This module should
by included whenever VHDL code is parsed.
2011-06-24 18:42:43 -07:00
Cary R feba73119a Update fstapi.c to match the latest from GTKWave 2011-05-29 09:05:04 -07:00
Cary R 35488ac254 Fix bug in queue average with a very large number of entries.
Icarus is not actually fast enough to run into this issue in a
reasonable amount of time. I discovered this by thinking about
the algorithm and verified the fix with custom code.
2011-05-29 08:50:30 -07:00
Cary R 6cad14c491 Add more comments to $table_model code, etc.
This patch mostly just adds comments, it also changes calles to
index() to strchr().
2011-05-29 08:42:49 -07:00
Cary R b13c899b89 Some more $table_model() changes.
The code should be able to correctly parse any command string and
assign the appropriate values from the file to a structure that will
be used to add the information to the table structure.
2011-05-07 11:46:12 -07:00
Cary R 0597b56ba2 More $table_model code.
This patch adds the ability to process the control string and emit some
debug information.
2011-05-07 11:46:06 -07:00
Cary R e85c43c232 Properly terminate a snprintf() call.
snprintf() copies at most N characters, but the string may not be
terminated correctly. This patch uses sizeof() so that the snprintf()
call matches the size of the buffer and adds code to insert a NULL as
the last character of the string.
2011-05-07 11:44:47 -07:00
Greg Steuck f186c81403 Moved lex prefixes from Makefile.in into the corresponding .lex files.
Added an explicit option prefix="yy" to files that were generated
without an explicit -P.

This makes the lex-generated symbol names self contained without any
help from from build system.
2011-05-07 11:38:32 -07:00
Cary R f61695a03f Fix compile warning. 2011-05-07 11:35:02 -07:00
Cary R 65f187964c Synchronize lxt_write.c with GTKWave (add back const fixes).
The const fixes for lxt_write.c were never pushed to GTKWave so
they were lost in a later sync with GTKWave. These changes have
now been pushed to GTKWave.
2011-04-27 11:05:39 -07:00
Larry Doolittle 347cc67e71 Spelling and related fixes
No effect on executable code.
2011-04-27 10:36:00 -07:00
Cary R 7eb60c9802 We must include the file that has _FILE_OFFSET_SIZE before other headers
To get the correct definition for _FILE_OFFSET_SIZE we must include
the header that loads this before calling the other system headers.
This patch also fixes a minor spacing issues.
2011-04-27 10:33:54 -07:00
Cary R d9253e77c9 Remove some OpenBSD time variable warnings.
Since time is a function OpenBSD does not like us using a variable
named time. This patch fixes that in the sys_queue.c file.
2011-04-27 10:24:51 -07:00
Cary R 10b2310c52 $q_full should return x for an invalid id.
After some more thought I believe it is better for $q_full to return
'bx instead of 2 when $q_full is given an invalid id. This will make
the typical full/not full checks both return false. We still return
an error code in the status variable.
2011-04-20 18:19:53 -07:00
Cary R 54ed0832db Convert a single % at the end of a format string to %%.
If there is a single % at the end of a format string then automatically
convert this to %% so that we get a single % in the output.
2011-04-20 18:13:19 -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 ccf771ec4b Use the ivl malloc, etc. routines in the sys_queue code.
We want to use the ivl definitions for malloc, etc. to check for
errors. This patch adds the include for this to sys_queue.c.
2011-04-20 18:05:28 -07:00
Cary R 2158ebdf0b Fix a few minor cppcheck warnings.
This patch fixes a minor memory leak and slight inefficiency
reported by cppcheck. It also updates the expected warning for
vpi/fstapi.c.
2011-04-20 17:48:09 -07:00
Cary R 12df29af55 Fix space issues.
Thsi patch removes space before end of line, etc.
2011-04-20 17:26:52 -07:00
Cary R c67f1b5bc2 Add support for calculating the average queue wait time.
This patch adds support for calculating the average queue wait
time. This is accomplished by keeping two 64 bit values that
represent the high and low total wait time for all previous
queue elements. The current wait time for any elements still
in the queue are added to this total. The wait time total is
then divided by the total number of items added to the queue.
2011-04-20 16:57:34 -07:00
Cary R 691113208f Add support for calculating the queue mean inter-arrival time.
This patch adds support for calculating the queue mean inter-arrival
time. This is just the latest add time minus the first add time
divided by the number of intervals (the number of adds minus one).
2011-04-13 18:49:07 -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
Cary R 2b95e9b463 Forward port the LEX/YACC definition changes from V0.9
It's best to use the LEX and YACC definitions instead of hard coding
flex/bison so they can be overridden if needed.
2011-04-13 18:46:57 -07:00
Stephen Williams 298495be97 Add vpiBitVar support is $display and other vpi functions. 2011-04-03 17:44:23 -07:00
Cary R 085a5c8d02 Update the FST dumper to include the vpiDefName if it's unique.
This patch adds the vpiDefName for a module if it is different than
the vpiName. This will be used in a future version of GTKWave.
2011-03-23 11:55:34 -07:00
Cary R 2e0accf812 A '$' is also allowed in identifier names (dumpers)
Update the dumper escaped identifier check to allow a '$'
character after the first character in a normal identifier.
2011-03-14 16:47:22 -07:00
Cary R ed0469bac5 Update fstapi files to latest from GTKWave 3.3.19
Update the fstapi.{c,h} file to match the latest from GTKWave.
2011-02-10 19:14:21 -08:00
Cary R 20f3d7c26c Remove some more cppcheck warnings.
This patch removes some more simple cppcheck warnings and updates two of
the cppcheck suppression files.
2011-01-12 16:34:42 -08:00
Cary R 43c204ba87 Add v2009.vpi to vpi make clean target.
The vpi make clean target needs to remove v2009.vpi.
2011-01-12 15:44:38 -08:00
Cary R 25c1795fb7 Update fstapi.{c,h} files to match GTKWave 3.3.17.
The files generated after this patch is applied are not backwardly
compatible with older versions of the API.
2010-12-02 16:15:55 -08: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 da18ba6e4e Various minor enum bugs. 2010-11-22 19:41:00 -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
Cary R bebdcd5adf Assert if the vcdid generation overflows.
It should never happen, but if it does assert vs generating an
invalid VCD identifier.
2010-11-18 16:43:08 -08:00