@@ -33,7 +33,7 @@ void UhdmCommonFrontend::print_read_options()
3333 log (" ignore assert() statements" );
3434 log (" \n " );
3535 log (" -debug\n " );
36- log (" alias for -dump_ast1 -dump_ast2 -dump_vlog1 -dump_vlog2 -yydebug \n " );
36+ log (" alias for -dump_ast1 -dump_ast2 -dump_vlog1 -dump_vlog2\n " );
3737 log (" \n " );
3838 log (" -dump_ast1\n " );
3939 log (" dump abstract syntax tree (before simplification)\n " );
@@ -53,16 +53,17 @@ void UhdmCommonFrontend::print_read_options()
5353 log (" -dump_rtlil\n " );
5454 log (" dump generated RTLIL netlist\n " );
5555 log (" \n " );
56- log (" -yydebug\n " );
57- log (" enable parser debug output\n " );
58- log (" \n " );
5956 log (" -report [directory]\n " );
6057 log (" write a coverage report for the UHDM file\n " );
6158 log (" \n " );
6259 log (" -defer\n " );
6360 log (" only read the abstract syntax tree and defer actual compilation\n " );
6461 log (" to a later 'hierarchy' command. Useful in cases where the default\n " );
6562 log (" parameters of modules yield invalid or not synthesizable code.\n " );
63+ log (" Needs to be followed by read_systemverilog -link after reading\n " );
64+ log (" all files.\n " );
65+ log (" -link\n " );
66+ log (" performs linking and elaboration of the files read with -defer\n " );
6667 log (" -parse-only\n " );
6768 log (" this parameter only applies to read_systemverilog command,\n " );
6869 log (" it runs only Surelog to parse design, but doesn't load generated\n " );
@@ -97,7 +98,7 @@ void UhdmCommonFrontend::execute(std::istream *&f, std::string filename, std::ve
9798 } else if (args[i] == " -noassert" ) {
9899 this ->shared .no_assert = true ;
99100 } else if (args[i] == " -defer" ) {
100- defer = true ;
101+ this -> shared . defer = true ;
101102 } else if (args[i] == " -dump_ast1" ) {
102103 dump_ast1 = true ;
103104 } else if (args[i] == " -dump_ast2" ) {
@@ -110,15 +111,20 @@ void UhdmCommonFrontend::execute(std::istream *&f, std::string filename, std::ve
110111 no_dump_ptr = true ;
111112 } else if (args[i] == " -dump_rtlil" ) {
112113 dump_rtlil = true ;
113- } else if (args[i] == " -yydebug" ) {
114- this ->shared .debug_flag = true ;
115114 } else if (args[i] == " -parse-only" ) {
116115 this ->shared .parse_only = true ;
116+ } else if (args[i] == " -link" ) {
117+ this ->shared .link = true ;
118+ // Surelog needs it in the command line to link correctly
119+ unhandled_args.push_back (args[i]);
117120 } else {
118121 unhandled_args.push_back (args[i]);
119122 }
120123 }
121- extra_args (f, filename, args, args.size () - 1 );
124+ // Yosys gets confused when extra_args are passed with -link or no option
125+ // It's done fully by Surelog, so skip it in this case
126+ if (!this ->shared .link )
127+ extra_args (f, filename, args, args.size () - 1 );
122128 // pass only unhandled args to Surelog
123129 // unhandled args starts with command name,
124130 // but Surelog expects args[0] to be program name
0 commit comments