From 014e68b62f7831312611f3398d105f39813e063e Mon Sep 17 00:00:00 2001 From: steve Date: Sun, 29 Apr 2001 22:59:46 +0000 Subject: [PATCH] Support .net constant inputs. --- vvp/README.txt | 12 +++++++++++- vvp/compile.cc | 27 ++++++++++++++++++++++++++- 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/vvp/README.txt b/vvp/README.txt index 1967bb767..0f6226e12 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.18 2001/04/26 03:10:55 steve Exp $ + * $Id: README.txt,v 1.19 2001/04/29 22:59:46 steve Exp $ */ VVP SIMULATION ENGINE @@ -260,6 +260,16 @@ legal to leave a bit unconnected. To do that, simply leave the position for that bit blank. Bits of .nets are initialized to z. Unconnected bits keep the value z throughout the simulation. +The special input symbols "C<0>", "C<1>", "C" and "C" and magic +symbols that set the net to a constant value instead of accepting an +input from a functor. This can happen, for example, when a wire is +declared like so: + + wire foo = 1'b1; + +This prevents any real functor being created and connected, and +instead leaves the input unconnected and initializes the wire with the +specified value, instead of the default z. EVENT STATEMENTS diff --git a/vvp/compile.cc b/vvp/compile.cc index d5f8c5654..409591a16 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.44 2001/04/28 20:24:03 steve Exp $" +#ident "$Id: compile.cc,v 1.45 2001/04/29 22:59:46 steve Exp $" #endif # include "compile.h" @@ -798,6 +798,26 @@ void compile_net(char*label, char*name, int msb, int lsb, bool signed_flag, continue; } + if (strcmp(argv[idx].text, "C<0>") == 0) { + obj->oval = 0; + continue; + } + + if (strcmp(argv[idx].text, "C<1>") == 0) { + obj->oval = 1; + continue; + } + + if (strcmp(argv[idx].text, "C") == 0) { + obj->oval = 2; + continue; + } + + if (strcmp(argv[idx].text, "C") == 0) { + obj->oval = 3; + continue; + } + symbol_value_t val = sym_get_value(sym_functors, argv[idx].text); if (val.num) { @@ -858,6 +878,8 @@ void compile_cleanup(void) } else { /* Still not resolved. put back into the list. */ + fprintf(stderr, "unresolved functor reference: %s\n", + res->source); res->next = resolv_list; resolv_list = res; } @@ -909,6 +931,9 @@ void compile_dump(FILE*fd) /* * $Log: compile.cc,v $ + * Revision 1.45 2001/04/29 22:59:46 steve + * Support .net constant inputs. + * * Revision 1.44 2001/04/28 20:24:03 steve * input connect cleanup. (Stephan Boettcher) *