Commit Graph

4975 Commits

Author SHA1 Message Date
Stephen Williams 0bd1739225 Merge branch 'vhdl' 2008-10-27 09:19:13 -07:00
Stephen Williams 038b024e71 Merge branch 'master' into verilog-ams 2008-10-26 21:59:53 -07:00
Stephen Williams 27410f5d88 Remove the now obsolete NetNet list in NetScopes.
Now that NetNet objects in NetScopes are kept in a map, remove the
linked list for scanning them. This improves the lookup process from
an O(e**N) process to more like O(log(N)). This matters for very
large designs.
2008-10-26 20:42:11 -07:00
Stephen Williams 0af896a7ff Keep a map of NetNets for fast access.
It turns out that netnets in scopes are accessed a lot, and mapping
them may help with performance.
2008-10-26 16:50:46 -07:00
Stephen Williams 81a0007f22 Add developer quict start.
Some basic documentation to help new developers get oriented.
2008-10-26 16:34:21 -07:00
Stephen Williams 2a5ea9e874 Remove the vpip contents.
These files are (were) related to the old vvm backend that is no longer
in use. Thus, these files are dead code.
2008-10-26 14:29:09 -07:00
Stephen Williams b9272f750d Update the BUG submission guidlines. 2008-10-26 13:43:35 -07:00
Nick Gasson f49a4e4336 Merge branch 'master' of git://icarus.com/~steve-icarus/verilog into vhdl 2008-10-26 12:48:22 +00:00
Cary R 26e1693b2f generate case items can have an optional statement.
generate case supports optional statements by putting
 a ';' in place of the statement. This patch adds
this functionality for all generate case items.
2008-10-25 23:27:00 -07:00
Stephen Williams 68fbb94b3a Basic elaboration of analog contribution statements.
Get at least basic elaboration of analog processes and contribution
statements. Bring the statements and analog statements together and
net future elaboration work sort out which statements are valid in
a given context. This makes sense because there really is a lot of
syntactic overlap, and analog behavioral code is processed somewhat
sequentially.
2008-10-22 21:56:00 -07:00
Stephen Williams 5aa810dde7 Infrastructure for elaborating analog statements.
Put together the infrastructure for elaborating analog statements,
including create the NetAnalogTop objects that hold analog statements
and are in turn held by the design.

