Commit Graph

121 Commits

Author SHA1 Message Date
Larry Doolittle 3e2196651a Remove unused parameter to indices_to_expressions
need_addr has been hanging around, unused, since commit 078a3fd4 on Jan 17, 2014.
2015-07-31 09:48:33 -07:00
Larry Doolittle 2739f83702 Spelling fixes in C and C++ comments 2015-06-04 15:00:29 -07:00
Stephen Williams 77d1671d8f Merge branch 'master' into vec4-stack 2014-12-05 10:44:49 -08:00
Stephen Williams 561564065d deal with mixed nested index directions. 2014-12-05 10:43:39 -08:00
Stephen Williams d5123011b3 Merge branch 'master' into vec4-stack
Conflicts:
	elab_scope.cc
2014-11-01 14:57:05 -07:00
Martin Whitaker 871d447ff7 Reinstate error recovery for range expressions.
If an error is found whilst elaborating a range expression in a signal
declaration, create a dummy range and continue elaboration. This stops
the compiler reporting an error every time that signal is referenced.
2014-10-31 21:42:23 +00:00
Stephen Williams a98f21aa65 Merge branch 'master' into vec4-stack
Conflicts:
	elab_lval.cc
	netmisc.cc
	tgt-vvp/eval_object.c
	tgt-vvp/vvp_process.c
	vvp/codes.h
	vvp/compile.cc
	vvp/opcodes.txt
	vvp/vpi_tasks.cc
	vvp/vpi_vthr_vector.cc
	vvp/vthread.cc
2014-10-21 09:12:02 -07:00
Stephen Williams ea4b000be6 Get arrayed property expressions down to the ivl_target API. 2014-09-15 17:37:30 -07:00
Stephen Williams 88e951418b Handle elaboration of class properties referenced within sub-scopes. 2014-09-06 16:26:08 -07:00
Stephen Williams 3b0dfaadba Some support for unpacked arrays in class properties. 2014-09-02 09:23:54 -07:00
Stephen Williams 0cd6fbaf41 foreach loops around static arrays
Arrays with static dimensions can be handled specially.
This also allows for arbitrary numbers of dimensions.
2014-08-30 10:18:57 -07:00
Martin Whitaker e5f49baaac Fix for GitHub issue #37 - bug in expression width pruning.
If an expression contains a division, remainder, or right shift operation,
set the expression min_width to UINT_MAX to flag that the expression width
cannot be pruned. Using UINT_MAX ensures that the min_width won't change
as we continue to elaborate the expression.
2014-08-25 20:27:22 +01:00
Martin Whitaker 89f1344288 Fix for GitHub issue #33 - Problem with multi-dimensional arrays.
normalize_variable_unpacked() was not correctly calculating the
minimum expression width required to calculate the canonical
index.
2014-08-11 20:23:29 +01:00
Stephen Williams ef79f538d5 When making NetCondit objects, handle output part select.
When a mux (NetCondit) is only writing to a part of the output
vector (and using only a part of the inputs) then blend the mux
output with the previous statement output.
2014-05-25 18:33:26 -07:00
Stephen Williams 76883fa18c NetCondit synthesis accounts for smaller l-values
If both conditions of a NetCondit device assign to the same subset
of l-value bits, then generate a smaller NetMux device that only
switches the affected bits.
2014-05-24 20:08:48 -07:00
Stephen Williams 2e2317b7c7 Generalize the hname_t to handle n-dimensional scope arrays.
... Not that they actually exist yet. But this fixes some symbol
search issues and makes room for this support in the future.
2014-04-06 08:40:09 -07:00
Stephen Williams e2bad56a5c Fix overflow calculating packed offset in certain cases. 2014-04-06 08:40:09 -07:00
Stephen Williams fc1f9ac6a5 Handle unpacked arrays as module input ports. 2014-04-06 08:40:09 -07:00
Stephen Williams 7ceb18fb37 Merge branch 'master' into vec4-stack
Conflicts:
	netmisc.cc
	tgt-vvp/eval_expr.c
	vvp/vthread.cc
