Commit Graph

39 Commits

Author SHA1 Message Date
Stephen Williams f5564a195f vec4 versions of compressed assignment statements. 2014-02-06 09:55:25 -08:00
Stephen Williams 1805598eae Fix some vec4 handling of putc, len, and other string methods. 2014-01-31 19:01:28 -08:00
Stephen Williams d8533104b0 Cleanup vec4 handling of suppressed store/assign due to bad offset/index math. 2014-01-14 12:00:39 -08:00
Stephen Williams 6a93b6a7e4 Fix some subtle code generator bugs with wide literals and large r-values. 2014-01-07 18:46:35 -08:00
Stephen Williams 1a3adbe9cd Vec4 store to memories.
This also reworks the working of the %store/vec4 instruction to
take a part offset, and eliminate the %store/vec4/off instruction.
2014-01-05 10:30:59 -08:00
Stephen Williams e708a5b59d Handle vec4 part selects / vec4 cassign / repeat statements
These features need to be adapted to the vec4 stack.
2014-01-04 22:11:07 +00:00
Stephen Williams 5ef077fdf6 Start work on converting vec4 expressions to use stack.
Instead of using a bit4 space to hold thread vectors, create a
vec4 stack--much like the real, string, and object stacks--to
hold intermediate values.
2013-12-27 17:04:42 +02:00
Stephen Williams fa8d35ae9c Support nested l-value objects
This allows for syntax like a.b.c where a is a class with member
b, which is a class with member c, and so on. The handling is mostly
for the support of compound objects like classes.
2013-11-22 19:54:42 -08:00
Stephen Williams 37ac1ed474 Clean up dead code in ivl_lval_t handling. 2013-11-22 12:02:03 -08:00
Stephen Williams e60804cf41 Handle initialized darray of strings
This includes adding support for returning strings from functions,
adding initializing new darray with array_pattern strings, and
assigning an array_pattern of strings to a preallocated darray.
Also fix up support for initializing array with simple string
expression.
2013-10-19 15:34:15 -07:00
Stephen Williams 82ebf6372c Generate code to implement new element initializers. 2013-10-19 15:34:15 -07:00
Stephen Williams 96813f76c1 Generate code to implement array_pattern assignment to darray
This implements the feature in the VVP code generator.
2013-10-19 15:34:14 -07:00
Jared Casper 51ca2d1243 Fix using array elements in expressions with an array element lval.
When you have an expression like this (extreme example):

a[idx[1]][idx[2]*4 +: 4] <= #(idx[3]) 4'ha;

where a is a reg array and idx is a reg or net array.  The retrieval
of idx[2] was clobbering index register 3, which was set before
evaluating the part offset expression, then used in the %set/av of the
array value.  (likewise for idx[1] and idx[3]])

To avoid this issue, this patch adds and uses a new instruction
%ix/mov which simply copies one indexed register to another.  When
necessary, expressions are first evaluated into temporary registers to
avoid clobbering, then moved in to place before the %*/av instruction.
2013-10-07 16:47:50 -07:00
Cary R 07cc18284c Fix print token/argument mismatches and other cppcheck fixes 2013-09-09 13:34:38 -07:00
Stephen Williams 637d43fb5a Add support for logic vector properties in classes.
This is similar to but not the same as bit(bool)
vector properties in classes.
2013-07-02 20:16:47 -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
Cary R d2928d500d Remove a few more compile error messages from RHEL5 2013-04-17 17:46:05 -07:00
Cary R fbafb915d2 Fix some cppcheck warnings 2013-04-15 11:54:15 -07:00
Stephen Williams d8592b1444 Allow for class objects an class properties. 2013-01-27 20:10:25 -08:00
Stephen Williams 4568766cff Add support for darrays as class properties. 2013-01-27 20:10:25 -08:00
Stephen Williams c49b21115a Handle strings as class object properties.
While we are at it, fix a handling of null strings in
string expressions.
2013-01-27 20:10:25 -08:00
Stephen Williams 106850ca7d Handle real value class properties.
As a side effect, this also adds support for 64bit integers.
2013-01-27 20:10:25 -08:00
Stephen Williams 074055bc58 Implement static arrays of strings.
This means extending the vvp to add .array/str objects and
include instructions to access the array. Also add the parser
and code generator support.
2013-01-05 15:57:58 -08:00
Stephen Williams 860419a346 Draft run-time support for SystemVerilog class objects.
This provides the ivl_target.h interface for class definitions
and expressions, the vvp code generator support for class objects
and properties, and the vvp run time support. Trivial class objects
now seem to work.
2012-12-10 19:20:02 -08:00
Stephen Williams b6eb86d696 Blend new_darray and new_class expression nodes. 2012-12-10 19:13:43 -08:00
Stephen Williams 559d965681 Merge branch 'x-mil4'
Conflicts:
	tgt-vvp/eval_real.c
	vvp/codes.h
	vvp/compile.cc
	vvp/opcodes.txt
