Make the null target into a loadable target.

This commit is contained in:
steve 2000-12-02 04:50:32 +00:00
parent d16d29c591
commit d0ec7e2c02
8 changed files with 145 additions and 134 deletions

View File

@ -16,7 +16,7 @@
# 59 Temple Place - Suite 330
# Boston, MA 02111-1307, USA
#
#ident "$Id: Makefile.in,v 1.82 2000/11/30 17:31:42 steve Exp $"
#ident "$Id: Makefile.in,v 1.83 2000/12/02 04:50:32 steve Exp $"
#
#
SHELL = /bin/sh
@ -53,6 +53,7 @@ all: ivl@EXEEXT@
cd vpi ; $(MAKE) all
cd ivlpp ; $(MAKE) all
cd driver ; $(MAKE) all
cd tgt-null ; $(MAKE) all
cd tgt-verilog ; $(MAKE) all
cd tgt-stub ; $(MAKE) all
@ -69,6 +70,7 @@ clean:
cd vpi ; $(MAKE) clean
cd driver ; $(MAKE) clean
cd ivlpp ; $(MAKE) clean
cd tgt-null ; $(MAKE) clean
cd tgt-verilog ; $(MAKE) clean
cd tgt-stub ; $(MAKE) clean
@ -80,7 +82,7 @@ distclean: clean
rm -f config.status config.cache config.log
rm -f Makefile
TT = t-dll.o t-dll-api.o t-dll-expr.o t-dll-proc.o t-null.o t-vvm.o t-xnf.o
TT = t-dll.o t-dll-api.o t-dll-expr.o t-dll-proc.o t-vvm.o t-xnf.o
FF = nodangle.o synth.o syn-rules.o xnfio.o
O = main.o cprop.o design_dump.o dup_expr.o elaborate.o elab_expr.o \
@ -160,6 +162,7 @@ install: all installdirs $(libdir)/ivl/ivl@EXEEXT@ $(libdir)/ivl/iverilog.conf $
cd vpi ; $(MAKE) install
cd ivlpp ; $(MAKE) install
cd driver ; $(MAKE) install
cd tgt-null ; $(MAKE) install
$(libdir)/ivl/ivl@EXEEXT@: ./ivl@EXEEXT@
$(INSTALL_PROGRAM) ./ivl@EXEEXT@ $(libdir)/ivl/ivl@EXEEXT@
@ -183,6 +186,7 @@ uninstall:
cd vpi ; $(MAKE) uninstall
cd vvm ; $(MAKE) uninstall
cd ivlpp ; $(MAKE) uninstall
cd tgt-null ; $(MAKE) uninstall
-include $(patsubst %.o, dep/%.d, $O)

View File

@ -92,4 +92,4 @@ AC_SUBST(rdynamic)
AC_MSG_RESULT($rdynamic)
AC_OUTPUT(Makefile vpi/Makefile ivlpp/Makefile vvm/Makefile driver/Makefile tgt-stub/Makefile tgt-verilog/Makefile)
AC_OUTPUT(Makefile vpi/Makefile ivlpp/Makefile vvm/Makefile driver/Makefile tgt-null/Makefile tgt-stub/Makefile tgt-verilog/Makefile)

View File

@ -56,10 +56,10 @@
# be useful and interesting if the -N flag is included.
[-tnull -S]
<ivl>%B/ivl %W %[s-s%s] %[N-N%N] %[T-T%T] -tnull -- -
<ivl>%B/ivl %W %[s-s%s] %[N-N%N] %[T-T%T] -tdll -fDLL=%B/null.tgt -- -
[-tnull]
<ivl>%B/ivl %W %[s-s%s] %[N-N%N] %[T-T%T] -tnull -- -
<ivl>%B/ivl %W %[s-s%s] %[N-N%N] %[T-T%T] -tdll -fDLL=%B/null.tgt -- -
# --
# The vvm target uses the <ivl> string to take the preprocessed code from

124
t-null.cc
View File

