Pass flags through the temporary config file.
This commit is contained in:
parent
435f06bd21
commit
5068e3ea15
|
|
@ -17,7 +17,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#ifdef HAVE_CVS_IDENT
|
||||
#ident "$Id: build_string.c,v 1.14 2003/11/01 04:21:57 steve Exp $"
|
||||
#ident "$Id: build_string.c,v 1.15 2003/11/13 04:09:49 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "config.h"
|
||||
|
|
@ -81,14 +81,6 @@ int build_string(char*output, size_t olen, const char*pattern)
|
|||
olen -= strlen(iconfig_common_path);
|
||||
break;
|
||||
|
||||
case 'f':
|
||||
if (f_list) {
|
||||
strcpy(output, f_list);
|
||||
output += strlen(f_list);
|
||||
olen -= strlen(f_list);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'N':
|
||||
if (npath) {
|
||||
strcpy(output, npath);
|
||||
|
|
@ -97,12 +89,6 @@ int build_string(char*output, size_t olen, const char*pattern)
|
|||
}
|
||||
break;
|
||||
|
||||
case 't':
|
||||
strcpy(output, targ);
|
||||
output += strlen(targ);
|
||||
olen -= strlen(targ);
|
||||
break;
|
||||
|
||||
}
|
||||
pattern += 1;
|
||||
|
||||
|
|
@ -118,6 +104,9 @@ int build_string(char*output, size_t olen, const char*pattern)
|
|||
|
||||
/*
|
||||
* $Log: build_string.c,v $
|
||||
* Revision 1.15 2003/11/13 04:09:49 steve
|
||||
* Pass flags through the temporary config file.
|
||||
*
|
||||
* Revision 1.14 2003/11/01 04:21:57 steve
|
||||
* Add support for a target static config file.
|
||||
*
|
||||
|
|
@ -129,39 +118,5 @@ int build_string(char*output, size_t olen, const char*pattern)
|
|||
*
|
||||
* Revision 1.11 2002/08/12 01:35:01 steve
|
||||
* conditional ident string using autoconfig.
|
||||
*
|
||||
* Revision 1.10 2002/05/28 02:25:03 steve
|
||||
* Pass library paths through -Cfile instead of command line.
|
||||
*
|
||||
* Revision 1.9 2002/05/28 00:50:39 steve
|
||||
* Add the ivl -C flag for bulk configuration
|
||||
* from the driver, and use that to run library
|
||||
* modules through the preprocessor.
|
||||
*
|
||||
* Revision 1.8 2002/05/24 01:13:00 steve
|
||||
* Support language generation flag -g.
|
||||
*
|
||||
* Revision 1.7 2002/04/04 05:26:13 steve
|
||||
* Add dependency generation.
|
||||
*
|
||||
* Revision 1.6 2001/11/16 05:07:19 steve
|
||||
* Add support for +libext+ in command files.
|
||||
*
|
||||
* Revision 1.5 2001/10/20 23:02:40 steve
|
||||
* Add automatic module libraries.
|
||||
*
|
||||
* Revision 1.4 2001/07/25 03:10:50 steve
|
||||
* Create a config.h.in file to hold all the config
|
||||
* junk, and support gcc 3.0. (Stephan Boettcher)
|
||||
*
|
||||
* Revision 1.3 2001/07/03 04:09:25 steve
|
||||
* Generate verbuse status messages (Stephan Boettcher)
|
||||
*
|
||||
* Revision 1.2 2000/10/28 03:45:47 steve
|
||||
* Use the conf file to generate the vvm ivl string.
|
||||
*
|
||||
* Revision 1.1 2000/10/08 22:36:56 steve
|
||||
* iverilog with an iverilog.conf configuration file.
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
*/
|
||||
#ifdef HAVE_CVS_IDENT
|
||||
#ident "$Id: globals.h,v 1.17 2003/11/01 04:21:57 steve Exp $"
|
||||
#ident "$Id: globals.h,v 1.18 2003/11/13 04:09:49 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include <stddef.h>
|
||||
|
|
@ -31,15 +31,6 @@ extern const char*base;
|
|||
extern char* iconfig_path;
|
||||
extern char* iconfig_common_path;
|
||||
|
||||
/* This is a list of all the -f<key>=<value> options from the
|
||||
command line, concatenated together. */
|
||||
extern char*f_list;
|
||||
|
||||
extern char*mod_list;
|
||||
|
||||
/* This is the optional -Tmin|typ|max setting. */
|
||||
extern const char*mtm;
|
||||
|
||||
/* Ths is the optional -M<dependfile> value, if one was supplied. */
|
||||
extern const char*depfile;
|
||||
|
||||
|
|
@ -58,9 +49,6 @@ extern int synth_flag;
|
|||
/* This is the name of the selected target. */
|
||||
extern const char*targ;
|
||||
|
||||
/* This is the language generation flag. */
|
||||
extern const char*generation;
|
||||
|
||||
/* Perform variable substitutions on the string. */
|
||||
extern char* substitutions(const char*str);
|
||||
|
||||
|
|
@ -93,6 +81,9 @@ extern int build_string(char*out, size_t olen, const char*pattern);
|
|||
|
||||
/*
|
||||
* $Log: globals.h,v $
|
||||
* Revision 1.18 2003/11/13 04:09:49 steve
|
||||
* Pass flags through the temporary config file.
|
||||
*
|
||||
* Revision 1.17 2003/11/01 04:21:57 steve
|
||||
* Add support for a target static config 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.58 2003/11/01 04:21:57 steve Exp $"
|
||||
#ident "$Id: main.c,v 1.59 2003/11/13 04:09:49 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "config.h"
|
||||
|
|
@ -114,8 +114,6 @@ char*def_list = 0;
|
|||
char*mod_list = 0;
|
||||
char*command_filename = 0;
|
||||
|
||||
char*f_list = 0;
|
||||
|
||||
/* These are used to collect the list of file names that will be
|
||||
passed to ivlpp. Keep the list in a file because it can be a long
|
||||
list. */
|
||||
|
|
@ -477,17 +475,7 @@ int main(int argc, char **argv)
|
|||
case 'f':
|
||||
fprintf(stderr, "warning: The -f flag is moved to -p\n");
|
||||
case 'p':
|
||||
if (f_list == 0) {
|
||||
f_list = malloc(strlen(" -p")+strlen(optarg)+1);
|
||||
strcpy(f_list, " -p");
|
||||
strcat(f_list, optarg);
|
||||
} else {
|
||||
f_list = realloc(f_list, strlen(f_list) +
|
||||
strlen(" -p") +
|
||||
strlen(optarg) + 1);
|
||||
strcat(f_list, " -p");
|
||||
strcat(f_list, optarg);
|
||||
}
|
||||
fprintf(iconfig_file, "flag:%s\n", optarg);
|
||||
break;
|
||||
|
||||
case 'g':
|
||||
|
|
@ -715,6 +703,9 @@ int main(int argc, char **argv)
|
|||
|
||||
/*
|
||||
* $Log: main.c,v $
|
||||
* Revision 1.59 2003/11/13 04:09:49 steve
|
||||
* Pass flags through the temporary config file.
|
||||
*
|
||||
* Revision 1.58 2003/11/01 04:21:57 steve
|
||||
* Add support for a target static config file.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -31,8 +31,6 @@
|
|||
# %c Substitute the path to the installed config file.
|
||||
# %C Substitute the path to the temporary config file.
|
||||
#
|
||||
# %f Substitute the -f flags from the command line.
|
||||
#
|
||||
# %N Substitute the value of the -N<path> flag.
|
||||
#
|
||||
# %[<c><text>]
|
||||
|
|
@ -58,16 +56,16 @@
|
|||
# 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 %f -- -
|
||||
<ivl>%B/ivl %[v-v] -C%c -C%C %[N-N%N] -fDLL=%B/vvp.tgt -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 %f -- -
|
||||
<ivl>%B/ivl %[v-v] -C%c -C%C %[N-N%N] -fDLL=%B/vvp.tgt -fVVP_EXECUTABLE=%B/../../bin/vvp -- -
|
||||
|
||||
# This is the XNF code generator.
|
||||
|
||||
[-txnf]
|
||||
<ivl>%B/ivl -C%c -C%C %[v-v] %[N-N%N] -- -
|
||||
<ivl>%B/ivl %[v-v] -C%c -C%C %[N-N%N] -- -
|
||||
|
||||
# And this is another XNF code generator, under development.
|
||||
# And this is the FPGA synthesizer.
|
||||
[-tfpga]
|
||||
<ivl>%B/ivl -C%c -C%C %[v-v] %[N-N%N] %f -fDLL=%B/fpga.tgt -- -
|
||||
<ivl>%B/ivl %[v-v] -C%c -C%C %[N-N%N] -fDLL=%B/fpga.tgt -- -
|
||||
|
|
|
|||
46
main.cc
46
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.76 2003/11/13 03:10:38 steve Exp $"
|
||||
#ident "$Id: main.cc,v 1.77 2003/11/13 04:09:49 steve Exp $"
|
||||
#endif
|
||||
|
||||
# include "config.h"
|
||||
|
|
@ -180,6 +180,23 @@ static void process_generation_flag(const char*gen)
|
|||
generation_flag = GN_DEFAULT;
|
||||
}
|
||||
|
||||
static void parm_to_flagmap(const string&flag)
|
||||
{
|
||||
string key;
|
||||
const char*value;
|
||||
unsigned off = flag.find('=');
|
||||
if (off > flag.size()) {
|
||||
key = flag;
|
||||
value = "";
|
||||
|
||||
} else {
|
||||
key = flag.substr(0, off);
|
||||
value = strdup(flag.substr(off+1).c_str());
|
||||
}
|
||||
|
||||
flags[key] = value;
|
||||
}
|
||||
|
||||
/*
|
||||
* Read the contents of a config file. This file is a temporary
|
||||
* configuration file made by the compiler driver to carry the bulky
|
||||
|
|
@ -209,6 +226,9 @@ static void process_generation_flag(const char*gen)
|
|||
* depfile:<path>
|
||||
* Give the path to an output dependency file.
|
||||
*
|
||||
* flag:<name>=<string>
|
||||
* Generic compiler flag strings.
|
||||
*
|
||||
* functor:<name>
|
||||
* Append a named functor to the processing path.
|
||||
*
|
||||
|
|
@ -267,6 +287,10 @@ static void read_iconfig_file(const char*ipath)
|
|||
if (strcmp(buf, "depfile") == 0) {
|
||||
depfile_name = strdup(cp);
|
||||
|
||||
} else if (strcmp(buf, "flag") == 0) {
|
||||
string parm = cp;
|
||||
parm_to_flagmap(parm);
|
||||
|
||||
} else if (strcmp(buf,"functor") == 0) {
|
||||
net_func tmp = name_to_net_func(cp);
|
||||
if (tmp == 0) {
|
||||
|
|
@ -352,23 +376,6 @@ static void read_iconfig_file(const char*ipath)
|
|||
}
|
||||
}
|
||||
|
||||
static void parm_to_flagmap(const string&flag)
|
||||
{
|
||||
string key;
|
||||
const char*value;
|
||||
unsigned off = flag.find('=');
|
||||
if (off > flag.size()) {
|
||||
key = flag;
|
||||
value = "";
|
||||
|
||||
} else {
|
||||
key = flag.substr(0, off);
|
||||
value = strdup(flag.substr(off+1).c_str());
|
||||
}
|
||||
|
||||
flags[key] = value;
|
||||
}
|
||||
|
||||
extern Design* elaborate(list <const char*>root);
|
||||
|
||||
#if defined(HAVE_TIMES)
|
||||
|
|
@ -700,6 +707,9 @@ int main(int argc, char*argv[])
|
|||
|
||||
/*
|
||||
* $Log: main.cc,v $
|
||||
* Revision 1.77 2003/11/13 04:09:49 steve
|
||||
* Pass flags through the temporary config file.
|
||||
*
|
||||
* Revision 1.76 2003/11/13 03:10:38 steve
|
||||
* ivl -F and -t flags are onpassed throught the -C file.
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in New Issue