From 12033d7bd4a8aa0cc3bab95124d0a16c338e61ad Mon Sep 17 00:00:00 2001 From: steve Date: Thu, 13 Nov 2003 05:55:33 +0000 Subject: [PATCH] Move the DLL= flag to target config files. --- compiler.h | 8 +++++++- driver/main.c | 6 +++++- iverilog.conf | 10 +++++----- main.cc | 15 +++++++++++++-- t-dll.cc | 15 ++++++++++++++- tgt-fpga/fpga-s.conf | 7 +++++++ tgt-fpga/fpga.conf | 1 + tgt-null/null-s.conf | 2 ++ tgt-null/null.conf | 3 ++- tgt-vvp/vvp-s.conf | 1 + tgt-vvp/vvp.conf | 1 + 11 files changed, 58 insertions(+), 11 deletions(-) create mode 100644 tgt-fpga/fpga-s.conf diff --git a/compiler.h b/compiler.h index 731bc191a..700bb0eb1 100644 --- a/compiler.h +++ b/compiler.h @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: compiler.h,v 1.18 2003/11/08 20:06:21 steve Exp $" +#ident "$Id: compiler.h,v 1.19 2003/11/13 05:55:33 steve Exp $" #endif # include @@ -81,6 +81,9 @@ extern bool warn_portbinding; /* This is true if verbose output is requested. */ extern bool verbose_flag; +/* Path to a directory useful for finding subcomponents. */ +extern const char*basedir; + /* This is an ordered list of library suffixes to search. */ extern listlibrary_suff; extern int build_library_index(const char*path, bool key_case_sensitive); @@ -105,6 +108,9 @@ extern StringHeapLex lex_strings; /* * $Log: compiler.h,v $ + * Revision 1.19 2003/11/13 05:55:33 steve + * Move the DLL= flag to target config files. + * * Revision 1.18 2003/11/08 20:06:21 steve * Spelling fixes in comments. * diff --git a/driver/main.c b/driver/main.c index 63e22195b..cd764828f 100644 --- a/driver/main.c +++ b/driver/main.c @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: main.c,v 1.59 2003/11/13 04:09:49 steve Exp $" +#ident "$Id: main.c,v 1.60 2003/11/13 05:55:33 steve Exp $" #endif # include "config.h" @@ -564,6 +564,7 @@ int main(int argc, char **argv) base,sep, targ, synth_flag? "-s" : ""); /* Write values to the iconfig file. */ + fprintf(iconfig_file, "basedir:%s\n", base); if (mtm != 0) fprintf(iconfig_file, "-T:%s\n", mtm); fprintf(iconfig_file, "generation:%s\n", generation); fprintf(iconfig_file, "warnings:%s\n", warning_flags); @@ -703,6 +704,9 @@ int main(int argc, char **argv) /* * $Log: main.c,v $ + * Revision 1.60 2003/11/13 05:55:33 steve + * Move the DLL= flag to target config files. + * * Revision 1.59 2003/11/13 04:09:49 steve * Pass flags through the temporary config file. * diff --git a/iverilog.conf b/iverilog.conf index bae8e9e97..4ca946dc1 100644 --- a/iverilog.conf +++ b/iverilog.conf @@ -46,20 +46,20 @@ # be useful and interesting if the -N flag is included. [-tnull -S] -%B/ivl %[v-v] -C%c -C%C %[N-N%N] -fDLL=%B/null.tgt -- - +%B/ivl %[v-v] -C%c -C%C %[N-N%N] -- - [-tnull] -%B/ivl %[v-v] -C%c -C%C %[N-N%N] -fDLL=%B/null.tgt -- - +%B/ivl %[v-v] -C%c -C%C %[N-N%N] -- - # -- # The vvp target generates code that the vvp simulation engine can execute. # These rules support synthesized and non-synthesized variants. [-tvvp -S] -%B/ivl %[v-v] -C%c -C%C %[N-N%N] -fDLL=%B/vvp.tgt -fVVP_EXECUTABLE=%B/../../bin/vvp -- - +%B/ivl %[v-v] -C%c -C%C %[N-N%N] -fVVP_EXECUTABLE=%B/../../bin/vvp -- - [-tvvp] -%B/ivl %[v-v] -C%c -C%C %[N-N%N] -fDLL=%B/vvp.tgt -fVVP_EXECUTABLE=%B/../../bin/vvp -- - +%B/ivl %[v-v] -C%c -C%C %[N-N%N] -fVVP_EXECUTABLE=%B/../../bin/vvp -- - # This is the XNF code generator. @@ -68,4 +68,4 @@ # And this is the FPGA synthesizer. [-tfpga] -%B/ivl %[v-v] -C%c -C%C %[N-N%N] -fDLL=%B/fpga.tgt -- - +%B/ivl %[v-v] -C%c -C%C %[N-N%N] -- - diff --git a/main.cc b/main.cc index ce14c8667..4d896fa43 100644 --- a/main.cc +++ b/main.cc @@ -19,7 +19,7 @@ const char COPYRIGHT[] = * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: main.cc,v 1.77 2003/11/13 04:09:49 steve Exp $" +#ident "$Id: main.cc,v 1.78 2003/11/13 05:55:33 steve Exp $" #endif # include "config.h" @@ -77,6 +77,8 @@ unsigned flag_errors = 0; const char VERSION[] = "$Name: $"; +const char*basedir = "."; + const char*target = "null"; generation_t generation_flag = GN_DEFAULT; @@ -223,6 +225,9 @@ static void parm_to_flagmap(const string&flag) * -t: * Usually, "-t:dll" * + * basedir: + * Location to look for installed sub-components + * * depfile: * Give the path to an output dependency file. * @@ -284,7 +289,10 @@ static void read_iconfig_file(const char*ipath) } } - if (strcmp(buf, "depfile") == 0) { + if (strcmp(buf, "basedir") == 0) { + basedir = strdup(cp); + + } else if (strcmp(buf, "depfile") == 0) { depfile_name = strdup(cp); } else if (strcmp(buf, "flag") == 0) { @@ -707,6 +715,9 @@ int main(int argc, char*argv[]) /* * $Log: main.cc,v $ + * Revision 1.78 2003/11/13 05:55:33 steve + * Move the DLL= flag to target config files. + * * Revision 1.77 2003/11/13 04:09:49 steve * Pass flags through the temporary config file. * diff --git a/t-dll.cc b/t-dll.cc index 7a259efeb..421484445 100644 --- a/t-dll.cc +++ b/t-dll.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: t-dll.cc,v 1.122 2003/11/10 20:59:04 steve Exp $" +#ident "$Id: t-dll.cc,v 1.123 2003/11/13 05:55:33 steve Exp $" #endif # include "config.h" @@ -563,7 +563,17 @@ bool dll_target::start_design(const Design*des) { list root_scopes; const char*dll_path_ = des->get_flag("DLL"); + dll_ = ivl_dlopen(dll_path_); + + if ((dll_ == 0) && (dll_path_[0] != '/')) { + size_t len = strlen(basedir) + 1 + strlen(dll_path_) + 1; + char*tmp = new char[len]; + sprintf(tmp, "%s/%s", basedir, dll_path_); + dll_ = ivl_dlopen(tmp); + delete[]tmp; + } + if (dll_ == 0) { cerr << "error: " << dll_path_ << " failed to load." << endl; cerr << dll_path_ << ": " << dlerror() << endl; @@ -2159,6 +2169,9 @@ extern const struct target tgt_dll = { "dll", &dll_target_obj }; /* * $Log: t-dll.cc,v $ + * Revision 1.123 2003/11/13 05:55:33 steve + * Move the DLL= flag to target config files. + * * Revision 1.122 2003/11/10 20:59:04 steve * Design::get_flag returns const char* instead of string. * diff --git a/tgt-fpga/fpga-s.conf b/tgt-fpga/fpga-s.conf new file mode 100644 index 000000000..c99de31a5 --- /dev/null +++ b/tgt-fpga/fpga-s.conf @@ -0,0 +1,7 @@ +functor:synth2 +functor:synth +functor:syn-rules +functor:cprop +functor:nodangle +-t:dll +flag:DLL=fpga.tgt diff --git a/tgt-fpga/fpga.conf b/tgt-fpga/fpga.conf index e383383ec..c99de31a5 100644 --- a/tgt-fpga/fpga.conf +++ b/tgt-fpga/fpga.conf @@ -4,3 +4,4 @@ functor:syn-rules functor:cprop functor:nodangle -t:dll +flag:DLL=fpga.tgt diff --git a/tgt-null/null-s.conf b/tgt-null/null-s.conf index 6c2b979a7..bf62222dc 100644 --- a/tgt-null/null-s.conf +++ b/tgt-null/null-s.conf @@ -1,3 +1,5 @@ functor:synth2 functor:synth functor:syn-rules +-t:dll +flag:DLL=null.tgt diff --git a/tgt-null/null.conf b/tgt-null/null.conf index 9fe59b204..4d6369401 100644 --- a/tgt-null/null.conf +++ b/tgt-null/null.conf @@ -1 +1,2 @@ --tdll +-t:dll +flag:DLL=null.tgt diff --git a/tgt-vvp/vvp-s.conf b/tgt-vvp/vvp-s.conf index e383383ec..81c6f4a37 100644 --- a/tgt-vvp/vvp-s.conf +++ b/tgt-vvp/vvp-s.conf @@ -4,3 +4,4 @@ functor:syn-rules functor:cprop functor:nodangle -t:dll +flag:DLL=vvp.tgt diff --git a/tgt-vvp/vvp.conf b/tgt-vvp/vvp.conf index 19181514a..2dbe4a66b 100644 --- a/tgt-vvp/vvp.conf +++ b/tgt-vvp/vvp.conf @@ -1,3 +1,4 @@ functor:cprop functor:nodangle -t:dll +flag:DLL=vvp.tgt