From 7a0e73ef3d8019d932d43e3a4a3b38b5ea095ccb Mon Sep 17 00:00:00 2001 From: steve Date: Thu, 1 Nov 2001 04:42:39 +0000 Subject: [PATCH] Handle procedural constant functor pointers. --- vvp/compile.cc | 29 +++++++++++++++++++++++++---- vvp/force.cc | 12 ++++++++++-- 2 files changed, 35 insertions(+), 6 deletions(-) diff --git a/vvp/compile.cc b/vvp/compile.cc index 67822d062..8ccfdbf87 100644 --- a/vvp/compile.cc +++ b/vvp/compile.cc @@ -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.111 2001/11/01 03:00:19 steve Exp $" +#ident "$Id: compile.cc,v 1.112 2001/11/01 04:42:39 steve Exp $" #endif # include "arith.h" @@ -1250,9 +1250,27 @@ void compile_code(char*label, char*mnem, comp_operands_t opa) break; } - functor_ref_lookup(&code->iptr2, - opa->argv[idx].symb.text, - opa->argv[idx].symb.idx); + if (strcmp(opa->argv[idx].symb.text, "C<0>") == 0) { + code->iptr2 = ipoint_make(0, 0); + free(opa->argv[idx].symb.text); + + } else if (strcmp(opa->argv[idx].symb.text, "C<1>") == 0) { + code->iptr2 = ipoint_make(0, 1); + free(opa->argv[idx].symb.text); + + } else if (strcmp(opa->argv[idx].symb.text, "C") == 0) { + code->iptr2 = ipoint_make(0, 2); + free(opa->argv[idx].symb.text); + + } else if (strcmp(opa->argv[idx].symb.text, "C") == 0) { + code->iptr2 = ipoint_make(0, 3); + free(opa->argv[idx].symb.text); + + } else { + functor_ref_lookup(&code->iptr2, + opa->argv[idx].symb.text, + opa->argv[idx].symb.idx); + } break; case OA_NUMBER: @@ -1464,6 +1482,9 @@ vvp_ipoint_t debug_lookup_functor(const char*name) /* * $Log: compile.cc,v $ + * Revision 1.112 2001/11/01 04:42:39 steve + * Handle procedural constant functor pointers. + * * Revision 1.111 2001/11/01 03:00:19 steve * Add force/cassign/release/deassign support. (Stephan Boettcher) * diff --git a/vvp/force.cc b/vvp/force.cc index e039eb98c..b748b7694 100644 --- a/vvp/force.cc +++ b/vvp/force.cc @@ -18,7 +18,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) -#ident "$Id: force.cc,v 1.1 2001/11/01 03:00:19 steve Exp $" +#ident "$Id: force.cc,v 1.2 2001/11/01 04:42:40 steve Exp $" #endif # include "codes.h" @@ -194,7 +194,12 @@ bool var_functor_s::deassign(vvp_ipoint_t itgt) return false; } - +/* + * The %cassign instruction causes a variable functor (the target) the + * receive a behavioral continuous assignment from the functor on the + * right (the source expression). If the source functor address is 0, + * then the port part is a constant value to write into the target. + */ bool of_CASSIGN(vthread_t thr, vvp_code_t cp) { vvp_ipoint_t itgt = cp->iptr; @@ -244,6 +249,9 @@ bool of_DEASSIGN(vthread_t thr, vvp_code_t cp) /* * $Log: force.cc,v $ + * Revision 1.2 2001/11/01 04:42:40 steve + * Handle procedural constant functor pointers. + * * Revision 1.1 2001/11/01 03:00:19 steve * Add force/cassign/release/deassign support. (Stephan Boettcher) *