While doing this, clean up the various unique initial/always enumerations
to use the ivl_process_type_t type.
2008-10-21 22:15:49 -07:00
Larry Doolittle 365960df9d Spelling fixes
No code changes.
2008-10-21 19:55:19 -07:00
Cary R 644465ccc1 Remove one input is const. Z mux optimization.
The optimization that allowed a mux that had one input always
connected to high-Z produces code that is actually slower than
the original mux, so for now we are removing that optimization.
2008-10-21 19:51:07 -07:00
Larry Doolittle 904e76f176 Shadow reduction part 3
Continue cleaning up shadowed variables, flagged by turning on -Wshadow.
No intended change in functionality.  Patch looks right, and is tested
to compile and run on my machine.  No regressions in test suite.
2008-10-20 21:43:02 -07:00
Cary R de2b10b445 An optimized mux should use MOS devices not bufif devices.
The bufif devices do not correctly propagate the Z value as
required by the standard. The MOS devices do propagate a Z
value, but they do not correctly handle the case where both
inputs are Z and the select is undefined/Z. The standard
specifies that this should be X, but we produce Z. The full
MUX and %blend operator also function this way, so Icarus
may not match the standard, but it is consistent. I would
also argue that the standard is incorrect. If both inputs
are Z then the output should be Z no matter what select is.
2008-10-20 21:34:00 -07:00
Stephen Williams a654bdc169 Clean up some handling of test_width for ternary expressions.
The condition expression needs its width tested, even if the width
is not used. Also clean up some handling of widths/types for other
expression types.
2008-10-18 22:00:22 -07:00
Martin Whitaker cb2ed9210c Fix for pr2169870.
This patch fixes a bug which prevented storage being allocated for
automatic tasks that had no input or output parameters.
2008-10-16 21:06:38 -07:00
Cary R 50550ca79e Fix %ix/getv and %ix/getv/s documentation.
These two operators had their arguments wrong.
2008-10-16 21:03:00 -07:00
Larry Doolittle f3cb18343a Conditional test width
Add the test_width call for PCondit expr_
Very similar to commit 5fdd9d8339
2008-10-16 21:00:36 -07:00
Cary R c6a5a43620 Fix port signedness calculation.
This fixes the sign calculation for port padding. It also reports if
the padding will be signed or not in the warning message. The inout
calculation may not be correct. It requires both the signal and the
port to be signed, but inout is not currently padded anyway.
2008-10-16 20:55:09 -07:00
Cary R b0e57a1a67 Ignore PS that are outside the signal and allow PS to extend past the signal.
If a part select (either a constant or constant indexed part select)
of a L-value is fully outside the signal the part select will be
omitted after printing a warning. If a part select straddles the
upper portion of a signal a warning will be printed. The run time
will use only the appropriate part of the select. Straddling the
lower part of the signal is not currently supported and a message
is printed for this case.
2008-10-14 19:47:55 -07:00
Stephen Williams 5fdd9d8339 Test the width of expression for shift amounts.
The right-operand of shift expressions is self-determined, but we still
need to run a test_width to get the PExpr decorated with types and
expression widths.
2008-10-14 19:36:48 -07:00
Nick Gasson 8a3309d79d Add a comment to the output about casex/z translation 2008-10-14 20:21:19 +01:00
Nick Gasson a47b7352b4 Add casex/z support
A casex statement cannot be directly translated to a VHDL case
statement as VHDL does not treat the don't-care bit as special.
The solution here is to generate an if statement from the casex
which compares only the non-don't-care bit positions.
2008-10-14 20:16:10 +01:00
Stephen Williams fff5e494ed Do not truncate subtraction expressions based on l-value.
The l-value doesn't really constrain the size of unsized expressions
because there are possible sub-expressions that may pull high bits
down to the low bits. (Divide, for example.)
2008-10-13 22:06:03 -07:00
Stephen Williams 1c90997499 concatentations that reduce to constants need proper signed-ness
It is possible, via the use of the $signed() function, for concatenation
expressions to be signed. Make sure the evaluated constant had the
proper sign by checking explicitly.
2008-10-13 20:50:56 -07:00
Stephen Williams 1a3e655285 Merge test_width rework
This collection of patches fixes a variety of bugs with the handling
of signed-ness in exprsesions.
2008-10-13 20:23:50 -07:00
Larry Doolittle 3adcbb5611 Shadow reduction part 2
Continue cleaning up shadowed variables, flagged by turning on -Wshadow.
No intended change in functionality.  Patch looks right, and is tested
to compile and run on my machine.  No regressions in test suite.
2008-10-13 20:12:47 -07:00
Martin Whitaker 647b3e5bda Bias storage of events towards static scopes.
This patch modifies the code that finds and combines similar events
such that if similar events are found in both static and automatic
scopes, the retained event will be in a static scope. This is a
performance enhancement, as VVP has more run-time overhead when
handling events declared in an automatic scope.
2008-10-13 20:10:22 -07:00
Cary R c41fb50929 Copy from the existing function when duping a system function.
This code was likely never checked properly since it makes no
sense to copy the expression from the new temporary system
function. You must copy the value from the current function.
2008-10-13 20:06:41 -07:00
Stephen Williams c5d4d9eec1 Merge branch 'master' of ssh://steve-icarus@icarus.com/~steve-icarus/git/verilog 2008-10-13 20:00:49 -07:00
Cary R 9cb62a4d64 Check that numbers fit into the correct immediate width (32 bits).
Even on 64 bit machines immediate values should be limited to
32 bits so that the a.out file will run correctly on a 32 bit
machine. This patch fixes a number of places where the code
generator was not checking for/observing this.
2008-10-13 19:56:46 -07:00
Stephen Williams 25f6282a54 Generate signed comparisons independent of the signedness of the expression
The signedness of comparison expressions is typically unsigned, even if
the comparison to be performed is signed. The comparison (and particularly
the expr_synth of the comparison) needs to account for this explicitly.
2008-10-13 19:43:02 -07:00
Stephen Williams 55b8ff4441 Pad the subexpression of unary not.
The operand of unary not needs to be padded to the expression width
before the operator itself. Otherwise, the high (pad) bits will come
out wrong.
2008-10-12 21:38:07 -07:00
Stephen Williams 62f518c205 The signedness of a ternary expression comes from its operands.
If either of the operands of a ternary expression are unsigned, then
both are treated as unsigned. It works just like a binary expression
in that regard.
2008-10-11 21:52:41 -07:00
Stephen Williams 864a86f7ee Multiply nodes are always unsigned.
It is up to the elaborator to sign-extend the inputs if the multiply
is signed in the Verilog source. The run time always processes the
multiply as unsigned.
2008-10-11 21:08:14 -07:00
Stephen Williams 995fc380e8 Get padding of signed comparison operands.
The results of comparisons are unsigned, but the arguments may be signed
and the calculation performed may be signed. Handle the padding properly
for comparisons so that the math is properly signed.
2008-10-11 09:20:49 -07:00
Stephen Williams bd71b7fbb2 Real valued multiply are always signed.
By definition.
2008-10-11 09:19:11 -07:00
Stephen Williams 3a99a5e800 Suppress operand has_sign if expression is unsigned.
Fix processing of arguments of +- and * when only one of the operands
is signed.
2008-10-11 08:39:06 -07:00
Stephen Williams a9497e9c6a Less agressive padding of unsized lossless addition.
When doing lossless addition to an unsized constant, we make the size
be width of an integer, only to be consistent with other tools. In fact,
don't go overboard if we don't have to.
2008-10-10 20:45:11 -07:00
Stephen Williams c85eff93f2 The test_width methods scan and mark expressions with type and size.
Later passes need the intermediate results for width and size so that
some special cases, were self-determined arguments occur, can be
processed properly during elaboration. This can be especially tricky
and interesting for ternary expressions.
2008-10-10 20:42:07 -07:00
Larry Doolittle c010145eaf Shadow reduction part 1
Start cleaning up shadowed variables, flagged by turning on -Wshadow.
No intended change in functionality.  Patch looks right, and is tested
to compile and run on my machine.  YMMV.
2008-10-09 11:55:26 -07:00
Martin Whitaker b5ad161f90 Fix for pr2148500.
This patch fixes the expression width calculation for a multiply
operation with an unsized operation. The expression width needs
to be at least the minimum of the maximum multiply result width
and the width of an integer.
2008-10-09 11:52:40 -07:00
Martin Whitaker 610dedc2b8 Fix for pr2146824.
Currently, a bitwise boolean operator will cause the expression
width to be reduced to the size of the result. This can give
rise to incorrect results. This patch changes the behaviour to
take into account the required precision for calculating the
two operands.
2008-10-09 11:33:14 -07:00
Martin Whitaker 082e06edb0 Remove checks for constant expressions from the parser.
This patch removes all the checks for constant expressions performed
during the parsing phase, as these checks are (mostly) repeated during
elaboration. It adds the missing check in the elaboration phase (the
RHS of a register initialisation), and improves the error reporting
and error recovery in other checks.

