Commit Graph

339 Commits

Author SHA1 Message Date
Stephen Williams d1daf6733f Allow VPI callbacks to var array words.
Functions like $monitor need to attach callbacks to array words if
those words are to be monitored. Have the array hold all the callbacks
for words in the array, under the assumption that the monitored words
are sparse.
2008-05-20 18:30:56 -07:00
Stephen Williams 3189efacbc Fix memory word offset errors
Fix handling writing to a word part select,
Fix readmemb calculations for the word size.
2008-05-19 18:05:27 -07:00
Stephen Williams 0cd946a7af Remove a useless call to vpi_iterate. 2008-05-16 16:18:07 -07:00
Cary R ca880c73fc Fix $ungetc() arguments to be in the correct order.
The arguments to $ungetc() were backwards! This patch fixes that
and adds a bit more checking to the compile_tf routine. It still
needs more work, but that can wait for the major system function
clean up I have planned when I can find the time.
2008-05-15 10:38:41 -07:00
Stephen Williams 8e1f22cd82 AC_CHECK_FUNCS_ONCE is a little too modern for many uses. 2008-05-09 09:55:41 -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
Stephen Williams bbc80a84a6 Rename $log to $log10.
Verilog-2005 defines the base-10 log function to be $log10. This makes
sense because in C the log() function is the natural log. So add the
$log10 function.

Since there may be legacy code that uses the $log function, leave it
defined, but we should consider at least printing a warning when the
$log function is used.
2008-05-03 18:29:52 -07:00
Stephen Williams f5263c9447 Add the va_math module and constants.vams include file.
The va_math.vpi module implements systen-function versions of the
Verilog-A math functions. This library was contributed by Cary R.

Also add the constants.vams include file. This is pretty much
direct from the Verilog-AMS LRM.
2008-04-29 21:20:39 -07:00
Stephen Williams c3ac01d31b Make casts from double to unsigned bits portable.
Several places in Icarus Verilog try to get the bits of the integer
part of a double by casting to unsigned or unsigned long. But that
causes some compilers to generate smart code that converts all values
less then 0 to 0, even though we are after the bits, not the math
value. So be careful to do this cast only to non-negative values and
uminus the bits if necessary to get exactly what we want.

Signed-off-by: Stephen Williams <steve@icarus.com>
2008-04-27 18:21:32 -07:00
Cary R 321114e4db Add an underscore between multiple strength values.
When printing the strength information for a multi bit net this patch
adds an underscore between the individual bit strength values. This
makes it easier to see the individual bit values.
2008-04-15 17:31:35 -07:00
Cary R ef3aacfe36 Make %v print all the bits of a vector.
This patch reworks the %v code to print the strength information
for all the bits of a vector. The code previously only printed
the LSB information.
2008-04-15 17:23:58 -07:00
Cary R 538d3d1f4d Print an error message if $fscanf() is called with a NULL fd.
If $fscanf() is called with a NULL file descriptor an appropriate
error message is printed and the program exits.
2008-02-20 17:16:52 -08:00
Cary R 528af27769 Fix a realloc size error and initialize enable_ in the dff.
The buffer reallocation in scan_format_string() was one character
too small. The enable_ pin to the dff primitive was not given an
initial value.
2008-02-19 10:06:44 -08:00
Larry Doolittle 39dd22ace4 Adjust unusual spacing
minimal changes, nearly eliminates oddball/inconsistent
source code use of whitespace
2008-02-19 09:15:03 -08:00
Larry Doolittle 0e6d6b7416 Fix typos in vpi/sys_display.c
Fallout from me trying to understand the origin of pr1780480
and pr1830834.  Too bad I don't understand c++ and vvp as
well as I understand English!

