Commit Graph

14 Commits

Author SHA1 Message Date
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
Cary R 0728690df2 Fix a few cppcheck warnings. 2014-06-27 18:40:34 -07:00
Larry Doolittle 855bf9cfe8 Pick some low-hanging const fruit
Makes more of the code const-correct; there are still plenty of difficult-to-fix const problems left.
No behavior change expected.
2014-06-09 10:47:28 -07:00
Cary R fc7e7640ed Remove some MinGW32-w64 compile warnings. 2012-01-05 17:26:08 -08: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 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 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 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 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