Commit Graph

5495 Commits

Author SHA1 Message Date
Cary R d0457a1ac2 Generate better error messages for concat. with indefinite width.
This patch generates a more user friendly error message for a
concatenation with an indefinite width operand.
2009-04-17 17:59:28 -07:00
Cary R fc8549c9f8 Add $readmempath to set a search path for $readmem{b,h}.
This patch add a new system function $readmempath. It accepts
a ":" separated list of directories that $readmem{b,h} will
use when trying to open a given file. If the file given to
$readmem{b,h} starts with a '/' (an absolute path) the search
list will not be used. A new call to $readmempath will replace
the previous search list with the given list. The search list
elements are check to see if they exist and are directories.
If not a warning will be displayed and they will not be added
to the list.
2009-04-17 17:44:52 -07:00
Stephen Williams 5529182f1f Spread the vvp_net.h contents out a bit.
the vvp_net.h header file is getting pretty huge. This divides
the obviously separable signal functor code out into its own
header and source files.

Also, fill out the use of the filter member of the vvp_net_t
object. Test the output of the vvp_net_t against the filter.
2009-04-15 19:08:37 -07:00
Stephen Williams 8310babdfe Merge branch 'master' into vvp-net-out-rework 2009-04-08 21:05:30 -07:00
Cary R 047828ded0 Allow macro expansions to take arguments with multiple arguments.
This patch allows a macro expansion to have an argument which
itself has multiple arguments (handle nested ",").
2009-04-08 17:55:45 -07:00
Cary R 5e723bfd61 Add support for recursive modules inside generate blocks
This patch adds support for recursive module loops if the
loop contains a generate block. The assumption is that the
user is doing the right thing in the generate block to make
the loop terminate. For this case there is also a check
that limits the number of loops (default 10). This prevents
the system from crashing when the user did not correctly
terminate the looping structure. The limit can be changed
by the user if needed.
2009-04-08 17:49:12 -07:00
Cary R a7741d2bd5 Use the port that has already been fetched.
This patch reuses the port that has already been fetched vs
fetching it again.
2009-04-08 17:45:25 -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 d074a37a2d For div/mod only sign extend if both arguments are signed.
Only sign extend the operands for division or modulus if
both of them are signed. Previously only the individual
operand signedness was being considered.
2009-04-08 17:37:32 -07:00
Cary R 46350da5f0 Add support for empty task port lists with a warning.
The standard does not allow this, but it appears that other
simulators do. This patch adds the functionality, but prints
a warning message for the invalid task definition.
2009-04-08 17:31:47 -07:00
Stephen Williams 6f8b229646 Remove peek_out() access to the vvp_net_t out member.
Fix up the last bits of code that accessed the ->out member of the
vvp_net_t class. Now the out member is only accessed by send_* methods.
2009-04-06 21:47:21 -07:00
Stephen Williams 6d34b41dce Hide the "out" member of the vvp_net_t object.
The out pointer of a vvp_net_t object is going to be a bit more
sophisticated when we redo the handling of net signals. Take a step
towards this rework by making the pointer private and implementing
methods needed to access it.
2009-04-03 20:40:26 -07:00
Cary R e987162cb9 Skip leading space for some codes in scanf routines.
Most conversion codes in the scanf routines are supposed to
skip leading space. This patch adds that functionality.
2009-04-03 17:46:29 -07:00
Cary R b1cb80b32e Fix constant CA delays to support two/three values.
This patch fixes the code generator to correctly create three value
constant delays. It also fixes a bug in the compiler related to the
precalculation of the high-Z delay when only two delays are given.
Previously if was using a pointer not a value comparison to find
the minimum value.

