diff --git a/README.txt b/README.txt index 91d181311..e40743c85 100644 --- a/README.txt +++ b/README.txt @@ -8,13 +8,13 @@ forms, then passed to a code generator for final output. The processing steps and the code generator are selected by command line switches. -INVOKING +INVOKING ivl The vl command is the compiler driver, that invokes the parser, optimization functions and the code generator. -Usage: vl ... file - vl -h +Usage: ivl ... file + ivl -h -F Use this flag to request an optimization function be applied @@ -39,7 +39,7 @@ Usage: vl ... file -N Dump the elaborated netlist to the named file. The netlist is - the folly elaborated netlist, after all the function modules + the fully elaborated netlist, after all the function modules are applied and right before the output generator is called. This is an aid for debugging the compiler, and the output generator in particular. @@ -56,9 +56,9 @@ Usage: vl ... file the compiler. -s - Normally, vl will elaborate the only module in the source - file. If there are multiple modules, use this option to select - the module to be used as the top-level module. + Normally, vl will elaborate the only top-level module in the + source file. If there are multiple modules, use this option to + select the module to be used as the top-level module. -t Select the output format for the compiled result. Use the diff --git a/main.cc b/main.cc index 45b14d92a..4a70c0011 100644 --- a/main.cc +++ b/main.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) -#ident "$Id: main.cc,v 1.14 1999/04/23 04:34:32 steve Exp $" +#ident "$Id: main.cc,v 1.15 1999/05/05 03:27:15 steve Exp $" #endif # include @@ -181,15 +181,32 @@ int main(int argc, char*argv[]) } } + if (start_module == "") { + for (map::iterator mod = modules.begin() + ; mod != modules.end() + ; mod ++ ) { + Module*cur = (*mod).second; + if (cur->ports.size() == 0) + if (start_module == "") { + start_module = cur->get_name(); + } else { + cerr << "More then 1 top level module." + << endl; + return 1; + } + } + } /* Select a root module, and elaborate the design. */ if (start_module == "") { - start_module = "main"; + cerr << "No top level modules, and no -s option." << endl; + return 1; } Design*des = elaborate(modules, primitives, start_module); if (des == 0) { - cerr << "Unable to elaborate design." << endl; + cerr << "Unable to elaborate module " << start_module << + "." << endl; return 1; } if (des->errors) { @@ -232,6 +249,9 @@ int main(int argc, char*argv[]) /* * $Log: main.cc,v $ + * Revision 1.15 1999/05/05 03:27:15 steve + * More intelligent selection of module to elaborate. + * * Revision 1.14 1999/04/23 04:34:32 steve * Make debug output file parameters. * diff --git a/parse.y b/parse.y index 227f2fda0..5674dad85 100644 --- a/parse.y +++ b/parse.y @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) -#ident "$Id: parse.y,v 1.19 1999/05/01 02:57:53 steve Exp $" +#ident "$Id: parse.y,v 1.20 1999/05/05 03:27:15 steve Exp $" #endif # include "parse_misc.h" @@ -752,6 +752,8 @@ statement } | delay statement_opt { PDelayStatement*tmp = new PDelayStatement($1, $2); + tmp->set_file(@1.text); + tmp->set_lineno(@1.first_line); $$ = tmp; } | event_control statement_opt