Commit Graph

7283 Commits

Author SHA1 Message Date
Stephen Williams fbc5557a10 Handle properties that have arbitrary bit widths.
This fixes the run time handling of arbitrary width
bit vectors as class properties. The vvp code generator
already did the right things.
2013-07-02 20:16:47 -07:00
Stephen Williams 75b4b94061 Elaborate implicit initializers
Remaining pform fixup of property initializers, and
elaboration and code generation for implicit constructor.
2013-07-02 20:16:46 -07:00
Stephen Williams d346fb098f Collect initializer statements in the pform. 2013-07-02 20:16:46 -07:00
Cary R 633360a0f9 vlog95: More procedural $signed/$unsigned support/cleanup 2013-06-28 14:16:10 -07:00
Cary R 0e8a257ec2 vlog95: Fix the passing of the sign extend information in a CA 2013-06-27 19:44:17 -07:00
Cary R 7fa4cf5a34 vlog95: Fix a RS vs ARS in the CA code 2013-06-27 18:22:21 -07:00
Cary R eecc3312b7 vlog95: Add $signed/$unsigned support for signals
The actual signal code is trivial, but the emit expression code needed
to be enhanced to pass a flag that says if one of the arguments in a
binary (except the shifts) or ternary (excluding the condition) context
is unsigned. This information is used to prevent emitting an explicit
$unsigned() for a signal that is used in this context since it will be
implicitly cast to unsigned.
2013-06-27 13:31:40 -07:00
Cary R 11e5641089 A real task/function port is also signed. 2013-06-27 13:03:11 -07:00
Cary R f631cb6314 Add some support for procedural $signed/$unsigned.
This patch adds support for finding and adding $signed() and $unsigned()
to procedural expressions for the binary, unary and concatenation
operators. Selects have partial support. The select implementation
uncovered limitations in the compiler that need to be fixed before they
will work 100%. Most of the limitations currently generate a message
about the issue.
2013-06-26 21:46:02 -07:00
Cary R a586bfd1ec When finding the canonical address use a signed expression if needed. 2013-06-26 21:27:49 -07:00
Cary R 4dbd0442aa Add missing file/line information to a few expressions. 2013-06-26 21:25:27 -07:00
Cary R fa9a439bf1 Update fstap files to the latest from GTKWave 2013-06-14 16:35:22 -07:00
Cary R 11e394aacf Remove space error 2013-06-14 16:35:09 -07:00
Martin Whitaker 9af0811a1c Fix for br932 part 2 - make $fopen accept SV 'string' type.
The is_string_obj function in vpi/sys_priv.c needed to be updated to
recognise the vpiStringVar object type.
2013-06-14 21:00:39 +01:00
Martin Whitaker 503487e9ea Fix for br932 - support string types in task input ports. 2013-06-13 23:18:23 +01:00
Stephen Williams ca9616dc7b Better simple_expression parse rules. 2013-06-12 14:21:36 -07:00
Stephen Williams 24bd630cb2 Parse (to sorry messages) unbounded array definitions. 2013-06-12 14:21:36 -07:00
Stephen Williams 8487cb5616 Do a better job of figuring the vtype of an expression. 2013-06-12 14:21:36 -07:00
Stephen Williams d630e4dfe9 Elaborate VHDL entity port types/expressions.
We need to elaborate expressions so that function calls in
expressions (i.e. ranges) get bound to their proper scope.
This binding is in turn used to emit package scopes. This
is particularly interesting for ports of entities.
2013-06-12 14:21:35 -07:00
Stephen Williams 3d5765949e Some shorthand type marks in write_to_stream. 2013-06-12 14:21:35 -07:00
Stephen Williams 0fcd2d9db6 Handle rising_edge and falling_edge functions. 2013-06-12 14:21:35 -07:00
Stephen Williams 3446455055 Support compile-time evaluation of named blocks. 2013-06-12 14:21:35 -07:00
Stephen Williams af304fea65 Fix repeated use of disabled const functions.
If constant functions are exited by a return/disable, fix
the leaked "disable" flag that causes blocks in the next
try at the function to not work.