Variable delays should work when one or three values are given.
For the two value case we need to do a comparison at run time and
that will require changing the compiler/run time interface so that
can only go into the V0.10 branch. This patch can be applied to
both development and V0.9. I have added a sorry message and an
assert for this case. I will add the variable two delay case at a
later time. We also do not support mixing constant and variable
delays on a single statement. That is a much bigger change and
can wait until someone asks for it.
2009-04-03 17:36:42 -07:00
Cary R 337c9e7577 Add support for getting the size of a real array word.
This patch adds code to get the size of a real array word.
We currently define the size if a real to be 1.
2009-04-02 18:34:41 -07:00
Cary R 85e2bf3e55 If a PGAssign is driven by a select then make a driver.
When a PGAssign is driven by (r-value) a bit, part or indexed
select and the strength is not the default (supply). Then
we need to create a driver (BUFZ) to convey the strength
information.
2009-04-02 18:30:26 -07:00
Cary R 74ea0ecb4a Show verireal constants with a decimal point.
When displaying a verireal constant value force the display
of the decimal point and trailing zeros. This prevents 2.0,
etc. from being display as "2". which can be confused with
decimal two.
2009-04-02 18:26:02 -07:00
Cary R 464310f522 Report an error when trying to take the concatenation of a real value.
This patch adds checks in various places to prevent the user from
taking a concatenation of a real value.
2009-04-02 18:20:50 -07:00
Cary R 3517f11c2c Enhance the real selection is invalid error messages.
This patch enhances the error messages emitted when trying to
select part of a real value. It now includes the signal name
so it is easier to debug.
2009-04-02 18:13:38 -07:00
Cary R 5852f1eb7a Report an error when trying to take the select of a real value.
This patch adds checks in various places to prevent the user from
taking a select of a real value (bit, part and indexed selects).
2009-04-02 18:00:36 -07:00
Cary R caab6cab9d A right shift is only signed for an ARS.
The signed_flag should only be set when the expression is signed
and an ARS is used a normal RS should never be signed.
2009-04-02 17:48:08 -07:00
Cary R 1dbc517164 Add limited support for getting and putting to real array words
This patch adds basic support for getting and putting values to
real array words. This will be finished during the VPI rework.
2009-04-02 17:33:58 -07:00
Cary R ad39445eed Arrays can have bit selects of individual words.
The l-value code was not handling the case of a bit select for
an individual array word.
2009-03-30 19:53:34 -07:00
Cary R 3d449f60a2 When determining if a signal is an array use array_dimensions_
The previous code looked for more than one array word to determine
if the given signal was an array or not. The problem with this is
that a single word memory was considered a signal. This is fixed
here by looking for an array_dimension to be greater than zero.
2009-03-30 19:47:10 -07:00
Cary R d7f272d14c Fix problems in rshift code.
This patch fixes the following problems in the right shift code.

The >>> result is only signed if the l-arg is also signed.

The r-arg is always unsigned.

Only sign extend the l-arg when the >>> operator is used.
This relates to an optimization for certain constant shifts.

Removed some obsoleted/outdated code.
2009-03-30 19:39:26 -07:00
Larry Doolittle a05ac4b5f4 Make VHDL code generator skip over virtual pins
Fixes pr2701438
2009-03-30 19:36:11 -07:00
Stephen Williams 82d9b18cc4 BUFZ devices are strength-aware
When vvp_vector8_t objects come in, pass them out as vec8. The
BUFZ device is used in situations where this acts much like a
simple wire.
2009-03-27 17:19:30 -07:00
Cary R a8716cf759 Add message the the $dumpports* task are not available
These are in the standard and we did not have error messages
for them. This patch make calling these tasks a compiletf
fatal error.
2009-03-27 16:10:53 -07:00
Cary R db3ff1643b We are deprecating the $log function in favor of $log10.
When the VAMS math functions were originally built we did a
straight copy of the log() function to $log(). This can
conflict with other Verilog-D definitions of $log. We
need to deprecate this function and remove it before the
next major release.
2009-03-26 19:37:45 -07:00
Cary R 86c22dec4f Use AC_HELP_STRING instead of AS_HELP_STRING.
The later causes a warning under MinGW. The former appears
to work everywhere.
2009-03-26 19:34:50 -07:00
Cary R a6529c2c59 Add the $fread() system function.
This patch adds the $fread() system function. Icarus does not
currently allow missing arguments in functions so the following
standard specified functionality is not supported:

  res = $fread(mem, fd,,count);

It also fixes a memory leak in fopen related to the get_filename
refactoring I recently did.
(cherry picked from commit 036c176e8b)
2009-03-26 14:06:31 -07:00
Cary R 72c2e3f0ac Use a single = in configure.in test
The ability to use == is an extension so use the more common =.
(cherry picked from commit 327e8d0ec0)
2009-03-26 14:04:50 -07:00
Cary R a2ec51c411 Add guards in CREATE_VERSION script.
This patch adds the same guards that the other two scripts
create for the version_tag.h file.
(cherry picked from commit 809044cbf8)
2009-03-26 14:02:43 -07:00
Larry Doolittle d7b34b53b5 Add support for virtual reg arrays to tgt-stub
This patch adds support for virtualized register arrays to the
tgt-stub back end.

