diff --git a/driver/build_string.c b/driver/build_string.c index 02ffca615..f3df6849e 100644 --- a/driver/build_string.c +++ b/driver/build_string.c @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) && !defined(macintosh) -#ident "$Id: build_string.c,v 1.1 2000/10/08 22:36:56 steve Exp $" +#ident "$Id: build_string.c,v 1.2 2000/10/28 03:45:47 steve Exp $" #endif # include "globals.h" @@ -41,11 +41,11 @@ int build_string(char*output, size_t olen, const char*pattern) *output++ = '%'; break; - case '?': { + case '[': { const char*tail; pattern += 1; assert(*pattern); - tail = strchr(pattern+1, ';'); + tail = strchr(pattern+1, ']'); assert(tail); strncpy(tmp_buf, pattern+1, tail-pattern-1); tmp_buf[tail-pattern-1] = 0; @@ -68,6 +68,22 @@ int build_string(char*output, size_t olen, const char*pattern) olen -= strlen(base); break; + case 'f': + if (f_list) { + strcpy(output, f_list); + output += strlen(f_list); + olen -= strlen(f_list); + } + break; + + case 'm': + if (mod_list) { + strcpy(output, mod_list); + output += strlen(mod_list); + olen -= strlen(mod_list); + } + break; + case 'N': if (npath) { strcpy(output, npath); @@ -76,6 +92,12 @@ int build_string(char*output, size_t olen, const char*pattern) } break; + case 'o': + strcpy(output, opath); + output += strlen(opath); + olen -= strlen(opath); + break; + case 's': if (start) { strcpy(output, start); @@ -97,6 +119,13 @@ int build_string(char*output, size_t olen, const char*pattern) output += strlen(targ); olen -= strlen(targ); break; + + case 'W': + strcpy(output, warning_flags); + output += strlen(warning_flags); + olen -= strlen(warning_flags); + break; + } pattern += 1; @@ -112,6 +141,9 @@ int build_string(char*output, size_t olen, const char*pattern) /* * $Log: build_string.c,v $ + * 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. * diff --git a/driver/globals.h b/driver/globals.h index 83b2a13d0..9e29bfb43 100644 --- a/driver/globals.h +++ b/driver/globals.h @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) && !defined(macintosh) -#ident "$Id: globals.h,v 1.1 2000/10/08 22:36:56 steve Exp $" +#ident "$Id: globals.h,v 1.2 2000/10/28 03:45:47 steve Exp $" #endif # include @@ -27,24 +27,38 @@ /* This is the base (i.e. -B) of the Icarus Verilog files. */ extern const char*base; + /* This is a list of all the -f= 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 -N value, if one was supplied. */ extern const char*npath; + /* This is the name of the output file that the user selected. */ +extern const char*opath; + /* This pointer is set if there was a -s parameter. */ extern const char*start; /* This is the name of the selected target. */ extern const char*targ; +extern char warning_flags[]; + extern const char*lookup_pattern(const char*key); extern int build_string(char*out, size_t olen, const char*pattern); /* * $Log: globals.h,v $ + * 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. * diff --git a/driver/main.c b/driver/main.c index 464e7bc5a..63be1cc88 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 */ #if !defined(WINNT) -#ident "$Id: main.c,v 1.2 2000/10/28 03:45:47 steve Exp $" +#ident "$Id: main.c,v 1.3 2000/10/28 03:47:25 steve Exp $" #endif #include @@ -117,7 +117,7 @@ static int t_vvm(char*cmd, unsigned ncmd) { int rc; - pattern = lookup_pattern(""); + const char*pattern = lookup_pattern(""); if (pattern == 0) { fprintf(stderr, "No such target: %s\n", targ); return -1; @@ -456,6 +456,9 @@ int main(int argc, char **argv) /* * $Log: main.c,v $ + * Revision 1.3 2000/10/28 03:47:25 steve + * Use the conf file to generate the vvm ivl string. + * * Revision 1.2 2000/10/28 03:45:47 steve * Use the conf file to generate the vvm ivl string. * diff --git a/iverilog.conf b/iverilog.conf index aa3c10c29..1c2f1735b 100644 --- a/iverilog.conf +++ b/iverilog.conf @@ -28,19 +28,27 @@ # # %B Substitute the base libdir, -B flag of iverilog. # +# %f Substitute the -f flags from the command line. +# # %s Substitute the start module (-s flag) from the user. # # %N Substitute the value of the -N flag. # +# %o Substitute the value of the -o flag, or the default +# output path if there is no -o flag. +# # %T Substitute min, typ or max depending on the -T flag from the # command line. # -# %?; +# +# %W Substitute the ivl warning flags. +# +# %[] # This substitution pattern is magical, and is the only # multicharacter pattern. This tests the code , and # substitutes into the output only if is true. # The may include further substitution strings, and is -# terminated by a semi-colon (;) character. +# terminated by a ``]'' character. # This is the null (no op) target. Thre is a synthesis version and a @@ -48,15 +56,25 @@ # be useful and interesting if the -N flag is included. [-tnull -S] -%B/ivl %?s-s%s; %?N-N%N; %?T-T%T; -tnull -- - +%B/ivl %W %[s-s%s] %[N-N%N] %[T-T%T] -tnull -- - [-tnull] -%B/ivl %?s-s%s; %?N-N%N; %?T-T%T; -tnull -- - +%B/ivl %W %[s-s%s] %[N-N%N] %[T-T%T] -tnull -- - + +# -- +# The vvm target uses the string to take the preprocessed code from +# standard input, compile it with the vvm code generator and write the +# result to %o.cc. The driver assumes this when invoking the C++ compiler +# on the result. + +[-tvvm] +%B/ivl %W %[s-s%s] %[N-N%N] %[T-T%T] -tvvm -Fcprop -Fnodangle -fVPI_MODULE_PATH=%B %f %m -o%o.cc -- - + # -- (not supported yet) # The string for the vvm target is the ivl command that takes as # standard input the output from the preprocessor and writes the result # into a .cc file named after the output file. -[-tvvm] -%B/ivl %?s-s%s; %?N-N%N; %?T-T%T; -tvvm -Fcprop -Fnodangle -fVPI_MODULE_PATH=%B -- - +[-txnf] +%B/ivl %[s-s%s] %[N-N%N] %[T-T%T] -tvvm -Fsynth -Fsyn-rules -Fcprop -Fnodangle -o%o -- -