Move the DLL= flag to target config files.

This commit is contained in:
steve 2003-11-13 05:55:33 +00:00
parent c96b0402be
commit 12033d7bd4
11 changed files with 58 additions and 11 deletions

View File

@ -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 <list>
@ -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 list<const char*>library_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.
*

View File

@ -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.
*

View File

@ -46,20 +46,20 @@
# be useful and interesting if the -N flag is included.
[-tnull -S]
<ivl>%B/ivl %[v-v] -C%c -C%C %[N-N%N] -fDLL=%B/null.tgt -- -
<ivl>%B/ivl %[v-v] -C%c -C%C %[N-N%N] -- -
[-tnull]
<ivl>%B/ivl %[v-v] -C%c -C%C %[N-N%N] -fDLL=%B/null.tgt -- -
<ivl>%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]
<ivl>%B/ivl %[v-v] -C%c -C%C %[N-N%N] -fDLL=%B/vvp.tgt -fVVP_EXECUTABLE=%B/../../bin/vvp -- -
<ivl>%B/ivl %[v-v] -C%c -C%C %[N-N%N] -fVVP_EXECUTABLE=%B/../../bin/vvp -- -
[-tvvp]
<ivl>%B/ivl %[v-v] -C%c -C%C %[N-N%N] -fDLL=%B/vvp.tgt -fVVP_EXECUTABLE=%B/../../bin/vvp -- -
<ivl>%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]
<ivl>%B/ivl %[v-v] -C%c -C%C %[N-N%N] -fDLL=%B/fpga.tgt -- -
<ivl>%B/ivl %[v-v] -C%c -C%C %[N-N%N] -- -

15
main.cc
View File

@ -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:<target>
* Usually, "-t:dll"
*
* basedir:<path>
* Location to look for installed sub-components
*
* depfile:<path>
* 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.
*

View File

@ -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<NetScope *> 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.
*

7
tgt-fpga/fpga-s.conf Normal file
View File

@ -0,0 +1,7 @@
functor:synth2
functor:synth
functor:syn-rules
functor:cprop
functor:nodangle
-t:dll
flag:DLL=fpga.tgt

View File

@ -4,3 +4,4 @@ functor:syn-rules
functor:cprop
functor:nodangle
-t:dll
flag:DLL=fpga.tgt

View File

@ -1,3 +1,5 @@
functor:synth2
functor:synth
functor:syn-rules
-t:dll
flag:DLL=null.tgt

View File

@ -1 +1,2 @@
-tdll
-t:dll
flag:DLL=null.tgt

View File

@ -4,3 +4,4 @@ functor:syn-rules
functor:cprop
functor:nodangle
-t:dll
flag:DLL=vvp.tgt

View File

@ -1,3 +1,4 @@
functor:cprop
functor:nodangle
-t:dll
flag:DLL=vvp.tgt