2012-10-23 14:48:25 -07:00
Stephen Williams a5fd5363b3 Rewire real value expressions to use a stack instead of register space.
This will hopefully improve performance slightly, but also this
intended as a model for what to do when I get around to doing the
same thing to other data types.
2012-10-22 17:20:43 -07:00
Stephen Williams 0059fb1ec7 Support for dynamic arrays of strings.
Strings, when put into dynamic arrays, are treated as first class
types much line reals. Add the code generator and vvp support for
this situation. Also fix a bug distinguishing between character
selects from strings and select form arrays of strings.
2012-10-14 17:16:47 -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
Arun Persaud f5aafc32f9 updated FSF-address 2012-08-29 10:12:10 -07:00
Stephen Williams 94e217f02b vvp support for dynamic arrays.
This words completely for single-dimension dynamic arrays of
32bit integers. These changes also act as a stub for other
target types.
2012-07-22 10:52:07 -07:00
Stephen Williams d0e6b24ca2 Support the new[] operator for arrays
Implement through the ivl core to the ivl_target.h API.
Also draft implementation of creating and storing arrays
in the vvp runtime and code generator.
2012-07-22 10:52:06 -07:00
Stephen Williams a337a9388b Handle string[x] in l-values and system function arguments
When string[x] is an l-value, generate code to implement something
like the string.putc(x, ...) method.

Also handle when string[x] is the argument of a system task. In that
case resort to treating it as a calculated 8-bit vector, because that
is what it is.
2012-07-22 10:52:06 -07:00
Stephen Williams dc39714d65 Support string literal strings in the vvp runtime.
This also advances support for string expressions in general.
Handle assignments to string variables in the code generator by
trying to calculate a string expression. This involves the new
string object thread details.
2012-07-22 10:52:06 -07:00
Stephen Williams d48362b861 First pass at getting strings to work.
In vvp, create the .var/str variable for representing strings, and
handle strings in the $display system task.

Add to vvp threads the concept of a stack of strings. This is going to
be how complex objects are to me handled in the future: forth-like
operation stacks. Also add the first two instructions to minimally get
strings to work.

In the parser, handle the variable declaration and make it available
to the ivl_target.h code generator. The vvp code generator can use this
information to generate the code for new vvp support.
2012-07-22 10:52:06 -07:00
Stephen Williams 9ba6ab49ac Fix compressed assign to memory word.
This is a pretty trivial fix for the code generation of compressed
assign to a memory word. We generated incorect code for the stash
of the calculated word index, causing the assign of the result to
not work properly.
2011-12-18 17:56:41 -08:00
Cary R 0553250997 Use the correct space in the a.out file.
We use four spaces before most opcodes in the a.out file.
2011-12-18 16:45:42 -08:00
Stephen Williams eeca366092 Handle part selects in l-values of compressed assignments. 2011-11-28 16:41:50 -08:00
Stephen Williams 7a812fbe39 Rework vvp code generator for compressed assignments
Now we have a code generator that can handle compressed assignments
as they have been re-imagined in elaboration. There are some cases
that are not yet supported, we'll patch them up in due course.
2011-11-28 15:29:53 -08:00