(Spelling and grammer fixes in comments. -ed.)
2008-02-04 13:33:24 -08:00
Larry Doolittle d9ac146b8f Spelling fixes
only comments and documentation
some punctuation and capitalization for good measure
Changelogs are purposefully untouched
2008-01-29 20:24:24 -08:00
Stephen Williams b297a0a9fe Remove support for vvp32 build
Remove configure and Makefile support for the vvp32 build. Remove
also the libdir64 support.
2008-01-25 17:33:32 -08:00
Stephen Williams 3ea72109f8 Read and include sign of scanned decimal.
Fix simple bug where negative values read from the source file were
not getting their sign. The fix was proposed in pr1876738.
2008-01-21 18:11:28 -08:00
Stephen Williams d992ec4bd4 Declare $rtoi in system.sft instead of the sys_funcs table.
The sys_funcs table should be left to those functions that are handled
internally by the compiler. Really, the internal sys_funcs table is a
legacy from the days before the compiler supported system function
tables in the .sft format.
2008-01-17 12:48:02 -08:00
Cary R e18b64768e Add missing check target in some Makefile.in files.
This patch adds a check target to the Makefile.in files in the
tgt-null, tgt-stub and vpi directories.
2008-01-11 21:52:51 -08:00
Cary R c9e1e1b5cc Add missing include to sdf_lexor.lex
sdf_lexor.lex was missing the <string.h> include file which defines
strdup and strlen.
2008-01-07 19:07:11 -08:00
Cary R 61b6b8358d Speed up the conversion functions and add file/line info.
This patch modifies the conversion functions $rtoi, $itor,
$realtobits and $bitstoreal calltf routines to be more efficient.
This is done by caching the vpiHandle to the argument in the userdata
pointer. This eliminated the need to get the argument iterator, scan
and free the iterator.

It also updates the error messages to use the new file and line
number information that is available for system functions. It also
adds a check that verifies the functions are only called with one
argument and makes the errors fatal.
2008-01-07 18:59:52 -08:00
Larry Doolittle d85683965d fix buggy SDF error message 2008-01-07 18:48:40 -08:00
Larry Doolittle f8d410e2d4 remove lint flagged by gcc-4.3
watch for possible behavior changes in
 elaborate.cc:3409
 vvp/vvp_net.cc:600
2008-01-07 18:39:10 -08:00
Larry Doolittle e6ea5cd409 More lint removal
tgt-vvp/eval_expr.c  uninitialized variables
vpi/sys_display.c  uninitialized variables
vvp/vpi_priv.cc  deprecated string constant usage
vvp/vpi_vthr_vector.cc  deprecated string constant usage

