Commit Graph

1010 Commits

Author SHA1 Message Date
Stephen Williams b25df08c99 Fix possible buffer overflow. 2019-11-21 18:48:57 -08:00
Nick Brereton 414fafda2b Check that value is handled for case priority and unique qualifiers. 2019-10-05 21:42:17 -04:00
Stephen Williams 763cc9c162 Merge branch 'master' of github.com:steveicarus/iverilog 2019-10-05 16:23:16 -07:00
Stephen Williams befc91340c Parse and elaborate unique and priority case statements
The unique, unique0, and priority keywords can decorate case statements
to tell the run time (or synthesis) to do extra tests (or make extra
assumptions). These tests are not implemented in the vvp run time, but
now the decorations make it to the code generators.
2019-10-05 16:23:04 -07:00
Cary R b1699a2781 Fix two compiler warnings 2019-10-05 15:29:08 -07:00
Martin Whitaker 70da8db6b5 Fix assignment to scalar class property in tgt-vvp. 2019-10-05 20:12:52 +01:00
Cary R ea4e41207c Update cppcheck standards that are checked 2019-09-30 22:14:15 -07:00
Cary R ba82ef463e Fix some always_* issues 2019-09-29 16:59:59 -07:00
Martin Whitaker d6391490e3 Resize vector before assigning to a dynamic array word.
Failing to do this leads to an assertion failure in vvp.
2019-09-16 20:39:19 +01:00
Martin Whitaker c066e2d15c Properly implement casts from strings and dynamic arrays to vectors.
As discussed on iverilog-devel (2018-03-09), the existing implementation
(using Icarus-specific vpi functions) only worked with assignments to
simple variables, and could not be easily modified to work more generally.
So use the new vvp instructions added in the previous two commits.
2019-09-11 22:08:46 +01:00
Martin Whitaker ffb34861cf Fix GitHub issue #244: handle mixed signed/unsigned power operations.
The signed version of the power operation in vvp should only be used
if the exponent is signed. Both signed and unsigned versions will
produce the correct result regardless of the type of the base operand,
provided it has been appropriately extended to the result size.
2019-05-11 21:33:29 +01:00
Martin Whitaker 5cd0ba08b1 Fix alloc size warning when building with recent GCC. 2018-10-06 23:25:13 +01:00
Martin Whitaker 5cfb7d68ae Add support for rtran switches in vvp. 2018-02-23 22:30:32 +00:00
Stephen Williams 0caa109174
Merge pull request #181 from phire/portinfo_grammar
vvp grammar: .port_info statements should require/generate semicolons.
2017-12-18 10:04:42 -08:00
Scott Mansell 7b84b29bbc tgt-vvp: Output semicolon after .port_info statements
Backwards compatablity is perserved due to the parser interperting the
unexpected semicolon as an empty statement.
2017-12-16 23:59:48 +13:00
Cary R db1ea05452 Fix #0 to trigger in the inactive region and add a trigger for always_comb/latch 2017-12-03 20:17:42 -08:00
Cary R 585a0232cb Add preliminary support for always_comb, always_ff and always_latch 2017-11-20 07:50:05 -08:00
Cary R 3fc9ad2db0 Add support for the wild compare operators ==? and !=? 2017-11-17 19:32:50 -08:00
Martin Whitaker 5ca058bfb5 Add support for darray initialisation from another darray.
Fixes GitHub issue #164.
2017-10-08 17:51:33 +01:00
Martin Whitaker 1aeaafa96c Add support for vec4 darray initialisation from an array pattern.
This was just a missing case label in tgt-vvp.
2017-10-08 17:41:58 +01:00
Maciej Suminski f32b64f497 Fixed warnings about shifting a negative value 2016-09-19 12:54:15 -07:00
Stephen Williams d44c814bab Remove .alias records from vvp generated code.
Net arrays can be handled by nets directly, instead of creating
.alias records.
2016-08-31 14:05:09 -07:00
Michele Castellana 9ad46044b4 Cleanup 2016-06-30 17:47:34 +02:00
Martin Whitaker 61c82d2cb0 Handle mixed continuous and non-blocking assignments to same vector.
SystemVerilog allows a mixture of procedural and continuous assignments
to be applied to different parts of the same vector. The previous attempt
to make this work for non-blocking assignments was flawed (see preceding
fix for vvp_fun_part_pv::recv_vec4_pv). Instead, handle this case by
converting the non-blocking assignment into a delayed force statement,
which matches the way mixed continuous and blocking assignments are
handled.
2016-05-10 22:16:40 +01:00
Martin Whitaker 20104c92c8 Fix for GitHub issue #96 - support mixed constant/variable delays in vvp.
If all three rise/fall/decay delay values are constant, we can use
the vvp .delay statement variant that takes three literal numbers.
If not, we have to use the variant that takes three net inputs. If
some of the delay values are constant, we need to create constant
drivers for those delay inputs.
2016-04-02 19:55:56 +01:00
Martin Whitaker 54feb89bf5 For SystemVerilog, run variable initialization before main simulation starts. 2016-03-19 13:46:09 +00:00
Martin Whitaker dbaf2471f2 Fix for br1001 - connect undriven wand/wor to 'bz in tgt-vvp. 2016-03-13 16:38:55 +00:00
Johann Klammer d7736d7eba latch for vvp output 2016-03-11 23:44:06 +00:00
Stephen Williams 9a7f31c728 Functions that return strings pass the return value on the stack. 2016-03-01 15:38:28 -08:00
Cary R 7d21891147 Fix space issues. 2016-02-28 22:09:39 -08:00
Martin Whitaker a0bee0a76f Add support for real valued compressed assignment statements in tgt-vvp. 2016-02-23 22:02:03 +00:00
Martin Whitaker a85c64d347 Revert "Add support for real valued compressed assignment statements in tgt-vvp."
This reverts commit 3fede95f5e.
2016-02-23 21:49:49 +00:00
Martin Whitaker 3fede95f5e Add support for real valued compressed assignment statements in tgt-vvp. 2016-02-23 20:58:30 +00:00
Martin Whitaker b77d758f19 Fix compressed assignments to concatenations.
When loading a lval concatenation, tgt-vvp was loading the elements
in the wrong order for the %concat instruction.
2016-02-23 16:44:03 +00:00
Cary R 841593d013 Remove some compile warnings 2016-02-03 21:40:18 -08:00
Stephen Williams f494b478cc Merge branch 'master' into return-stack
# Conflicts:
#	sv_vpi_user.h
2016-02-01 14:47:44 -08:00
Stephen Williams 469d4fefa7 Handle compressed assign to function return value. 2016-02-01 12:38:48 -08:00
Stephen Williams ce692f90ad Implement and use the %retload/real opcode. 2016-02-01 09:31:06 -08:00
Stephen Williams c114edfa6c Handle void functions with new .scope format. 2016-02-01 09:29:49 -08:00
Stephen Williams fac7de2133 Better handle some different function types in the .scope setup. 2016-01-31 16:16:02 -08:00
Stephen Williams 604a62379c Make .scope aware of return type, and extend %ret/vec4 operands
The .scope needs to be aware of return types so that the %call/vec4
function knows how to intialize the return value. We also need to
extend the %ret/vec4 to support writing parts of the return value.
2016-01-31 15:29:52 -08:00
Stephen Williams e435a879fc Add ability to read back return value / Add vec4 stacked user functions.
Also:
- handle functions as arguments to system tasks.
- Cleanup detect of signal as return value.
2016-01-24 18:36:26 -08:00
Stephen Williams 0c91a6b041 Add .ufunc/real functor to handle functions with return value on stack. 2016-01-17 16:23:28 -08:00
Stephen Williams bfc9cd8715 Make real functions in processes use parent stack for return value. 2016-01-10 17:09:33 -08:00
Stephen Williams 37a63e5d6d Merge pull request #88 from orsonmmz/image_attr
'image attribute
2016-01-10 15:49:26 -08:00
Martin Whitaker eb2a9be0c9 Fix for br999 - incorrect result from binary comparison.
When a binary (in)equality comparison has a constant left operand,
the tgt-vvp code generator swaps the left and right operands to
allow the cmpi instruction to be used. The code for swapping the
operands was incorrect.
2016-01-07 19:11:42 +00:00
Maciej Suminski df6b24fd3a ivl & vvp: Enabled 'string' as the return type in VPI functions. 2016-01-05 14:23:25 +01:00
Stephen Williams 63ad15ee2e Rework user function calls to use specialized opcodes.
Create The %callf/* opcodes to invoke user defined functions in a
more specialized way. This allows for some sanity checking on the
way, and also is a step towards keeping return values on stacks.
2015-12-27 20:29:10 -08:00
Cary R 6c91588d33 Fix some errors found with cppcheck 2015-11-02 00:14:29 -08:00
Cary R a65c007fdb Fix some cppcheck warnings 2015-10-02 09:43:54 -07:00