@ -1,124 +0,0 @@
/*
* Copyright (c) 1999-2000 Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
* 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 General Public License for more details.
*
* You should have received a copy of the GNU 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
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: t-null.cc,v 1.17 2000/08/27 15:51:51 steve Exp $"
#endif
# include "netlist.h"
# include "target.h"
/*
* This target type simply drops the netlist. It is useful for
* skipping the code generation phase.
*/
static class target_null_t : public target_t {
public:
bool start_design(const Design*) { return true; }
bool bufz(const NetBUFZ*) { return true; }
void event(const NetEvent*) { }
void func_def(const NetFuncDef*) { }
void memory(const NetMemory*) { }
void signal(const NetNet*) { }
void task_def(const NetTaskDef*) { }
void net_assign(const NetAssign*) { }
void net_assign_nb(const NetAssignNB*) { }
bool net_const(const NetConst*) { return true; }
void net_probe(const NetEvProbe*) { }
bool proc_block(const NetBlock*) { return true; }
void proc_condit(const NetCondit*) { }
bool proc_delay(const NetPDelay*) { return true; }
void proc_forever(const NetForever*) { }
void proc_repeat(const NetRepeat*) { }
void proc_stask(const NetSTask*) { }
void proc_utask(const NetUTask*) { }
bool proc_wait(const NetEvWait*) { return true; }
} target_null_obj;
extern const struct target tgt_null = { "null", &target_null_obj };
/*
* $Log: t-null.cc,v $
* Revision 1.17 2000/08/27 15:51:51 steve
* t-dll iterates signals, and passes them to the
* target module.
*
* Some of NetObj should return char*, not string.
*
* Revision 1.16 2000/08/14 04:39:57 steve
* add th t-dll functions for net_const, net_bufz and processes.
*
* Revision 1.15 2000/08/09 03:43:45 steve
* Move all file manipulation out of target class.
*
* Revision 1.14 2000/08/08 01:50:42 steve
* target methods need not take a file stream.
*
* Revision 1.13 2000/07/29 16:21:08 steve
* Report code generation errors through proc_delay.
*
* Revision 1.12 2000/06/14 20:29:39 steve
* Ignore more things in null target.
*
* Revision 1.11 2000/04/12 04:23:58 steve
* Named events really should be expressed with PEIdent
* objects in the pform,
*
* Handle named events within the mix of net events
* and edges. As a unified lot they get caught together.
* wait statements are broken into more complex statements
* that include a conditional.
*
* Do not generate NetPEvent or NetNEvent objects in
* elaboration. NetEvent, NetEvWait and NetEvProbe
* take over those functions in the netlist.
*
* Revision 1.10 2000/02/23 02:56:55 steve
* Macintosh compilers do not support ident.
*
* Revision 1.9 2000/02/14 06:04:52 steve
* Unary reduction operators do not set their operand width
*
* Revision 1.8 1999/10/05 03:26:37 steve
* null target ignore assignment nodes.
*
* Revision 1.7 1999/09/30 21:27:29 steve
* Ignore user task definitions.
*
* Revision 1.6 1999/09/22 16:57:24 steve
* Catch parallel blocks in vvm emit.
*
* Revision 1.5 1999/09/17 02:06:26 steve
* Handle unconnected module ports.
*
* Revision 1.4 1999/07/03 02:12:52 steve
* Elaborate user defined tasks.
*
* Revision 1.3 1999/06/19 21:06:16 steve
* Elaborate and supprort to vvm the forever
* and repeat statements.
*
* Revision 1.2 1999/06/06 20:33:30 steve
* implement some null-target code generation.
*
* Revision 1.1 1999/01/24 01:35:08 steve
* Support null target for generating no output.
*
*/

View File

@ -17,21 +17,17 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: targets.cc,v 1.6 2000/08/12 16:34:37 steve Exp $"
#ident "$Id: targets.cc,v 1.7 2000/12/02 04:50:32 steve Exp $"
#endif
# include "target.h"
extern const struct target tgt_dll;
extern const struct target tgt_null;
//extern const struct target tgt_verilog;
extern const struct target tgt_vvm;
extern const struct target tgt_xnf;
const struct target *target_table[] = {
&tgt_null,
&tgt_dll,
//&tgt_verilog,
&tgt_vvm,
&tgt_xnf,
0
@ -39,6 +35,9 @@ const struct target *target_table[] = {
/*
* $Log: targets.cc,v $
* Revision 1.7 2000/12/02 04:50:32 steve
* Make the null target into a loadable target.
*
* Revision 1.6 2000/08/12 16:34:37 steve
* Start stub for loadable targets.
*

3
tgt-null/.cvsignore Normal file
View File

@ -0,0 +1,3 @@
Makefile
null.tgt
dep

83
tgt-null/Makefile.in Normal file
View File

@ -0,0 +1,83 @@
#
# 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 2000/12/02 04:50:32 steve Exp $"
#
#
SHELL = /bin/sh
VERSION = 0.0
prefix = @prefix@
exec_prefix = @exec_prefix@
srcdir = @srcdir@
VPATH = $(srcdir)
bindir = @bindir@
libdir = @libdir@
includedir = $(prefix)/include
CC = @CC@
CXX = @CXX@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
CPPFLAGS = @CPPFLAGS@ @DEFS@ @PICFLAG@
CXXFLAGS = @CXXFLAGS@
LDFLAGS = @LDFLAGS@
all: null.tgt
%.o: %.c
@[ -d dep ] || mkdir dep
$(CC) -Wall $(CPPFLAGS) -I$(srcdir)/.. -MD -c $< -o $*.o
mv $*.d dep
O = null.o
ifeq (@CYGWIN@,yes)
TGTLDFLAGS=-Wl,--enable-auto-image-base -L.. -livl
TGTDEPLIBS=../libivl.a
else
TGTLDFLAGS=
TGTDEPLIBS=
endif
null.tgt: $O $(TGTDEPLIBS)
$(CC) -shared -o $@ $O $(TGTLDFLAGS)
clean:
rm -f *.o dep/*.d
install: all installdirs $(libdir)/ivl/null.tgt
$(libdir)/ivl/null.tgt: ./null.tgt
$(INSTALL_DATA) ./null.tgt $(libdir)/ivl/null.tgt
installdirs: ../mkinstalldirs
$(srcdir)/../mkinstalldirs $(includedir) $(bindir) $(libdir)/ivl
uninstall:
rm -f $(libdir)/ivl/null.tgt
-include $(patsubst %.o, dep/%.d, $O)

46
tgt-null/null.c Normal file
View File

@ -0,0 +1,46 @@
/*
* Copyright (c) 2000 Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
* 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 General Public License for more details.
*
* You should have received a copy of the GNU 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
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: null.c,v 1.1 2000/12/02 04:50:32 steve Exp $"
#endif
/*
* This is a null target module. It does nothing.
*/
# include <ivl_target.h>
int target_design(ivl_design_t des)
{
return 0;
}
#ifdef __CYGWIN32__
#include <cygwin/cygwin_dll.h>
DECLARE_CYGWIN_DLL(DllMain);
#endif
/*
* $Log: null.c,v $
* Revision 1.1 2000/12/02 04:50:32 steve
* Make the null target into a loadable target.
*
*/