This patch fixes pr2132552, which was caused by a fault in the parser
constant expression checking.
2008-10-09 11:11:32 -07:00
Nick Gasson fd4018cb33 Fix IVL_LPM_MUX where inputs are different signedness to outputs 2008-10-05 17:08:19 +01:00
Nick Gasson b40de5ccb0 Implement IVL_LPM_CMP_NE(E)
Looks like I forgot this one
2008-10-05 17:04:19 +01:00
Nick Gasson a7cbb38248 Fix resizing of constant bit vectors
Emitting a VHDL expression like Resize("01", 32) is ambiguous
between interpreting "01" as a Signed or an Unsigned. There's
no point actually outputting this as we can sign-extend the
constant value in the code generator, which is what this
patch does.
2008-10-05 13:49:07 +01:00
Nick Gasson 4394aff909 Merge branch 'master' of git://icarus.com/~steve-icarus/verilog into vhdl
Conflicts:

	tgt-vhdl/stmt.cc
2008-10-05 12:44:30 +01:00
Stephen Williams 5cfe47da2b Don't try to shrink a valid r-vlaue width.
In assignments, the expression width may be defined by the width of
operands, and not that of the l-value. Choose whichever is creater and
set (or pad) the expression to that width.
2008-10-04 21:44:10 -07:00