2014-03-01 09:02:14 -08:00
Stephen Williams d2ff77d56c More standard handling of unsized numbers as system task arguments. 2014-03-01 08:38:23 -08:00
Martin Whitaker 5dcd2e8957 Added width cap for unsized expressions.
Unsized expressions can expand to extremely large widths. Usually this
is actually a mistake in the source code, but it can lead to the compiler
temporarily using extremely large amounts of memory, or in the worst
case, crashing. This adds a cap on the width of unsized expressions (by
default 65536 bits, but overridable by the user), and causes a warning
message to be output when the cap is reached.
2014-02-27 19:20:20 +00:00
Stephen Williams fdc9e8590d Merge branch 'master' into vec4-stack 2014-01-30 15:59:51 -08:00
Larry Doolittle be17bfc0e9 Spelling fixes
Mostly comments.
One user-visible string ("Evalutated to ") changed in the debug_eval_tree case.
2014-01-30 15:34:20 -08:00
Stephen Williams f94a655121 Yet again, try to fix vec4 calculation of n-dimensional array index. 2014-01-18 16:04:25 -08:00
Stephen Williams 078a3fd409 Was a little too aggressive with the lossless elab_and_eval
The index expressions ARE self-sized context, we just need to
force the EXPAND flag to make this work.
2014-01-17 18:22:11 -08:00
Stephen Williams 1fc4093191 Fix possible overflow in calculation of canonical indices. 2014-01-15 14:26:53 -08:00
Martin Whitaker d1c9dd554b Fix for github issue #6.
When creating a constant zero for implementing a unary minus operation
using a binary subtraction operator, the constant needs to be to exactly
the expression width.
2014-01-05 20:53:58 +00:00
Martin Whitaker 4625e7e2b6 Improvements to strict-expr-width mode.
Enable error reporting when an unsized number is used in a concatenation
operand. Allow greater pruning of expressions containing unsized numbers.
2013-10-28 22:07:09 +00:00
Stephen Williams 18c338ad09 Handle array assignment patters through pform.
This gets us to elaboration. In the process also fix up ivl_type_t
type comparisons to do deep type comparison.
2013-10-19 15:34:14 -07:00
Stephen Williams 2355e1ed8e Clean up some NetNet variable type handling. 2013-10-19 15:34:14 -07:00
Stephen Williams 64b2345cf2 eval_as_long takes in const NetExpr arguments.
It is not the same as eval_tree, in particular it doesn't
rewrite the expression tree. So the NetExpr argument can
be constant.
2013-08-31 18:48:32 -07:00
Cary R a586bfd1ec When finding the canonical address use a signed expression if needed. 2013-06-26 21:27:49 -07: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 6da71fdf56 Fix type/width for case and case item expressions.
The compiler was treating case and case item expressions as
self-determined. They should be context-sensitive, just like
the operands of a comparison operation.
2013-04-07 12:30:25 +01:00
Martin Whitaker e437321ea7 Fix implicit casts in assignments (part 6).
IVL_VT_NO_TYPE is now used to signal an untyped LHS in a parameter
declaration. The parser function that handles specparam declarations
needs to do this too. Also, although it should never happen, make
sure we don't set the expression width in a NetECast object to a
negative number. Make constant evaluation of NetECast objects
observe the expression width.
2013-03-24 13:51:10 -07:00
Martin Whitaker 6da610fe1e Fix implicit casts in assignments (part 5).
This patch removes some code that has been made redundant by the
more general handling of implicit casts.
2013-03-24 13:51:02 -07:00
Martin Whitaker bc2a4c01c9 Fix implicit casts in assignments (part 2).
This patch adds support for implicit casts in module port connections
and in user task output assignments.
2013-03-24 10:17:17 -07:00
Martin Whitaker 22769afd20 Fix implicit casts in assignments (part 1).
This patch adds support for implicit casts to the elaborate_rval_expr()
function. This will handle the majority of cases where an implicit cast
can occur.
2013-03-24 10:14:07 -07:00
Cary R 8808cd9514 For a LPM constant pass the sign information and one other fix
For a LPM constant we need to pass the sign information so that the vlog95
code generator can create the correct constant. Also when using the
sub_net_from() routine the numeric constant should have the same sign as
the signal so that it can also be displayed correctly.
2013-02-15 11:59:25 -08:00
Cary R 28bc333cba vlog95: block generating a concat-Z LPM device in the compiler.
Since the vlog95 code generator needs the strength information we do
not want to hide it behind a concat-Z optimization. For now we abort
the optimization, but in the future we could add parts of this back
in (e.g. all the drivers have matching strength then replace with a
normal concat and a buf-Z if the strength are not both strong. The
original buf-Z should be removed to reduce the number of LPM devices).
2013-02-13 19:19:21 -08:00
Stephen Williams 751587e112 PV-to-concat belnding should use a strength-aware concat. 2013-02-02 10:44:16 -08:00
Stephen Williams 367d7bf94b Blend NetPartSelect(PV) objects into NetConcat
If a signal s driven by multiple non-overlapping NetPartSelect(PV)
objects, then combine them into a single NetConcat object. This
eliminates the need for resolvers in the target.
2012-12-19 19:01:22 -08:00
Cary R 15fb58f8e4 Remove some cppcheck warnings, etc. 2012-11-12 18:15:25 -08:00
Martin Whitaker 78128dd95d Fix for pr3582052.
The code that calculated the canonical index for a multi-dimensional
array access did not correctly estimate the index expression width
in the case that the first index value was a constant zero. This
patch fixes the problem, and, in passing, also makes the expression
calculation more efficient if any of the indices are constant zeroes.
2012-11-03 10:30:17 -07:00
Stephen Williams d6efece5dd Handle DARRAYs of real variables
This involves working out the code to get the base type of a select
expression of a darray. Also added the runtime support for darrays
with real value elements.
2012-10-14 17:16:47 -07:00
Stephen Williams 914ebeca4a Some rework to allow for nested packed types.
This also simplifies the NetNet set of contructors and generalizes
the types that are supported, especially packed types.
2012-10-14 17:16:47 -07:00
Stephen Williams 92313654ec Rework the way vectors are represented in NetNet objects. 2012-10-14 17:16:47 -07:00
Stephen Williams 174177d437 Rework symbol search to work incrementally.
This is necessary to handle paths that turn out to end with
member names instead of symbol names.
2012-09-03 16:00:10 -07:00
Stephen Williams 0bdabab4fb Rework packed dimensions handling
Make packed structs more obviously parts of a vector.
Handle arrays of structs in certain cases.
2012-09-03 16:00:10 -07:00
Stephen Williams b4cc9d14a5 Handle packed arrays of packed struct in l-value expressions. 2012-09-03 16:00:09 -07:00