Cary R
84c592b068
Fix white space issue
2015-02-02 15:29:25 -08:00
Cary R
bb93a585b6
Generate correct vvp code for zero replication cases
2015-02-02 15:27:57 -08:00
Cary R
b3425d6cf3
Report that 4-state dynamic arrays are not currently supported in vvp
...
Also fix some error code propagation issues.
2015-01-16 18:22:16 -08:00
Cary R
40ae1051d4
Report the vvp only supports a dynamic array of size 8, 16, 32 or 64
2015-01-15 18:18:14 -08:00
Cary R
1ffcd40336
Fix a clear word to be after it has been used
2015-01-14 19:48:24 -08:00
Maciej Suminski
eeaf23041b
vvp: Support for dynamic arrays of logic type.
2015-01-12 11:08:31 +01:00
Martin Whitaker
71c4ea36e8
Pass -v compiler option to vvp in the output file shebang line.
...
Slightly modified version of the patch contributed by Stephan
Böttcheron iverilog-devel.
2014-12-16 21:22:19 +00:00
Martin Whitaker
5df179cd5f
Implement feature request #47 .
...
This causes vvp to evaluate all the input expressions for a user
function call before assigning any of them to the function input
variables. This stops the input variables being overwritten if
the same (non-automatic) function is used in one of the input
expressions.
2014-12-14 21:46:28 +00:00
Cary R
b2d8d41e3f
Fix some cppcheck warnings in tgt-vvp
2014-12-10 16:30:55 -08:00
Cary R
1efa220773
Fix non-blocking assignment to an array error state handling
...
If either the index or part offset expressions generate an undefined
value then the assignment is skipped. This patch reworks the code that
handles the flags used to detect this. For some simple cases a global
flag is not needed, but for other cases one is needed since there are
two expressions that can generate an error and even when there is only
a variable expression this error state needs to be preserved if there
is a variable delay. An undefined delay value defaults to zero and is
not an error.
2014-12-09 17:29:18 -08:00
Stephen Williams
105521b547
Merge branch 'master' into vec4-stack
2014-12-06 08:24:46 -08:00
Cary R
77ebfcacb9
Correctly pass if a darray element is signed or unsigned.
2014-12-05 18:23:02 -08:00
Stephen Williams
409f8c5823
Add the vec4 %subi instruction
2014-12-05 09:45:29 -08:00
Stephen Williams
85c7b07a9b
Implement %cmp/ne and %cmpi/ne
...
These pull in the inversion of the output flags so that they more
efficiently implement != and !==, without %flag_inv instructions.
2014-12-03 11:06:11 -08:00
Stephen Williams
3bd307db85
Expression cast handles size if need be.
2014-12-02 16:54:32 -08:00
Stephen Williams
f287546f49
Fix a %vpi_call call syntax.
2014-12-02 15:28:22 -08:00
Stephen Williams
1645e682f4
Generate more efficient vec4-stack code for real le compare.
2014-12-02 14:53:01 -08:00
Stephen Williams
58fb80aec4
Implement and put to use the %muli instruction.
2014-12-02 12:46:17 -08:00
Stephen Williams
38f277d81b
Merge branch 'master' into vec4-stack
...
Conflicts:
vvp/array.cc
vvp/vthread.cc
2014-12-02 11:21:58 -08:00
Maciej Suminski
b12e00d875
ivl: String to vector casting.
2014-11-27 17:36:23 +01:00
Stephen Williams
663c79d4af
Add the %cmp/e instructions, and put them to use.
...
When testing for == and ===, there is no need to also calculate <,
so it makes sense to have a special instruction for these cases.
2014-11-21 16:45:27 -08:00
Stephen Williams
b96f04ccce
Implement the %parti/X instructions
...
This allows part select with constant base to be handled optimally.
Also update some more instructions to more optimally work with
the vec4 stack.
2014-11-20 18:43:24 -08:00
Stephen Williams
a9db765f98
Generate better code for condition expressions.
2014-11-20 14:47:44 -08:00
Stephen Williams
c71ab5869a
vvp code generator try to generate condition flags directly.
...
When generating code for a condition expression, i.e. directly
before a %jmp/X statement, try to generate the result into the
flag bit without passing through the vec4 stack. For example, the
%cmpX/X instructions generate results into the flag bits, so it
makes no sense to push these bits into the vec4 stack then pop
them back into the flag bit. So try to handle this case.
2014-11-19 18:32:19 -08:00
Stephen Williams
04bdfbccee
Add %cmpi/s and %cmpi/u instructions for performance
...
These bypass the vec4 stack in some common cases, saving instructions
and vec4 manipulations.
Also, minor improvement to the %flag/set/vec4 statement.
Kill a few warnings.
2014-11-19 16:38:43 -08:00
Stephen Williams
301edf69d3
Add and use %concati/vec4 and %addi instructions.
...
Also, clean up some warnings, and optimize some existing opcodes.
2014-11-18 12:27:55 -08:00
Stephen Williams
c2ca9c3b73
Optimize draw_number_vec4 to use %pushi/vec4 zero-padding.
2014-11-14 18:37:10 -08:00
Martin Whitaker
f171161822
Fix for br962 - pop from dynamic array is not padded to correct width.
...
When the expression width is greater than the dynamic array width,
we need to generate code to pad the popped value to the correct
width.
2014-11-02 15:26:15 +00:00
Stephen Williams
48d3972299
Remove a bunch of dead vvp opcodes.
2014-10-24 15:13:28 -07:00
Stephen Williams
62fce50f8c
Remove dead code for allocate_vec handling.
2014-10-24 13:07:53 -07:00
Stephen Williams
e4b862f3d1
Clean up vector handling dead code.
2014-10-24 11:17:36 -07:00
Stephen Williams
09d3a5de59
Port %pushv/str to vec4-stack style.
2014-10-24 10:16:35 -07:00
Stephen Williams
97bde47c31
Remove dead %set/dar and %set/dar/obj instructions.
2014-10-24 10:03:22 -07:00
Stephen Williams
1c80c6e37a
Remove dead stuff_ok_flags from draw_eval_vec4 functions.
2014-10-24 09:32:32 -07:00
Stephen Williams
4588f7c615
vec4 stack versions of queue pop methods.
2014-10-24 09:03:20 -07:00
Stephen Williams
24b8752475
More cases where %store/prop/v takes a width.
2014-10-22 16:15:10 -07:00
Stephen Williams
3ddcf03764
Kill some eval_vec4.c warnings.
2014-10-22 13:01:25 -07:00
Stephen Williams
35f5d51028
Support testing nul for property that is an object.
2014-10-22 12:58:50 -07:00
Stephen Williams
69a1fecd2e
Handle arrays of object is comparison with null.
2014-10-21 11:47:22 -07:00
Stephen Williams
9964d67e5e
Implicit crop of vectors assigned to vector properties.
...
The %store/prop/v takes a width so that it is guaranteed that
all assignments to a vector property will get the size right.
2014-10-21 11:46:59 -07: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
98799ff7fa
Allow class properties to be arrayed.
...
This adds the runtime support for class properties that are classes
to be arrayed. Add a means to define the dimensions of a property
in the vvp format, and add functions for setting/extracting elements
of a property.
2014-09-15 17:37:30 -07:00
Stephen Williams
facc982af4
Ability to compare arbitrary class-valued expression to nil.
2014-09-07 16:22:49 -07:00
Stephen Williams
d1a35d5152
Handle nil queue as a was to delete a queue.
...
Treat this like assigning null to a dynamic array. This deletes the
queue and thus has the effect of clearing it.
2014-09-02 12:19:58 -07:00
Stephen Williams
dec4cd5071
Handle arrays of class objects.
...
This goes all the way down to the vvp level, where we create support
for arrays of objects, generate the new code in the -tvvp code
generator, and elaborate the arrays in the first place.
2014-08-30 10:18:57 -07:00
Stephen Williams
335db49282
Add vvp implementations for pop_back and pop_front methods.
2014-08-21 16:44:46 -07:00
Stephen Williams
c9ff48bd4e
Add support for dynamic array/queue "last" index ($)
...
Internally, treat the "$" as a special expression type that takes
as an argument the signal that is being indexed. In the vvp target,
use the $last system function to implement this.
2014-08-21 16:44:45 -07:00
Stephen Williams
9b4681918b
Array access to queue variables.
2014-08-21 16:44:45 -07:00
Stephen Williams
d891285326
vvp code generation for push_back/push_front for queue objects.
2014-08-21 16:44:45 -07:00
Stephen Williams
e8b8fcba57
Support declaring queue variables all the way to vvp.
...
Nothing actually useful happens here, but the declarations
are functional.
2014-08-21 16:44:45 -07:00
Cary R
0a6d75f1db
Fix some cppcheck warnings (format string vs argument mismatches)
2014-08-01 18:55:44 -07:00
Cary R
d6b6b76015
Update header files to use a more standard name to prevent rereading
...
This is from github report #16 . There are likely a few more issues
that need to be addressed though this takes care of the major ones.
2014-07-23 13:42:56 -07:00
Stephen Williams
d8f10e7aa2
Improbe vvp support for wide mux devices.
2014-07-14 16:46:58 -07:00
Stephen Williams
d5fb0f4344
Handle some tricky conditions assignments to parts.
...
When for example assigning to foo[<x>] within a contitional, and
doing synthesis, we need to create a NetSubstitute device to manage
the l-value bit selects.
2014-07-14 16:46:58 -07:00
Larry Doolittle
ae6743cf69
Easy changes for -Wmissing-prototypes
2014-07-10 14:07:30 -07:00
Cary R
774d173d69
Remove missing parameter warnings
2014-07-09 14:16:57 -07:00
Cary R
9d99a64bf0
Remove warnings and -Wno-type-limits option since it is not always supported.
2014-07-09 11:04:43 -07:00
Larry Doolittle
e221a8ced9
Rearrange compiler warning flags
...
Before this patch, WARNING_FLAGS applied to both C and C++,
and WARNING_FLAGS_CXX applied to C++ only.
This patch adds a WARNING_FLAGS_CC that applies to C only.
That change should be generally useful; in particular the C
code is almost ready for -Wstrict-prototypes, which does not
apply to C++.
-Wextra (or -W) used to only apply to C++ via WARNING_FLAGS_CXX.
This patch moves it to WARNING_FLAGS, to apply to both C and C++.
Unfortunately, that triggers a ton of warnings.
For now, cover most of the new warnings up by adding
-Wno-unused -Wno-sign-compare -Wno-type-limits
to WARNING_FLAGS_CC. In the long run, I want to change the C coding
style, and take off these disable-warning flags. But those changes
can dribble in as separate commits; this patch is big enough already.
Actually fix a couple missing-field-initializers in libveriuser/veriusertfs.c.
2014-07-09 09:04:17 -07:00
Larry Doolittle
6ebb57195b
Fuss with C function prototypes
...
119 formal void parameters added to keep -Wstrict-prototypes happy.
Process found one real missing prototype in vpi/vcd_priv.h:
EXTERN void vcd_names_delete(struct vcd_names_list_s*tab);
8 such warnings left, all in Tony's code
2014-07-08 13:44:11 -07:00
Cary R
0ffd61a835
Remove some cppcheck warnings
2014-06-28 16:56:09 -07:00
Stephen Williams
0f85bf0b9a
Basic DFF asynchronous set/reset synthesis support.
2014-06-15 18:22:02 -07:00
Stephen Williams
ccce9d9271
Merge branch 'master' into x-sizer5
2014-06-14 19:13:42 -07:00
Stephen Williams
f8dc430fe5
Add synthesis support for casez statements.
...
This generates an EQZ LPM device that carries the case-z-ness to
the code generator.
Also add to the vvp code generator support for the EQZ device so
that the synthesis results can be simulated.
Account for the wildcard devices in the sizer.
2014-06-13 18:01:41 -07:00
Martin Whitaker
529e029abd
Fix for GitHub issue #28 - Insufficient string escaping in vvp script.
...
" characters in strings must be escaped when the compiler writes a
quoted string to a vvp script. This patch fixes up a few places where
this wasn't being done.
2014-06-09 22:40:26 +01:00
Larry Doolittle
855bf9cfe8
Pick some low-hanging const fruit
...
Makes more of the code const-correct; there are still plenty of difficult-to-fix const problems left.
No behavior change expected.
2014-06-09 10:47:28 -07:00
Cary R
b687cc5f21
Remove cppcheck warnings in tgt-vvp
2014-04-17 16:26:51 -07:00
Stephen Williams
1afe7476e3
Handle nested l-values in vec4-stack code generator.
2014-03-01 16:49:15 -08: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
Martin Whitaker
c61d2151c1
Fix invalid optimisations in tgt-vvp.
...
The vvp code generator was optimising away adds and subtracts where one
operand was a constant zero. This is not valid for 4-state arithmetic.
It was also optimising away multiplies by a constant zero - but in this
case getting it wrong and effectively multiplying by 1.
2014-02-28 23:29:15 +00:00
Stephen Williams
91b7c6ab55
Merge branch 'master' into vec4-stack
...
Conflicts:
vvp/vthread.cc
2014-02-21 18:04:16 -08:00
Martin Whitaker
320f6d008c
Output sorry message for missing procedural assign/force functionality.
...
A procedural continuous assignment is supposed to be updated any time
a variable on the RHS changes. Currently this only happens if the RHS
is a simple signal.
2014-02-21 23:02:05 +00:00
Stephen Williams
801e795112
Better job of matching adder operand sizes for vec4 code generator.
2014-02-10 18:06:56 -08:00
Stephen Williams
e66fc7e5cc
Port UWIRE assignments to vec4 branch.
2014-02-10 17:19:52 -08:00
Stephen Williams
1d63875e5d
Merge branch 'master' into vec4-stack
...
Conflicts:
elab_lval.cc
2014-02-10 16:26:22 -08:00
Stephen Williams
554fb7ebdd
Various internal vec4 size mismatches fixed.
2014-02-07 17:50:13 -08:00
Stephen Williams
c9e8392dc7
Fix dangling vec4 stack when force assignment is suppressed.
...
Also improve the %debug/thr instruction.
2014-02-07 16:10:28 -08:00
Stephen Williams
60d37e1f53
More vec4 support for various things.
2014-02-07 11:24:41 -08:00
Stephen Williams
401fccdf6e
vec4 handling of DARRAY of vec4 vectors.
2014-02-06 15:05:26 -08:00
Stephen Williams
f5564a195f
vec4 versions of compressed assignment statements.
2014-02-06 09:55:25 -08:00
Stephen Williams
7f59c51ca2
Handle proceedural writes to UWIRE objects.
...
The elaborator allows this only if it determines that the bits
that are procedural written are not also continuously written.
2014-02-02 16:43:48 -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
e497f63e29
Implement string compares for vec4 support.
2014-01-28 17:11:21 -08:00
Stephen Williams
75233a9bca
vec4 implementation of auto-increment/decrement.
2014-01-28 16:24:26 -08:00
Stephen Williams
11197baf86
The vec4 %cvt/vr requires a <wid>
2014-01-28 15:51:29 -08:00
Stephen Williams
23ba0bc019
various vec4 fixes.
2014-01-25 19:25:21 -08:00
Stephen Williams
9cfb15a302
Implement assign/vec4/off/e
2014-01-23 18:39:29 -08:00
Stephen Williams
8bebe59e20
Fix vec4 abs() generating duplicat labels.
2014-01-22 17:15:26 -08:00
Stephen Williams
20d415463a
vec4 non-blocking assign to array swapped delay and part offset!
2014-01-21 20:58:48 -08:00
Stephen Williams
9c1dcad994
vec4 vvp support for non-blocking assign with delay and part offset.
2014-01-21 19:37:05 -08:00
Stephen Williams
54346d7095
vec4 implementations of real ternary and vec4 to real casts.
2014-01-21 12:02:59 -08:00
Stephen Williams
0121fbc88c
Remove useless assert.
2014-01-21 11:05:32 -08:00
Stephen Williams
ae1f8be277
Wrap up vpi access to vec4 stack items.
2014-01-14 17:10:03 -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
92a5e6a698
vec4 based calls to simple real system functions.
2014-01-13 17:46:39 -08:00
Stephen Williams
079065ea73
Remove some dead code in tgt-vvp.
2014-01-13 17:45:44 -08:00
Stephen Williams
1905264061
vec4 support for part select of memory word to VPI function.
2014-01-13 16:12:56 -08:00
Stephen Williams
b0a9430e98
Wrap up vecc4 support for left/right shift expressions.
2014-01-13 16:11:47 -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
4820d46353
Implement some vpi_get_value formats for vec4 stack values.
2014-01-06 20:27:14 -08:00
Stephen Williams
fcc0a6a203
vec4 string literal expressions
2014-01-06 08:35:23 -08:00