From a96fa80ccc4cac108903932d949c956d6b6927b5 Mon Sep 17 00:00:00 2001 From: steve Date: Wed, 17 May 2000 03:53:29 +0000 Subject: [PATCH] Add the module option to iverilog. --- iverilog.c | 28 ++++++++++++++++++++++++++-- iverilog.man | 5 +++-- 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/iverilog.c b/iverilog.c index 2a04876c5..8af16aa80 100644 --- a/iverilog.c +++ b/iverilog.c @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) -#ident "$Id: iverilog.c,v 1.14 2000/05/14 19:41:52 steve Exp $" +#ident "$Id: iverilog.c,v 1.15 2000/05/17 03:53:29 steve Exp $" #endif #include @@ -38,6 +38,7 @@ char warning_flags[16] = ""; char*inc_list = 0; char*def_list = 0; +char*mod_list = 0; char*f_list = 0; @@ -110,6 +111,13 @@ static int t_vvm(char*cmd, unsigned ncmd) ncmd += rc; } + if (mod_list) { + rc = strlen(mod_list); + cmd = realloc(cmd, ncmd+rc+1); + strcpy(cmd+ncmd, mod_list); + ncmd += rc; + } + if (start) { sprintf(tmp, " -s%s", start); rc = strlen(tmp); @@ -213,7 +221,7 @@ int main(int argc, char **argv) int opt, idx; char*cp; - while ((opt = getopt(argc, argv, "B:D:Ef:I:o:Ss:t:vW:")) != EOF) { + while ((opt = getopt(argc, argv, "B:D:Ef:I:m:o:Ss:t:vW:")) != EOF) { switch (opt) { case 'B': @@ -261,6 +269,19 @@ int main(int argc, char **argv) strcat(inc_list, optarg); } break; + case 'm': + if (mod_list == 0) { + mod_list = malloc(strlen(" -m")+strlen(optarg)+1); + strcpy(mod_list, " -m"); + strcat(mod_list, optarg); + } else { + mod_list = realloc(mod_list, strlen(mod_list) + + strlen(" -m") + + strlen(optarg) + 1); + strcat(mod_list, " -m"); + strcat(mod_list, optarg); + } + break; case 'o': opath = optarg; break; @@ -355,6 +376,9 @@ int main(int argc, char **argv) /* * $Log: iverilog.c,v $ + * Revision 1.15 2000/05/17 03:53:29 steve + * Add the module option to iverilog. + * * Revision 1.14 2000/05/14 19:41:52 steve * Fix -f flag handling. * diff --git a/iverilog.man b/iverilog.man index 899f7a2ff..f6ebeffa1 100644 --- a/iverilog.man +++ b/iverilog.man @@ -1,4 +1,4 @@ -.TH iverilog 1 "$Date: 2000/05/05 01:07:42 $" Version "$Date: 2000/05/05 01:07:42 $" +.TH iverilog 1 "$Date: 2000/05/17 03:53:29 $" Version "$Date: 2000/05/17 03:53:29 $" .SH NAME iverilog - Icarus Verilog compiler @@ -53,7 +53,8 @@ in the order they appear on the command line. .TP 8 .B -m\fImodule\fP Add this module to the list of VPI modules to be loaded by the -simulation. (NOT IMPLEMENTED) +simulation. Many modules can be specified, and all will be loaded, in +the order specified. .TP 8 .B -o \fIfilename\fP Place output in the file \fIfilename\fP. If no output file name is