the last entry invokes vpip_name_string() and uses const char *
in the same way as the other 9 callers in vvp/*.cc, the only
difference is that the argument is static instead of computed.
2008-01-04 16:12:33 -08:00
Larry Doolittle 6c5773c0e3 Synchronize lxt_write.c and lxt2_write.c with Tony Bybell
cvs -z3 -d:pserver:anonymous@gtkwave.cvs.sourceforge.net:/cvsroot/gtkwave co -P gtkwave3
delete CVS logs embedded in files
had to add #define wave_alloca alloca to lxt2_write.h

differences remain relative to upstream .h files:
 whitespace
 value chosen for LXT*_WR_SYMPRIME

Regarding the latter, Tony writes "Don't worry about the .h file.
The only difference is a considerably larger initial hash size.
If this isn't a problem with Icarus now, it certainly doesn't
need to be bumped up."
2008-01-04 16:04:18 -08:00
Larry Doolittle 25ad1c174a Clean up compiler warnings
stupid changes to shut up the compiler
tested with gcc-4.2.2
2008-01-04 15:57:09 -08:00
Larry Doolittle 17cc661336 Squelch useless flex-induced warning messages
tested in a gcc-4.2.2 flex-2.5.33 environment
2008-01-04 15:54:03 -08:00
Cary R 21730ab228 Fix definition missing in include file and missing UINT64_FMT.
This fixes the missing include file definitions and fixes three
cases that needed to us UINT64_FMT.
2008-01-03 14:14:54 -08:00
Larry Doolittle 752cf21790 Warnings and spelling fixes.
Correct a variety of spelling errors, and eliminate
a variety of compile time warnings.
2007-12-17 17:42:09 -08:00
Stephen Williams f28dfb6178 Better SDF error handling
Handle basic errors like incorrect or missing SDF files.
2007-12-15 15:25:25 -08:00
Stephen Williams 97f7a97db7 NoEdge IOPATHS may match multiple specify paths.
An IOPATH in the SDF file may match all specify paths no matter
the conditions or edge specifications.
2007-12-14 21:04:20 -08:00
Cary R ff4cba6a96 Add full argument type checking to $dumpvars.
This patch adds argument type checking for $dumpvars module and
variable arguments.
2007-12-14 20:23:50 -08:00
Cary R f53f042553 Fix scope type calculation error in draw_scope (all dumpers).
This patch fixes the calculation of the scope type in draw_scope.
This code is really only used in the VCD dumper so I commented it
out in the other two. The problem was that the lower scope was
used to calculate the scope type. It is also now an error to try
to draw an invalid scope type.
2007-12-14 20:18:13 -08:00
Stephen Williams a83d6bb02c Merge branch 'sdf' 2007-12-13 20:57:39 -08: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 a14d836be3 Support annotation of edge paths
Parse SDF file annotations of edge sensitive delay paths.
Add vpi support for getting the specified edge sensitivity of
an edge sensitive path, and annotate paths with proper attention
to the edge that is specified for the path.
2007-12-13 20:42:06 -08:00
Larry Doolittle 103138cf4b Fix compile time warnings
These warnings actually look a lot like errors.
2007-12-01 18:04:43 -08:00
Stephen Williams f602687187 Support second argument of sdf_annotate
The second argument of $sdf_annotate is the scope that is to be
annotated. The argument is optional, and the default is to annotate
the current scope, where the $sdf_annotate is invoked.

Signed-off-by: Stephen Williams <steve@icarus.com>
2007-11-30 21:57:38 -08:00
Stephen Williams 25a24e748f Merge branch 'master' of ssh://steve-icarus@icarus.com/home/u/icarus/steve/git/verilog 2007-11-30 21:11:44 -08:00
Stephen Williams 26aee6cbae Clean up warnings for round() function declaration. 2007-11-30 21:11:27 -08:00
Stephen Williams 47bffa24a7 Include stdlib.h to remove compile warnings. 2007-11-30 10:20:30 -08:00
Stephen Williams fde334a5d2 Handle empty INSTANCE name
Handle the special case that the SDF CELL instance is empty. In this
case, the SDF file is requesting the current scope instead of an
instance within the scope.

Signed-off-by: Stephen Williams <steve@icarus.com>
2007-11-28 18:17:01 -08:00
Stephen Williams 6416a799c9 Identifers include _ and $ characters. 2007-11-28 18:05:32 -08:00
Stephen Williams d92e7d904f Handle hierarchical instances
Iterate through hierarchical names created by the SDF
parser, and follow the scopes to the cell.

Signed-off-by: Stephen Williams <steve@icarus.com>
2007-11-27 21:44:25 -08:00
Stephen Williams 26f1d50248 Fix parsing of hierarchical identifiers
the lexor didn't allow numbers in the IDENTIFIER name,
and the parser wasn't very nice with IDENTIFIER errors.

Signed-off-by: Stephen Williams <steve@icarus.com>
2007-11-27 21:42:20 -08:00
Stephen Williams 2a269f1bb7 Parse TIMINGCHECK syntax
Parse and ignore the TIMINGCHECK rules, and also parse
and ignore INTERCONNECT delays.
2007-11-27 20:53:48 -08:00
Cary R fd252d1e27 Fix Makefile to correctly work with new sdf code.
Fix the Makefile dependencies so the new sdf code will compile
correctly and remove the appropriate files with make clean.
2007-11-26 18:02:26 -08:00
Stephen Williams ca10a6867a Handle comments
Ignore C/C++ style comments, and also handle a few error
cases a slight bit more elegently.

Signed-off-by: Stephen Williams <steve@icarus.com>
2007-11-26 17:59:53 -08:00
Stephen Williams ea70ae00aa Merge branch 'sdf' 2007-11-22 19:01:20 -08:00