Based Cary's patch, but with a slightly different style.
Both work fine.
2009-03-26 11:35:50 -07:00
Stephen Williams 4fb14523c8 Clean up release builder scripts.
The version.h file is generated by the Makefile, we should
prefill the version_tag.h file.
(cherry picked from commit 4205752bb0)
2009-03-24 08:14:58 -07:00
Stephen Williams a2efe4be0d Move on to 0.10 devel.
This was cherry-picked from the v0_9_1 branch commit:

  "Get ready for the 0.9 first release"

and modified to reflect that this is now the new devel branch
headed for the future 0.10 release.
2009-03-24 08:13:54 -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
Stephen Williams ff450cdcb8 Slightly more portable version of configure test.
(cherry picked from commit 90f37fe3cb)
2009-03-24 07:59:05 -07:00
Purdea Andrei c9d2400dd0 fixing: %0b format prints nothing for a 0 input
the following example returns ||. This patch fixes it to return |0|.
module t();
wire [3:0] b;
initial
    $monitor("|%0b|", b);
assign b = 0;
endmodule
2009-03-19 09:07:02 -07:00
Cary R be158dd45f Cleanup lxt and lxt2 EOS data.
This patch cleans up the memory allocated in the lxt and lxt2
$dumpvars routines.
2009-03-19 08:59:10 -07:00
Cary R fa8a3d6c2e Handle zero repetition in a synthesized concatenation.
It is valid to have a repetition of zero inside a concatenation
that has other elements with a defined width. This patch adds
this functionality to the synthesize method. It also prints
an error if you try to synthesize a zero width constant.
2009-03-17 15:58:07 -07:00
Stephen Williams 6715426833 fix the arithmetic of multi-word division.
The Multiword division was not handling some degenerate high
guesses for the intermediate division result guess. The end result
was an assertion. Recover from this case.

(Does the addinb back of bp need to be optimized better?)
2009-03-13 21:59:44 -07:00
Stephen Williams c4a62dee0d Pass unsigned-ness of arithmetic operators through operands.
The arithmetic operands are signed only if both operands are signed.
If the expression is unsigned, then the expression as a whole needs
to be processed as unsigned in order to get padding right.
2009-03-11 13:22:11 -07:00
Larry Doolittle 86bf6c447b Drop useless CVS stuff in .txt files
Remove useless, redundant, misleading, and misspelled $Id$ and $Log$
cruft from all .txt files.
2009-03-11 10:34:52 -07:00
Larry Doolittle 3a18bda8ee Don't make useless arrays of nexa
When a pin array is virtual, dll_target::signal() doesn't need
to make a corresponding set of stub nexa.

This patch includes new detection of oversized arrays, configurable
with the ARRAY_SIZE_LIMIT flag.  This limit only applies to devirtualized
arrays; virtual arrays are only limited by your architecture's
unsigned int type.

The concept and earlier versions of this patch have been successfully
stress-tested by multiple people.  This one causes no testsuite
regressions on my machine.

Closes: pr2023076
2009-03-11 10:30:37 -07:00
Larry Doolittle 932aa49b38 Detect overflows converting to long
The code is ugly, but the results are good.
No regressions in existing testsuite, needs a new entry.
2009-03-11 10:26:52 -07:00
Cary R ac4cb1bbe9 You must assert a logical not NULL.
This fixes a small problem where an assert was being called
with NULL instead of 0.
2009-03-09 19:54:44 -07:00
Larry Doolittle b0c4a87133 Spelling fixes
Mostly comments, but includes user-visible debug messages.
2009-03-09 14:39:36 -07:00
Larry Doolittle 67381431ed Add user interface to pin virtualization
Flag is DISABLE_VIRTUAL_PINS.  Try to give a helpful hint for
how to work around any problems our regression testing might
have missed.
2009-03-09 14:37:47 -07:00
Larry Doolittle f344515e38 Remove valgrind errors triggered by virtual pins
NetBus wasn't initializing pin direction.
I hope Link::PASSIVE is correct for busses!
No test suite regressions.
2009-03-09 14:34:30 -07:00