Skip to content

Commit

Permalink
Move the DLL= flag to target config files.
Browse files Browse the repository at this point in the history
  • Loading branch information
steve committed Nov 13, 2003
1 parent c96b040 commit 12033d7
Show file tree
Hide file tree
Showing 11 changed files with 58 additions and 11 deletions.
8 changes: 7 additions & 1 deletion compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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);
Expand All @@ -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.
*
Expand Down
6 changes: 5 additions & 1 deletion driver/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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.
*
Expand Down
10 changes: 5 additions & 5 deletions iverilog.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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 changes: 13 additions & 2 deletions main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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.
*
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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.
*
Expand Down
15 changes: 14 additions & 1 deletion t-dll.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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.
*
Expand Down
7 changes: 7 additions & 0 deletions tgt-fpga/fpga-s.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
functor:synth2
functor:synth
functor:syn-rules
functor:cprop
functor:nodangle
-t:dll
flag:DLL=fpga.tgt
1 change: 1 addition & 0 deletions tgt-fpga/fpga.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ functor:syn-rules
functor:cprop
functor:nodangle
-t:dll
flag:DLL=fpga.tgt
2 changes: 2 additions & 0 deletions tgt-null/null-s.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
functor:synth2
functor:synth
functor:syn-rules
-t:dll
flag:DLL=null.tgt
3 changes: 2 additions & 1 deletion tgt-null/null.conf
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
-tdll
-t:dll
flag:DLL=null.tgt
1 change: 1 addition & 0 deletions tgt-vvp/vvp-s.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ functor:syn-rules
functor:cprop
functor:nodangle
-t:dll
flag:DLL=vvp.tgt
1 change: 1 addition & 0 deletions tgt-vvp/vvp.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
functor:cprop
functor:nodangle
-t:dll
flag:DLL=vvp.tgt

0 comments on commit 12033d7

Please sign in to comment.