Merge pull request #3310 from robinsonb5-PRs/master
[yosys.git] / kernel / driver.cc
1 /*
2 * yosys -- Yosys Open SYnthesis Suite
3 *
4 * Copyright (C) 2012 Claire Xenia Wolf <claire@yosyshq.com>
5 *
6 * Permission to use, copy, modify, and/or distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
9 *
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 *
18 */
19
20 #include "kernel/yosys.h"
21 #include "libs/sha1/sha1.h"
22
23 #ifdef YOSYS_ENABLE_READLINE
24 # include <readline/readline.h>
25 # include <readline/history.h>
26 #endif
27
28 #ifdef YOSYS_ENABLE_EDITLINE
29 # include <editline/readline.h>
30 #endif
31
32 #include <stdio.h>
33 #include <string.h>
34 #include <limits.h>
35 #include <errno.h>
36
37 #if defined (__linux__) || defined(__FreeBSD__)
38 # include <sys/resource.h>
39 # include <sys/types.h>
40 # include <unistd.h>
41 #endif
42
43 #ifdef __FreeBSD__
44 # include <sys/sysctl.h>
45 # include <sys/user.h>
46 #endif
47
48 #if !defined(_WIN32) || defined(__MINGW32__)
49 # include <unistd.h>
50 #else
51 char *optarg;
52 int optind = 1, optcur = 1;
53 int getopt(int argc, char **argv, const char *optstring)
54 {
55 if (optind >= argc || argv[optind][0] != '-')
56 return -1;
57
58 bool takes_arg = false;
59 int opt = argv[optind][optcur];
60 for (int i = 0; optstring[i]; i++)
61 if (opt == optstring[i] && optstring[i + 1] == ':')
62 takes_arg = true;
63
64 if (!takes_arg) {
65 if (argv[optind][++optcur] == 0)
66 optind++, optcur = 1;
67 return opt;
68 }
69
70 if (argv[optind][++optcur]) {
71 optarg = argv[optind++] + optcur;
72 optcur = 1;
73 return opt;
74 }
75
76 optarg = argv[++optind];
77 optind++, optcur = 1;
78 return opt;
79 }
80 #endif
81
82
83 USING_YOSYS_NAMESPACE
84
85 #ifdef EMSCRIPTEN
86 # include <sys/stat.h>
87 # include <sys/types.h>
88 # include <emscripten.h>
89
90 extern "C" int main(int, char**);
91 extern "C" void run(const char*);
92 extern "C" const char *errmsg();
93 extern "C" const char *prompt();
94
95 int main(int argc, char **argv)
96 {
97 EM_ASM(
98 if (ENVIRONMENT_IS_NODE)
99 {
100 FS.mkdir('/hostcwd');
101 FS.mount(NODEFS, { root: '.' }, '/hostcwd');
102 FS.mkdir('/hostfs');
103 FS.mount(NODEFS, { root: '/' }, '/hostfs');
104 }
105 );
106
107 mkdir("/work", 0777);
108 chdir("/work");
109 log_files.push_back(stdout);
110 log_error_stderr = true;
111 yosys_banner();
112 yosys_setup();
113 #ifdef WITH_PYTHON
114 PyRun_SimpleString(("sys.path.append(\""+proc_self_dirname()+"\")").c_str());
115 PyRun_SimpleString(("sys.path.append(\""+proc_share_dirname()+"plugins\")").c_str());
116 #endif
117
118 if (argc == 2)
119 {
120 // Run the first argument as a script file
121 run_frontend(argv[1], "script");
122 }
123 }
124
125 void run(const char *command)
126 {
127 int selSize = GetSize(yosys_get_design()->selection_stack);
128 try {
129 log_last_error = "Internal error (see JavaScript console for details)";
130 run_pass(command);
131 log_last_error = "";
132 } catch (...) {
133 while (GetSize(yosys_get_design()->selection_stack) > selSize)
134 yosys_get_design()->selection_stack.pop_back();
135 throw;
136 }
137 }
138
139 const char *errmsg()
140 {
141 return log_last_error.c_str();
142 }
143
144 const char *prompt()
145 {
146 const char *p = create_prompt(yosys_get_design(), 0);
147 while (*p == '\n') p++;
148 return p;
149 }
150
151 #else /* EMSCRIPTEN */
152
153 #if defined(YOSYS_ENABLE_READLINE) || defined(YOSYS_ENABLE_EDITLINE)
154 int yosys_history_offset = 0;
155 std::string yosys_history_file;
156 #endif
157
158 #if defined(__wasm)
159 extern "C" {
160 // FIXME: WASI does not currently support exceptions.
161 void* __cxa_allocate_exception(size_t thrown_size) throw() {
162 return malloc(thrown_size);
163 }
164 bool __cxa_uncaught_exception() throw();
165 void __cxa_throw(void* thrown_exception, struct std::type_info * tinfo, void (*dest)(void*)) {
166 std::terminate();
167 }
168 }
169 #endif
170
171 void yosys_atexit()
172 {
173 #if defined(YOSYS_ENABLE_READLINE) || defined(YOSYS_ENABLE_EDITLINE)
174 if (!yosys_history_file.empty()) {
175 #if defined(YOSYS_ENABLE_READLINE)
176 if (yosys_history_offset > 0) {
177 history_truncate_file(yosys_history_file.c_str(), 100);
178 append_history(where_history() - yosys_history_offset, yosys_history_file.c_str());
179 } else
180 write_history(yosys_history_file.c_str());
181 #else
182 write_history(yosys_history_file.c_str());
183 #endif
184 }
185
186 clear_history();
187 #if defined(YOSYS_ENABLE_READLINE)
188 HIST_ENTRY **hist_list = history_list();
189 if (hist_list != NULL)
190 free(hist_list);
191 #endif
192 #endif
193 }
194
195 int main(int argc, char **argv)
196 {
197 std::string frontend_command = "auto";
198 std::string backend_command = "auto";
199 std::vector<std::string> vlog_defines;
200 std::vector<std::string> passes_commands;
201 std::vector<std::string> plugin_filenames;
202 std::string output_filename = "";
203 std::string scriptfile = "";
204 std::string depsfile = "";
205 std::string topmodule = "";
206 bool scriptfile_tcl = false;
207 bool print_banner = true;
208 bool print_stats = true;
209 bool call_abort = false;
210 bool timing_details = false;
211 bool run_shell = true;
212 bool mode_v = false;
213 bool mode_q = false;
214
215 #if defined(YOSYS_ENABLE_READLINE) || defined(YOSYS_ENABLE_EDITLINE)
216 if (getenv("HOME") != NULL) {
217 yosys_history_file = stringf("%s/.yosys_history", getenv("HOME"));
218 read_history(yosys_history_file.c_str());
219 yosys_history_offset = where_history();
220 }
221 #endif
222
223 if (argc == 2 && (!strcmp(argv[1], "-h") || !strcmp(argv[1], "-help") || !strcmp(argv[1], "--help")))
224 {
225 printf("\n");
226 printf("Usage: %s [options] [<infile> [..]]\n", argv[0]);
227 printf("\n");
228 printf(" -Q\n");
229 printf(" suppress printing of banner (copyright, disclaimer, version)\n");
230 printf("\n");
231 printf(" -T\n");
232 printf(" suppress printing of footer (log hash, version, timing statistics)\n");
233 printf("\n");
234 printf(" -q\n");
235 printf(" quiet operation. only write warnings and error messages to console\n");
236 printf(" use this option twice to also quiet warning messages\n");
237 printf("\n");
238 printf(" -v <level>\n");
239 printf(" print log headers up to level <level> to the console. (this\n");
240 printf(" implies -q for everything except the 'End of script.' message.)\n");
241 printf("\n");
242 printf(" -t\n");
243 printf(" annotate all log messages with a time stamp\n");
244 printf("\n");
245 printf(" -d\n");
246 printf(" print more detailed timing stats at exit\n");
247 printf("\n");
248 printf(" -l logfile\n");
249 printf(" write log messages to the specified file\n");
250 printf("\n");
251 printf(" -L logfile\n");
252 printf(" like -l but open log file in line buffered mode\n");
253 printf("\n");
254 printf(" -o outfile\n");
255 printf(" write the design to the specified file on exit\n");
256 printf("\n");
257 printf(" -b backend\n");
258 printf(" use this backend for the output file specified on the command line\n");
259 printf("\n");
260 printf(" -f frontend\n");
261 printf(" use the specified frontend for the input files on the command line\n");
262 printf("\n");
263 printf(" -H\n");
264 printf(" print the command list\n");
265 printf("\n");
266 printf(" -h command\n");
267 printf(" print the help message for the specified command\n");
268 printf("\n");
269 printf(" -s scriptfile\n");
270 printf(" execute the commands in the script file\n");
271 #ifdef YOSYS_ENABLE_TCL
272 printf("\n");
273 printf(" -c tcl_scriptfile\n");
274 printf(" execute the commands in the tcl script file (see 'help tcl' for details)\n");
275 #endif
276 printf("\n");
277 printf(" -p command\n");
278 printf(" execute the commands\n");
279 printf("\n");
280 printf(" -m module_file\n");
281 printf(" load the specified module (aka plugin)\n");
282 printf("\n");
283 printf(" -X\n");
284 printf(" enable tracing of core data structure changes. for debugging\n");
285 printf("\n");
286 printf(" -M\n");
287 printf(" will slightly randomize allocated pointer addresses. for debugging\n");
288 printf("\n");
289 printf(" -A\n");
290 printf(" will call abort() at the end of the script. for debugging\n");
291 printf("\n");
292 printf(" -r <module_name>\n");
293 printf(" elaborate command line arguments using the specified top module\n");
294 printf("\n");
295 printf(" -D <macro>[=<value>]\n");
296 printf(" set the specified Verilog define (via \"read -define\")\n");
297 printf("\n");
298 printf(" -P <header_id>[:<filename>]\n");
299 printf(" dump the design when printing the specified log header to a file.\n");
300 printf(" yosys_dump_<header_id>.il is used as filename if none is specified.\n");
301 printf(" Use 'ALL' as <header_id> to dump at every header.\n");
302 printf("\n");
303 printf(" -W regex\n");
304 printf(" print a warning for all log messages matching the regex.\n");
305 printf("\n");
306 printf(" -w regex\n");
307 printf(" if a warning message matches the regex, it is printed as regular\n");
308 printf(" message instead.\n");
309 printf("\n");
310 printf(" -e regex\n");
311 printf(" if a warning message matches the regex, it is printed as error\n");
312 printf(" message instead and the tool terminates with a nonzero return code.\n");
313 printf("\n");
314 printf(" -E <depsfile>\n");
315 printf(" write a Makefile dependencies file with in- and output file names\n");
316 printf("\n");
317 printf(" -x <feature>\n");
318 printf(" do not print warnings for the specified experimental feature\n");
319 printf("\n");
320 printf(" -g\n");
321 printf(" globally enable debug log messages\n");
322 printf("\n");
323 printf(" -V\n");
324 printf(" print version information and exit\n");
325 printf("\n");
326 printf("The option -S is an shortcut for calling the \"synth\" command, a default\n");
327 printf("script for transforming the Verilog input to a gate-level netlist. For example:\n");
328 printf("\n");
329 printf(" yosys -o output.blif -S input.v\n");
330 printf("\n");
331 printf("For more complex synthesis jobs it is recommended to use the read_* and write_*\n");
332 printf("commands in a script file instead of specifying input and output files on the\n");
333 printf("command line.\n");
334 printf("\n");
335 printf("When no commands, script files or input files are specified on the command\n");
336 printf("line, yosys automatically enters the interactive command mode. Use the 'help'\n");
337 printf("command to get information on the individual commands.\n");
338 printf("\n");
339 exit(0);
340 }
341
342 if (argc == 2 && (!strcmp(argv[1], "-V") || !strcmp(argv[1], "-version") || !strcmp(argv[1], "--version")))
343 {
344 printf("%s\n", yosys_version_str);
345 exit(0);
346 }
347
348 int opt;
349 while ((opt = getopt(argc, argv, "MXAQTVSgm:f:Hh:b:o:p:l:L:qv:tds:c:W:w:e:r:D:P:E:x:")) != -1)
350 {
351 switch (opt)
352 {
353 case 'M':
354 memhasher_on();
355 break;
356 case 'X':
357 yosys_xtrace++;
358 break;
359 case 'A':
360 call_abort = true;
361 break;
362 case 'Q':
363 print_banner = false;
364 break;
365 case 'T':
366 print_stats = false;
367 break;
368 case 'V':
369 printf("%s\n", yosys_version_str);
370 exit(0);
371 case 'S':
372 passes_commands.push_back("synth");
373 run_shell = false;
374 break;
375 case 'g':
376 log_force_debug++;
377 break;
378 case 'm':
379 plugin_filenames.push_back(optarg);
380 break;
381 case 'f':
382 frontend_command = optarg;
383 break;
384 case 'H':
385 passes_commands.push_back("help");
386 run_shell = false;
387 break;
388 case 'h':
389 passes_commands.push_back(stringf("help %s", optarg));
390 run_shell = false;
391 break;
392 case 'b':
393 backend_command = optarg;
394 run_shell = false;
395 break;
396 case 'p':
397 passes_commands.push_back(optarg);
398 run_shell = false;
399 break;
400 case 'o':
401 output_filename = optarg;
402 run_shell = false;
403 break;
404 case 'l':
405 case 'L':
406 log_files.push_back(fopen(optarg, "wt"));
407 if (log_files.back() == NULL) {
408 fprintf(stderr, "Can't open log file `%s' for writing!\n", optarg);
409 exit(1);
410 }
411 if (opt == 'L')
412 setvbuf(log_files.back(), NULL, _IOLBF, 0);
413 break;
414 case 'q':
415 mode_q = true;
416 if (log_errfile == stderr)
417 log_quiet_warnings = true;
418 log_errfile = stderr;
419 break;
420 case 'v':
421 mode_v = true;
422 log_errfile = stderr;
423 log_verbose_level = atoi(optarg);
424 break;
425 case 't':
426 log_time = true;
427 break;
428 case 'd':
429 timing_details = true;
430 break;
431 case 's':
432 scriptfile = optarg;
433 scriptfile_tcl = false;
434 run_shell = false;
435 break;
436 case 'c':
437 scriptfile = optarg;
438 scriptfile_tcl = true;
439 run_shell = false;
440 break;
441 case 'W':
442 log_warn_regexes.push_back(YS_REGEX_COMPILE(optarg));
443 break;
444 case 'w':
445 log_nowarn_regexes.push_back(YS_REGEX_COMPILE(optarg));
446 break;
447 case 'e':
448 log_werror_regexes.push_back(YS_REGEX_COMPILE(optarg));
449 break;
450 case 'r':
451 topmodule = optarg;
452 break;
453 case 'D':
454 vlog_defines.push_back(optarg);
455 break;
456 case 'P':
457 {
458 auto args = split_tokens(optarg, ":");
459 if (!args.empty() && args[0] == "ALL") {
460 if (GetSize(args) != 1) {
461 fprintf(stderr, "Invalid number of tokens in -D ALL.\n");
462 exit(1);
463 }
464 log_hdump_all = true;
465 } else {
466 if (!args.empty() && !args[0].empty() && args[0].back() == '.')
467 args[0].pop_back();
468 if (GetSize(args) == 1)
469 args.push_back("yosys_dump_" + args[0] + ".il");
470 if (GetSize(args) != 2) {
471 fprintf(stderr, "Invalid number of tokens in -D.\n");
472 exit(1);
473 }
474 log_hdump[args[0]].insert(args[1]);
475 }
476 }
477 break;
478 case 'E':
479 depsfile = optarg;
480 break;
481 case 'x':
482 log_experimentals_ignored.insert(optarg);
483 break;
484 default:
485 fprintf(stderr, "Run '%s -h' for help.\n", argv[0]);
486 exit(1);
487 }
488 }
489
490 if (log_errfile == NULL) {
491 log_files.push_back(stdout);
492 log_error_stderr = true;
493 }
494
495 if (print_banner)
496 yosys_banner();
497
498 if (print_stats)
499 log_hasher = new SHA1;
500
501 #if defined(__linux__)
502 // set stack size to >= 128 MB
503 {
504 struct rlimit rl;
505 const rlim_t stack_size = 128L * 1024L * 1024L;
506 if (getrlimit(RLIMIT_STACK, &rl) == 0 && rl.rlim_cur < stack_size) {
507 rl.rlim_cur = stack_size;
508 setrlimit(RLIMIT_STACK, &rl);
509 }
510 }
511 #endif
512
513 yosys_setup();
514 #ifdef WITH_PYTHON
515 PyRun_SimpleString(("sys.path.append(\""+proc_self_dirname()+"\")").c_str());
516 PyRun_SimpleString(("sys.path.append(\""+proc_share_dirname()+"plugins\")").c_str());
517 #endif
518 log_error_atexit = yosys_atexit;
519
520 for (auto &fn : plugin_filenames)
521 load_plugin(fn, {});
522
523 if (!vlog_defines.empty()) {
524 std::string vdef_cmd = "read -define";
525 for (auto vdef : vlog_defines)
526 vdef_cmd += " " + vdef;
527 run_pass(vdef_cmd);
528 }
529
530 while (optind < argc)
531 if (run_frontend(argv[optind++], frontend_command))
532 run_shell = false;
533
534 if (!topmodule.empty())
535 run_pass("hierarchy -top " + topmodule);
536
537 if (!scriptfile.empty()) {
538 if (scriptfile_tcl) {
539 #ifdef YOSYS_ENABLE_TCL
540 if (Tcl_EvalFile(yosys_get_tcl_interp(), scriptfile.c_str()) != TCL_OK)
541 log_error("TCL interpreter returned an error: %s\n", Tcl_GetStringResult(yosys_get_tcl_interp()));
542 #else
543 log_error("Can't exectue TCL script: this version of yosys is not built with TCL support enabled.\n");
544 #endif
545 } else
546 run_frontend(scriptfile, "script");
547 }
548
549 for (auto it = passes_commands.begin(); it != passes_commands.end(); it++)
550 run_pass(*it);
551
552 if (run_shell)
553 shell(yosys_design);
554 else
555 run_backend(output_filename, backend_command);
556
557 yosys_design->check();
558 for (auto it : saved_designs)
559 it.second->check();
560 for (auto it : pushed_designs)
561 it->check();
562
563 if (!depsfile.empty())
564 {
565 FILE *f = fopen(depsfile.c_str(), "wt");
566 if (f == nullptr)
567 log_error("Can't open dependencies file for writing: %s\n", strerror(errno));
568 bool first = true;
569 for (auto fn : yosys_output_files) {
570 fprintf(f, "%s%s", first ? "" : " ", escape_filename_spaces(fn).c_str());
571 first = false;
572 }
573 fprintf(f, ":");
574 for (auto fn : yosys_input_files) {
575 if (yosys_output_files.count(fn) == 0)
576 fprintf(f, " %s", escape_filename_spaces(fn).c_str());
577 }
578 fprintf(f, "\n");
579 }
580
581 if (log_expect_no_warnings && log_warnings_count_noexpect)
582 log_error("Unexpected warnings found: %d unique messages, %d total, %d expected\n", GetSize(log_warnings),
583 log_warnings_count, log_warnings_count - log_warnings_count_noexpect);
584
585 if (print_stats)
586 {
587 std::string hash = log_hasher->final().substr(0, 10);
588 delete log_hasher;
589 log_hasher = nullptr;
590
591 log_time = false;
592 yosys_xtrace = 0;
593 log_spacer();
594
595 if (mode_v && !mode_q)
596 log_files.push_back(stderr);
597
598 if (log_warnings_count)
599 log("Warnings: %d unique messages, %d total\n", GetSize(log_warnings), log_warnings_count);
600
601 if (!log_experimentals.empty())
602 log("Warnings: %d experimental features used (not excluded with -x).\n", GetSize(log_experimentals));
603
604 #ifdef _WIN32
605 log("End of script. Logfile hash: %s\n", hash.c_str());
606 #else
607 std::string meminfo;
608 std::string stats_divider = ", ";
609
610 struct rusage ru_buffer;
611 getrusage(RUSAGE_SELF, &ru_buffer);
612 if (yosys_design->scratchpad_get_bool("print_stats.include_children")) {
613 struct rusage ru_buffer_children;
614 getrusage(RUSAGE_CHILDREN, &ru_buffer_children);
615 ru_buffer.ru_utime.tv_sec += ru_buffer_children.ru_utime.tv_sec;
616 ru_buffer.ru_utime.tv_usec += ru_buffer_children.ru_utime.tv_usec;
617 ru_buffer.ru_stime.tv_sec += ru_buffer_children.ru_stime.tv_sec;
618 ru_buffer.ru_stime.tv_usec += ru_buffer_children.ru_stime.tv_usec;
619 #if defined(__linux__) || defined(__FreeBSD__)
620 ru_buffer.ru_maxrss = std::max(ru_buffer.ru_maxrss, ru_buffer_children.ru_maxrss);
621 #endif
622 }
623 #if defined(__linux__) || defined(__FreeBSD__)
624 meminfo = stringf(", MEM: %.2f MB peak",
625 ru_buffer.ru_maxrss / 1024.0);
626 #endif
627 log("End of script. Logfile hash: %s%sCPU: user %.2fs system %.2fs%s\n", hash.c_str(),
628 stats_divider.c_str(), ru_buffer.ru_utime.tv_sec + 1e-6 * ru_buffer.ru_utime.tv_usec,
629 ru_buffer.ru_stime.tv_sec + 1e-6 * ru_buffer.ru_stime.tv_usec, meminfo.c_str());
630 #endif
631 log("%s\n", yosys_version_str);
632
633 int64_t total_ns = 0;
634 std::set<tuple<int64_t, int, std::string>> timedat;
635
636 for (auto &it : pass_register)
637 if (it.second->call_counter) {
638 total_ns += it.second->runtime_ns + 1;
639 timedat.insert(make_tuple(it.second->runtime_ns + 1, it.second->call_counter, it.first));
640 }
641
642 if (timing_details)
643 {
644 log("Time spent:\n");
645 for (auto it = timedat.rbegin(); it != timedat.rend(); it++) {
646 log("%5d%% %5d calls %8.3f sec %s\n", int(100*std::get<0>(*it) / total_ns),
647 std::get<1>(*it), std::get<0>(*it) / 1000000000.0, std::get<2>(*it).c_str());
648 }
649 }
650 else
651 {
652 int out_count = 0;
653 log("Time spent:");
654 for (auto it = timedat.rbegin(); it != timedat.rend() && out_count < 4; it++, out_count++) {
655 if (out_count >= 2 && (std::get<0>(*it) < 1000000000 || int(100*std::get<0>(*it) / total_ns) < 20)) {
656 log(", ...");
657 break;
658 }
659 log("%s %d%% %dx %s (%d sec)", out_count ? "," : "", int(100*std::get<0>(*it) / total_ns),
660 std::get<1>(*it), std::get<2>(*it).c_str(), int(std::get<0>(*it) / 1000000000));
661 }
662 log("%s\n", out_count ? "" : " no commands executed");
663 }
664 }
665
666 #if defined(YOSYS_ENABLE_COVER) && (defined(__linux__) || defined(__FreeBSD__))
667 if (getenv("YOSYS_COVER_DIR") || getenv("YOSYS_COVER_FILE"))
668 {
669 string filename;
670 FILE *f;
671
672 if (getenv("YOSYS_COVER_DIR")) {
673 filename = stringf("%s/yosys_cover_%d_XXXXXX.txt", getenv("YOSYS_COVER_DIR"), getpid());
674 filename = make_temp_file(filename);
675 } else {
676 filename = getenv("YOSYS_COVER_FILE");
677 }
678
679 f = fopen(filename.c_str(), "a+");
680
681 if (f == NULL)
682 log_error("Can't create coverage file `%s'.\n", filename.c_str());
683
684 log("<writing coverage file \"%s\">\n", filename.c_str());
685
686 for (auto &it : get_coverage_data())
687 fprintf(f, "%-60s %10d %s\n", it.second.first.c_str(), it.second.second, it.first.c_str());
688
689 fclose(f);
690 }
691 #endif
692
693 log_check_expected();
694
695 yosys_atexit();
696
697 memhasher_off();
698 if (call_abort)
699 abort();
700
701 log_flush();
702 #if defined(_MSC_VER)
703 _exit(0);
704 #elif defined(_WIN32)
705 _Exit(0);
706 #endif
707
708 yosys_shutdown();
709
710 return 0;
711 }
712
713 #endif /* EMSCRIPTEN */
714