There are also a lot of debug messages added to help find
this and similar problems.
2013-06-12 14:09:08 -07:00
Stephen Williams bcaa6accec Fix evaluation wrong expression for const >= expressions. 2013-06-12 14:09:08 -07:00
Stephen Williams 5c00b96127 Handle constant functions from other scopes, i.e. packages. 2013-06-12 14:09:08 -07:00
Stephen Williams bfe3998eaa Lexor detects that excaped identifiers may be package names. 2013-06-12 14:09:08 -07:00
Stephen Williams 096e53dea4 Don't crash if function is not found. 2013-06-12 14:09:08 -07:00
Stephen Williams bc77a19059 Use $ivl_unsigned to implement VHDL to_unsigned function.
The VHDL to_unsigned function with to arguments is best handled
in the ivl elaborator, so have it generate an $ivlh_to_unsigned
function call in the vhdlpp code, and implement it in the ivl
core.

Also, implement the 'length attribute as a $bits() call for
similar reasons.
2013-06-12 14:09:08 -07:00
Stephen Williams 1b178d56b7 Add support for SystemVerilog return statements. 2013-06-12 14:09:07 -07:00
Stephen Williams dca6171f5f SV emit function ports in package subprograms. 2013-06-12 14:09:07 -07:00
Stephen Williams 164b5f9348 Fix SV emit of ForLoopStatement and ReturnStmt. 2013-06-12 14:09:07 -07:00
Stephen Williams e927960121 Implement subprogram bodies in package bodies. 2013-06-12 14:09:07 -07:00
Stephen Williams 6394a4d78d Rework scope types and constants so we can tell imported from local names.
The package emit of types and constants needs to know which names are
from the current type and which are imported from libraries. Rework
the scope handling of those names so that the information is preserved.
2013-06-12 14:09:07 -07:00
Stephen Williams 13be45bd73 Fix dump of primitive CHARACTER types. 2013-06-12 14:09:07 -07:00
Stephen Williams 7f7decde03 Basic structure for emitting packages. 2013-06-12 14:09:07 -07:00
Stephen Williams d9fea802da Function declarations in packages
This is still basic. Definitions are still not done.
2013-06-12 14:09:07 -07:00
Martin Whitaker 34f6e25b4e Revised fix for bug 931.
We can't directly determine that a %fork operation is a task or function
call, so need to infer this by comparing the parent and child scopes.
2013-05-27 20:17:44 +01:00
Martin Whitaker afe1e79338 Update a few comments for changes to thread fork/join behaviour. 2013-05-27 10:12:30 +01:00
Martin Whitaker cbaf36d4b8 Fix for br931.
Task and function calls are handled in vvp using the fork/join
instructions. The join instruction after a call must reap the
task/function thread.
2013-05-27 09:34:44 +01:00
Martin Whitaker 6f8eede371 Handle out-of range and undefined LHS bit/part selects in assignments.
For constant bit/part selects, issue a warning if the select is out
of range or an undefined value. In any case, the RHS value should be
discarded, and the actual assignment should be skipped.
2013-05-21 21:44:31 +01:00
Martin Whitaker c693930595 Fix compiler crash when an attribute value is invalid. 2013-05-19 11:07:37 +01:00
Martin Whitaker 6364aba975 Fix for br930 - support attributes on old-style port declarations. 2013-05-19 09:16:24 +01:00
Martin Whitaker 10ec58703f Fix vvp memory leak for VPI call with no calltf.
If a VPI call with real arguments has no calltf function, we still
need to pop the arguments off the vthread stack. Similarly, if it
has a real result, we need to push a value onto the vthread stack.
2013-05-18 21:22:44 +01:00
Martin Whitaker 9a69fcff7b Handle out-of-bounds and undefined word indices in constant functions. 2013-05-18 19:39:24 +01:00
Martin Whitaker 26dc6d68cd Handle out-of range and undefined LHS word indices in assignments.
For constant word indices, issue a warning if the index is out of
range or an undefined value. In any case, the RHS value should be
discarded, and the actual assignment should be skipped.
2013-05-18 19:21:37 +01:00
Martin Whitaker 0aca19356c Added thread stack memory leak check to vvp.
When a vvp thread terminates, its real and string stacks should be empty.
Adding assertions to this effect catches some code generator bugs.
2013-05-18 19:02:36 +01:00
Cary R 5e94554d72 Don't run final blocks if there was a compiletf, etc error. 2013-05-14 17:45:27 -07:00
Cary R 7d26515bc4 A $finish in a final block should end processing of all final blocks 2013-05-14 16:55:51 -07:00
Cary R 71c6193ff1 Finish adding support for end labels in SystemVerilog 2013-05-14 15:01:54 -07:00
Cary R b0b6be0d23 Class properties are optional 2013-05-14 14:59:31 -07:00