Commit Graph

207 Commits

Author SHA1 Message Date
Lars-Peter Clausen c286d1c418 vvp: Remove unused function prototypes
Remove prototypes of functions that have already been removed.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2022-06-20 22:52:56 +02:00
Lars-Peter Clausen ca919b3ce0 vvp: Add `%disable/flow` instruction
The `%disable` instruction will stop the execution of all active
threads of a specific scope. This is what is required to implement
the semantics of the Verilog `disable` statement.

But it is not suited to implement the SystemVerilog flow control
statements such as `return`, `continue` and `break`. These only
affect the thread hierarchy from which it is called, but not other
concurrently running threads from the same scope.

Add a new `%disable/flow` instruction that will only disable the thread
closest to the current thread in the thread hierarchy. This can either be
the thread itself or one of its parents. This will leave other concurrent
threads of the same scope untouched and also allows function recursion
since only the closest parent thread is disabled.

Note that it is not possible to implement this using `%jmp` instructions
since a block in a function with variable declarations will be its own
sub-thread, but using flow control instructions it is possible to exit from
that thread to the parent scope, which is not possible with `%jmp`
instructions.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2022-04-11 19:22:22 +02:00
Cary R 60a77b08d2 Add compiler and the start of vvp support for ->> 2021-02-19 23:21:51 -08:00
Stephen Williams 3c2fb6a601 Fix dynamic array assignment to make a copy of the rvalue.
IEEE Std 1800-2017 Section 7.6 Array assignments

Assignment of a dynamic array creates a duplicate of the source,
so that assignments to the copy don't impact the original. Handle
all sorts of dynamic array base types.
2020-11-26 12:52:06 -08:00
Cary R bff115b9f7 Add initial support for assigning between queues and darrays 2020-08-07 00:23:43 -07:00
Cary R 199ed39abe Report when the array pattern is larger than the maximum queue size 2020-08-02 23:40:35 -07:00
Cary R a2ba8a16b1 Add support for inserting into a queue 2020-07-29 23:00:19 -07:00
Cary R 14ade1a9f4 Pass the max size when storing to a queue 2020-07-27 21:24:22 -07:00
Cary R 1a4345cce9 Add the ability to delete an element of a queue 2020-07-25 00:49:42 -07:00
Cary R 1b7cd5c237 Add initial support for real queues 2020-07-19 21:34:56 -07:00
Martin Whitaker 1aa22735ce Add new %cast/vec2/dar and %cast/vec4/dar instructions to vvp. 2019-09-11 21:56:27 +01:00
Martin Whitaker 74ff44314e Add new %cast/vec4/str instruction to vvp. 2019-09-11 21:56:09 +01:00
Cary R 3fc9ad2db0 Add support for the wild compare operators ==? and !=? 2017-11-17 19:32:50 -08: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
Stephen Williams 9a7f31c728 Functions that return strings pass the return value on the stack. 2016-03-01 15:38:28 -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 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
Stephen Williams fe7156289b Remove some useless vvp opcodes. 2015-09-30 15:41:22 -07: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 58fb80aec4 Implement and put to use the %muli instruction. 2014-12-02 12:46:17 -08: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 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 2acc9fbdee Remove dead instructsion %set/qb and %set/qf / Kill some warnings. 2014-11-19 09:15:01 -08:00
Stephen Williams 725ed869ba Remove dead %load/vp0 instructions and related infrastructure
Also remove some &A<> and &PV<> symbols that use this now dead
infrastructure.
2014-11-19 09:02:21 -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 48d3972299 Remove a bunch of dead vvp opcodes. 2014-10-24 15:13:28 -07:00
Stephen Williams 97bde47c31 Remove dead %set/dar and %set/dar/obj instructions. 2014-10-24 10:03:22 -07:00
Stephen Williams 4588f7c615 vec4 stack versions of queue pop methods. 2014-10-24 09:03:20 -07:00
Stephen Williams 35f5d51028 Support testing nul for property that is an object. 2014-10-22 12:58:50 -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 facc982af4 Ability to compare arbitrary class-valued expression to nil. 2014-09-07 16:22:49 -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 d891285326 vvp code generation for push_back/push_front for queue objects. 2014-08-21 16:44:45 -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 88e4938074 Merge branch 'master' into vec4-stack 2014-03-04 19:08:56 -08:00
Martin Whitaker 3e41a93f3e Fix for br948 : user-func call may return incorrect value in a CA context.
%exec_ufunc assumed that because a function can never block, a call to
vthread_run() on the function code would only return when the final %end
instruction had been executed. This is not true if the function contains
a named block, which will be executed via a %fork instruction, allowing
the main function thread to suspend after a %join instruction. The fix
is to break %exec_ufunc into two instructions, the first setting the
function inputs and executing the function code, the second collecting
the function result. This provides the opportunity for the parent thread
to suspend after the %exec_ufunc instruction until all its children have
completed.
2014-03-01 23:38:23 +00: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 1805598eae Fix some vec4 handling of putc, len, and other string methods. 2014-01-31 19:01:28 -08:00
Stephen Williams 9cfb15a302 Implement assign/vec4/off/e 2014-01-23 18:39:29 -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 660d59a7a9 vec4 versions of the %force instructions. 2014-01-13 18:57:03 -08:00
Stephen Williams 063c6d6065 Add the %event instruction, remove %ix/get and %ix/get/s. 2014-01-05 12:39:52 -08:00
Stephen Williams 2fc8ce8a16 Implement vec4 basec %assign delay and event / vpiTimeVal for functions. 2014-01-05 12:04:16 -08:00