From 6f46d12e070de975afbb19202aec1c76faf8a220 Mon Sep 17 00:00:00 2001 From: steve Date: Wed, 8 Mar 2006 05:29:42 +0000 Subject: [PATCH] Add support for logic parameters. --- tgt-vvp/vvp_scope.c | 20 ++++++++++-- vvp/README.txt | 23 ++++++------- vvp/compile.cc | 44 ++++++++++--------------- vvp/compile.h | 9 ++++-- vvp/lexor.lex | 8 +++-- vvp/parse.y | 14 +++++--- vvp/vpi_const.cc | 78 +++++++++++++++++++++++++++++++++++++++++---- vvp/vpi_priv.h | 6 +++- vvp/vvp_net.cc | 41 +++++++++++++++++++++++- vvp/vvp_net.h | 8 ++++- 10 files changed, 192 insertions(+), 59 deletions(-) diff --git a/tgt-vvp/vvp_scope.c b/tgt-vvp/vvp_scope.c index a0a8bd9ab..6465138a6 100644 --- a/tgt-vvp/vvp_scope.c +++ b/tgt-vvp/vvp_scope.c @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: vvp_scope.c,v 1.139 2006/01/02 05:33:20 steve Exp $" +#ident "$Id: vvp_scope.c,v 1.140 2006/03/08 05:29:42 steve Exp $" #endif # include "vvp_priv.h" @@ -2091,11 +2091,24 @@ int draw_scope(ivl_scope_t net, ivl_scope_t parent) ivl_expr_t pex = ivl_parameter_expr(par); switch (ivl_expr_type(pex)) { case IVL_EX_STRING: - fprintf(vvp_out, "P_%p .param \"%s\", string, \"%s\";\n", + fprintf(vvp_out, "P_%p .param/str \"%s\", \"%s\";\n", par, ivl_parameter_basename(par), ivl_expr_string(pex)); break; + case IVL_EX_NUMBER: + fprintf(vvp_out, "P_%p .param/l \"%s\", C4<", + par, ivl_parameter_basename(par)); + { const char*bits = ivl_expr_bits(pex); + unsigned nbits = ivl_expr_width(pex); + unsigned bb; + for (bb = 0 ; bb < nbits; bb += 1) + fprintf(vvp_out, "%c", bits[nbits-bb-1]); + } + fprintf(vvp_out, ">;\n"); + break; default: + fprintf(vvp_out, "; parameter type %d unsupported\n", + ivl_expr_type(pex)); break; } } @@ -2153,6 +2166,9 @@ int draw_scope(ivl_scope_t net, ivl_scope_t parent) /* * $Log: vvp_scope.c,v $ + * Revision 1.140 2006/03/08 05:29:42 steve + * Add support for logic parameters. + * * Revision 1.139 2006/01/02 05:33:20 steve * Node delays can be more general expressions in structural contexts. * diff --git a/vvp/README.txt b/vvp/README.txt index bba6d9c5e..fe941d9dc 100644 --- a/vvp/README.txt +++ b/vvp/README.txt @@ -1,7 +1,7 @@ /* * Copyright (c) 2001 Stephen Williams (steve@icarus.com) * - * $Id: README.txt,v 1.75 2006/01/02 05:32:06 steve Exp $ + * $Id: README.txt,v 1.76 2006/03/08 05:29:42 steve Exp $ */ VVP SIMULATION ENGINE @@ -101,22 +101,23 @@ objects. The syntax of a parameter is: -