Add the assign/d instruction for computed delays.

This commit is contained in:
steve 2002-04-21 22:29:49 +00:00
parent 048d044fdc
commit 52ea13819a
4 changed files with 28 additions and 4 deletions

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT)
#ident "$Id: codes.h,v 1.39 2002/04/14 18:41:34 steve Exp $"
#ident "$Id: codes.h,v 1.40 2002/04/21 22:29:49 steve Exp $"
#endif
@ -39,6 +39,7 @@ extern bool of_ADD(vthread_t thr, vvp_code_t code);
extern bool of_AND(vthread_t thr, vvp_code_t code);
extern bool of_ANDR(vthread_t thr, vvp_code_t code);
extern bool of_ASSIGN(vthread_t thr, vvp_code_t code);
extern bool of_ASSIGN_D(vthread_t thr, vvp_code_t code);
extern bool of_ASSIGN_MEM(vthread_t thr, vvp_code_t code);
extern bool of_ASSIGN_X0(vthread_t thr, vvp_code_t code);
extern bool of_BREAKPOINT(vthread_t thr, vvp_code_t code);
@ -152,6 +153,9 @@ extern vvp_code_t codespace_index(vvp_cpoint_t ptr);
/*
* $Log: codes.h,v $
* Revision 1.40 2002/04/21 22:29:49 steve
* Add the assign/d instruction for computed delays.
*
* Revision 1.39 2002/04/14 18:41:34 steve
* Support signed integer division.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT)
#ident "$Id: compile.cc,v 1.124 2002/04/14 18:41:34 steve Exp $"
#ident "$Id: compile.cc,v 1.125 2002/04/21 22:29:49 steve Exp $"
#endif
# include "arith.h"
@ -83,6 +83,7 @@ const static struct opcode_table_s opcode_table[] = {
{ "%and", of_AND, 3, {OA_BIT1, OA_BIT2, OA_NUMBER} },
{ "%and/r", of_ANDR, 3, {OA_BIT1, OA_BIT2, OA_NUMBER} },
{ "%assign", of_ASSIGN, 3, {OA_FUNC_PTR, OA_BIT1, OA_BIT2} },
{ "%assign/d", of_ASSIGN_D, 3, {OA_FUNC_PTR, OA_BIT1, OA_BIT2} },
{ "%assign/m",of_ASSIGN_MEM,3,{OA_MEM_PTR,OA_BIT1, OA_BIT2} },
{ "%assign/x0",of_ASSIGN_X0,3,{OA_FUNC_PTR,OA_BIT1, OA_BIT2} },
{ "%breakpoint", of_BREAKPOINT, 0, {OA_NONE, OA_NONE, OA_NONE} },
@ -1409,6 +1410,9 @@ vvp_ipoint_t debug_lookup_functor(const char*name)
/*
* $Log: compile.cc,v $
* Revision 1.125 2002/04/21 22:29:49 steve
* Add the assign/d instruction for computed delays.
*
* Revision 1.124 2002/04/14 18:41:34 steve
* Support signed integer division.
*

View File

@ -1,7 +1,7 @@
/*
* Copyright (c) 2001 Stephen Williams (steve@icarus.com)
*
* $Id: opcodes.txt,v 1.33 2002/04/14 18:41:34 steve Exp $
* $Id: opcodes.txt,v 1.34 2002/04/21 22:29:49 steve Exp $
*/
@ -42,6 +42,7 @@ means the following:
otherwise x
* %assign <var-label>, <delay>, <bit>
* %assign/d <var-label>, <delay>, <bit>
This does a non-blocking assignment to a variable. The <label>
identifies the affected variable, and the <delay> gives the delay when
@ -49,6 +50,10 @@ the assignment takes place. The delay may be 0. For blocking
assignments, see %set. The <bit> is the address of the thread register
that contains the bit value to assign.
The %assign/d instruction is exactly the same as the %assign
instruction, except that the <delay> specifies one of the index
registers, that contain a calculated delay.
* %assign/m <memory-label>, <delay>, <bit>

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT)
#ident "$Id: vthread.cc,v 1.68 2002/04/14 18:41:34 steve Exp $"
#ident "$Id: vthread.cc,v 1.69 2002/04/21 22:29:49 steve Exp $"
#endif
# include "vthread.h"
@ -390,6 +390,14 @@ bool of_ASSIGN(vthread_t thr, vvp_code_t cp)
return true;
}
bool of_ASSIGN_D(vthread_t thr, vvp_code_t cp)
{
assert(cp->bit_idx[0] < 4);
unsigned char bit_val = thr_get_bit(thr, cp->bit_idx[1]);
schedule_assign(cp->iptr, bit_val, thr->index[cp->bit_idx[0]]);
return true;
}
bool of_ASSIGN_X0(vthread_t thr, vvp_code_t cp)
{
unsigned char bit_val = thr_get_bit(thr, cp->bit_idx[1]);
@ -1876,6 +1884,9 @@ bool of_CALL_UFUNC(vthread_t thr, vvp_code_t cp)
/*
* $Log: vthread.cc,v $
* Revision 1.69 2002/04/21 22:29:49 steve
* Add the assign/d instruction for computed delays.
*
* Revision 1.68 2002/04/14 18:41:34 steve
* Support signed integer division.
*