diff --git a/driver/globals.h b/driver/globals.h index 9ad83fd2c..b9f63c0cb 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.5 2001/10/20 23:02:40 steve Exp $" +#ident "$Id: globals.h,v 1.6 2001/10/23 00:37:30 steve Exp $" #endif # include @@ -42,8 +42,8 @@ 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 pointer is set if there were -s parameters. */ +extern char*start; /* This flag is true if the -S flag was used on the command line. */ extern int synth_flag; @@ -65,6 +65,9 @@ extern int build_string(char*out, size_t olen, const char*pattern); /* * $Log: globals.h,v $ + * Revision 1.6 2001/10/23 00:37:30 steve + * The -s flag can now be repeated on the iverilog command. + * * Revision 1.5 2001/10/20 23:02:40 steve * Add automatic module libraries. * diff --git a/driver/iverilog.man b/driver/iverilog.man index 38a91d5f0..979c41f01 100644 --- a/driver/iverilog.man +++ b/driver/iverilog.man @@ -1,4 +1,4 @@ -.TH iverilog 1 "$Date: 2001/10/20 23:02:40 $" Version "$Date: 2001/10/20 23:02:40 $" +.TH iverilog 1 "$Date: 2001/10/23 00:37:30 $" Version "$Date: 2001/10/23 00:37:30 $" .SH NAME iverilog - Icarus Verilog compiler @@ -94,9 +94,10 @@ netlist format, the \fB-S\fP switch is unnecessary and has no effect. .TP 8 .B -s \fItopmodule\fP Specify the top level module to elaborate. Icarus Verilog will by default -choose the only module that has no ports. However, this simplistic -heuristic is often not sufficient, and sometimes not what is wanted -anyhow. +choose modules that are not instantiated in any other modules, but +sometimes that is not sufficient, or instantiates too many modules. If +the user specifies one or more root modules with \fB-s\fP flags, then +they will be used as root modules instead. .TP 8 .B -T\fImin|typ|max\fP Use this switch to select min, typ or max times from min:typ:max diff --git a/driver/main.c b/driver/main.c index 818ba66fa..d2b171f9f 100644 --- a/driver/main.c +++ b/driver/main.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#ident "$Id: main.c,v 1.24 2001/10/20 23:02:40 steve Exp $" +#ident "$Id: main.c,v 1.25 2001/10/23 00:37:30 steve Exp $" # include "config.h" @@ -84,7 +84,6 @@ const char*mtm = 0; const char*opath = "a.out" EXEEXT; const char*npath = 0; const char*targ = "vvp"; -const char*start = 0; char warning_flags[16] = ""; char *library_flags = 0; @@ -93,6 +92,7 @@ char*inc_list = 0; char*def_list = 0; char*mod_list = 0; char*command_filename = 0; +char*start = 0; char*f_list = 0; @@ -298,11 +298,9 @@ static int t_xnf(char*cmd, unsigned ncmd) } if (start) { - sprintf(tmp, " -s%s", start); - rc = strlen(tmp); - cmd = realloc(cmd, ncmd+rc+1); - strcpy(cmd+ncmd, tmp); - ncmd += rc; + cmd = realloc(cmd, ncmd+strlen(start)+1); + strcpy(cmd+ncmd, start); + ncmd += strlen(start); } sprintf(tmp, " -- -"); rc = strlen(tmp); @@ -488,7 +486,18 @@ int main(int argc, char **argv) synth_flag = 1; break; case 's': - start = optarg; + if (start) { + static const char *s = " -s "; + size_t l = strlen(start); + start = realloc(start, l + strlen(optarg) + strlen(s) + 1); + strcpy(start + l, s); + strcpy(start + l + strlen(s), optarg); + } else { + static const char *s = "-s "; + start = malloc(strlen(optarg) + strlen(s) + 1); + strcpy(start, s); + strcpy(start + strlen(s), optarg); + } break; case 'T': if (strcmp(optarg,"min") == 0) { @@ -661,6 +670,9 @@ int main(int argc, char **argv) /* * $Log: main.c,v $ + * Revision 1.25 2001/10/23 00:37:30 steve + * The -s flag can now be repeated on the iverilog command. + * * Revision 1.24 2001/10/20 23:02:40 steve * Add automatic module libraries. * diff --git a/iverilog.conf b/iverilog.conf index e30355e5e..0beec239d 100644 --- a/iverilog.conf +++ b/iverilog.conf @@ -58,20 +58,20 @@ # be useful and interesting if the -N flag is included. [-tnull -S] -%B/ivl %[v-v] %y %W %[s-s%s] %[N-N%N] %[T-T%T] -tdll -fDLL=%B/null.tgt -- - +%B/ivl %[v-v] %y %W %s %[N-N%N] %[T-T%T] -tdll -fDLL=%B/null.tgt -- - [-tnull] -%B/ivl %[v-v] %y %W %[s-s%s] %[N-N%N] %[T-T%T] -tdll -fDLL=%B/null.tgt -- - +%B/ivl %[v-v] %y %W %s %[N-N%N] %[T-T%T] -tdll -fDLL=%B/null.tgt -- - # -- # 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] %y %W %[s-s%s] %[N-N%N] %[T-T%T] -tdll -fDLL=%B/vvp.tgt -fVVP_EXECUTABLE=%B/../../bin/vvp -Fsynth -Fsyn-rules -Fcprop -Fnodangle %f %m -o%o -- - +%B/ivl %[v-v] %y %W %s %[N-N%N] %[T-T%T] -tdll -fDLL=%B/vvp.tgt -fVVP_EXECUTABLE=%B/../../bin/vvp -Fsynth -Fsyn-rules -Fcprop -Fnodangle %f %m -o%o -- - [-tvvp] -%B/ivl %[v-v] %y %W %[s-s%s] %[N-N%N] %[T-T%T] -tdll -fDLL=%B/vvp.tgt -fVVP_EXECUTABLE=%B/../../bin/vvp -Fcprop -Fnodangle %f %m -o%o -- - +%B/ivl %[v-v] %y %W %s %[N-N%N] %[T-T%T] -tdll -fDLL=%B/vvp.tgt -fVVP_EXECUTABLE=%B/../../bin/vvp -Fcprop -Fnodangle %f %m -o%o -- - # -- # The vvm target uses the string to take the preprocessed code from @@ -80,20 +80,20 @@ # on the result. [-tvvm] -%B/ivl %[v-v] %y %W %[s-s%s] %[N-N%N] %[T-T%T] -tvvm -Fcprop -Fnodangle -fVPI_MODULE_PATH=%B %f %m -o%o.cc -- - +%B/ivl %[v-v] %y %W %s %[N-N%N] %[T-T%T] -tvvm -Fcprop -Fnodangle -fVPI_MODULE_PATH=%B %f %m -o%o.cc -- - # This is the XNF code generator. [-txnf] -%B/ivl %y %[v-v] %[s-s%s] %[N-N%N] %[T-T%T] -txnf -Fsynth -Fsyn-rules -Fcprop -Fnodangle -o%o -- - +%B/ivl %y %[v-v] %s %[N-N%N] %[T-T%T] -txnf -Fsynth -Fsyn-rules -Fcprop -Fnodangle -o%o -- - # And this is another XNF code generator, under development. [-tfpga] -%B/ivl %y %[v-v] %[s-s%s] %[N-N%N] %[T-T%T] %f -tdll -fDLL=%B/fpga.tgt -Fsynth -Fsyn-rules -Fcprop -Fnodangle -o%o -- - +%B/ivl %y %[v-v] %s %[N-N%N] %[T-T%T] %f -tdll -fDLL=%B/fpga.tgt -Fsynth -Fsyn-rules -Fcprop -Fnodangle -o%o -- - # -- # This is the pal code generator. The target module requires the -fpart= # flag to specify the part type. [-tpal] -%B/ivl %y %[v-v] %[s-s%s] %[N-N%N] %[T-T%T] -tdll -fDLL=%B/pal.tgt -Fsynth -Fsyn-rules -Fcprop -Fnodangle -o%o -- - +%B/ivl %y %[v-v] %s %[N-N%N] %[T-T%T] -tdll -fDLL=%B/pal.tgt -Fsynth -Fsyn-rules -Fcprop -Fnodangle -o%o -- -