From cb65ee5e0071c76e50e02b1b2bcb883a5429a936 Mon Sep 17 00:00:00 2001 From: steve Date: Sun, 11 Mar 2001 00:29:38 +0000 Subject: [PATCH] Add the vvp engine to cvs. --- Makefile.in | 4 +- configure.in | 1 + vvp/.cvsignore | 11 + vvp/Makefile.in | 79 +++ vvp/README.txt | 170 +++++++ vvp/codes.cc | 123 +++++ vvp/codes.h | 88 ++++ vvp/compile.cc | 360 ++++++++++++++ vvp/compile.h | 104 ++++ vvp/config.guess | 912 +++++++++++++++++++++++++++++++++++ vvp/config.h.in | 35 ++ vvp/config.sub | 1178 +++++++++++++++++++++++++++++++++++++++++++++ vvp/configure.in | 13 + vvp/functor.cc | 132 +++++ vvp/functor.h | 87 ++++ vvp/install-sh | 238 +++++++++ vvp/lexor.lex | 62 +++ vvp/main.cc | 76 +++ vvp/opcodes.txt | 39 ++ vvp/parse.y | 149 ++++++ vvp/parse_misc.cc | 54 +++ vvp/parse_misc.h | 57 +++ vvp/pointers.h | 77 +++ vvp/schedule.cc | 148 ++++++ vvp/schedule.h | 40 ++ vvp/symbols.cc | 295 ++++++++++++ vvp/symbols.h | 85 ++++ vvp/vthread.cc | 96 ++++ vvp/vthread.h | 57 +++ 29 files changed, 4769 insertions(+), 1 deletion(-) create mode 100644 vvp/.cvsignore create mode 100644 vvp/Makefile.in create mode 100644 vvp/README.txt create mode 100644 vvp/codes.cc create mode 100644 vvp/codes.h create mode 100644 vvp/compile.cc create mode 100644 vvp/compile.h create mode 100755 vvp/config.guess create mode 100644 vvp/config.h.in create mode 100755 vvp/config.sub create mode 100644 vvp/configure.in create mode 100644 vvp/functor.cc create mode 100644 vvp/functor.h create mode 100755 vvp/install-sh create mode 100644 vvp/lexor.lex create mode 100644 vvp/main.cc create mode 100644 vvp/opcodes.txt create mode 100644 vvp/parse.y create mode 100644 vvp/parse_misc.cc create mode 100644 vvp/parse_misc.h create mode 100644 vvp/pointers.h create mode 100644 vvp/schedule.cc create mode 100644 vvp/schedule.h create mode 100644 vvp/symbols.cc create mode 100644 vvp/symbols.h create mode 100644 vvp/vthread.cc create mode 100644 vvp/vthread.h diff --git a/Makefile.in b/Makefile.in index 7c077ae0d..e83c17421 100644 --- a/Makefile.in +++ b/Makefile.in @@ -16,7 +16,7 @@ # 59 Temple Place - Suite 330 # Boston, MA 02111-1307, USA # -#ident "$Id: Makefile.in,v 1.91 2001/02/10 20:29:39 steve Exp $" +#ident "$Id: Makefile.in,v 1.92 2001/03/11 00:29:38 steve Exp $" # # SHELL = /bin/sh @@ -27,6 +27,8 @@ prefix = @prefix@ exec_prefix = @exec_prefix@ srcdir = @srcdir@ +SUBDIRS = @subdirs@ + VPATH = $(srcdir) bindir = @bindir@ diff --git a/configure.in b/configure.in index f51c1feb2..7a6d9fc97 100644 --- a/configure.in +++ b/configure.in @@ -148,5 +148,6 @@ AC_SUBST(shared) AC_MSG_RESULT($shared) +AC_CONFIG_SUBDIRS(vvp) AC_OUTPUT(Makefile vpi/Makefile ivlpp/Makefile vvm/Makefile driver/Makefile tgt-null/Makefile tgt-stub/Makefile tgt-verilog/Makefile tgt-pal/Makefile) diff --git a/vvp/.cvsignore b/vvp/.cvsignore new file mode 100644 index 000000000..bba39f870 --- /dev/null +++ b/vvp/.cvsignore @@ -0,0 +1,11 @@ +configure +config.log +config.status +config.h +dep +Makefile +lexor.cc +parse.cc +parse.cc.output +parse.h +vvp diff --git a/vvp/Makefile.in b/vvp/Makefile.in new file mode 100644 index 000000000..9f8f34be8 --- /dev/null +++ b/vvp/Makefile.in @@ -0,0 +1,79 @@ +# +# This source code is free software; you can redistribute it +# and/or modify it in source code form under the terms of the GNU +# Library General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public +# License along with this program; if not, write to the Free +# Software Foundation, Inc., +# 59 Temple Place - Suite 330 +# Boston, MA 02111-1307, USA +# +#ident "$Id: Makefile.in,v 1.1 2001/03/11 00:29:38 steve Exp $" +# +# +SHELL = /bin/sh + +prefix = @prefix@ +exec_prefix = @exec_prefix@ +srcdir = @srcdir@ + +VPATH = $(srcdir) + +bindir = @bindir@ +libdir = @libdir@ +includedir = @includedir@ + +CC = @CC@ +CXX = @CXX@ -Wall +INSTALL = @INSTALL@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +STRIP = @STRIP@ + +CPPFLAGS = @CPPFLAGS@ @DEFS@ +CXXFLAGS = @CXXFLAGS@ -I. -I$(srcdir) +LDFLAGS = @LDFLAGS@ + +all: vvp + +clean: + rm -rf vvp *.o *~ parse.cc parse.cc.output parse.h lexor.cc dep + +distclean: clean + rm -f config.h Makefile config.cache config.log config.status + +O = main.o parse.o parse_misc.o lexor.o compile.o functor.o symbols.o \ +codes.o vthread.o schedule.o + +vvp: $O + $(CXX) $(CXXFLAGS) $(LDFLAGS) -o vvp $O + + +%.o: %.cc + @[ -d dep ] || mkdir dep + $(CXX) $(CPPFLAGS) $(CXXFLAGS) -MD -c $< -o $*.o + mv $*.d dep/$*.d + + +lexor.o: lexor.cc parse.h + +parse.o: parse.cc + +parse.h parse.cc: $(srcdir)/parse.y + bison --verbose -t -d $(srcdir)/parse.y -o parse.cc + mv parse.cc.h parse.h + +lexor.cc: $(srcdir)/lexor.lex + flex -s -olexor.cc $(srcdir)/lexor.lex + + +-include $(patsubst %.o, dep/%.d, $O) diff --git a/vvp/README.txt b/vvp/README.txt new file mode 100644 index 000000000..d60b62092 --- /dev/null +++ b/vvp/README.txt @@ -0,0 +1,170 @@ + +VVP SIMULATION ENGINE + +The VVP simulator takes as input source code not unlike assembly +language for a conventional processor. It is intended to be machine +generated code emitted by other tools, including the Icarus Verilog +compiler, so the syntax, though readable, is not necessarily +convenient for humans. + + +GENERAL FORMAT + +The source file is a collection of statements. Each statement may have +a label, an opcode, and operands that depend on the opcode. For some +opcodes, the label is optional (or meaningless) and for others it is +required. + +Every statement is terminated by a semicolon. The semicolon is also +the start of a comment line, so you can put comment text after the +semicolon that terminates a statement. Like so: + + Label .functor and, x, y ; This is a comment. + +The semicolon is required, whether the comment is there or not. + +Statements may span multiple lines, as long as there is no text (other +then the first character of a label) in the first column of hte +continuation line. + + +LABELS AND SYMBOLS + +Labels and symbols consist of the characters: + + a-z + A-Z + 0-9 + .$_ + +Labels and symbols may not start with a digit or a '.', so that they +are easily distinguished from keywords and numbers. A Label is a +symbol that starts a statement. If a label is present in a statement, +it must start in the first text column. This is how the lexical +analyzer distinguishes a label from a symbol. If a symbol is present +in a statement, it is in the operand. Opcodes of statements must be a +keyword. + +Symbols are references to labels. It is not necessary for a label to +be declared before its use in a symbol, but it must be declared +eventually. + + +FUNCTOR STATEMENTS: + +A functor statement is a statement that uses the ``.functor'' +opcode. Functors are the basic structural units of a simulation, and +include a type (in the form of a truth table) and up to four inputs. A +label is required for functors. + +The general syntax of a functor is: + +