diff options
author | Clifford Wolf <clifford@clifford.at> | 2014-02-13 18:56:36 +0100 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2014-02-13 18:56:36 +0100 |
commit | a1239416185aebca03d131dc3ebe3e3d45c5a9f3 (patch) | |
tree | 62840db7b318c90f175acfda0e365202aa040165 /passes/abc | |
parent | cd9e8741a71502c303c6f25d02bb2259a7dd7ff3 (diff) | |
download | yosys-a1239416185aebca03d131dc3ebe3e3d45c5a9f3.tar.gz yosys-a1239416185aebca03d131dc3ebe3e3d45c5a9f3.tar.bz2 yosys-a1239416185aebca03d131dc3ebe3e3d45c5a9f3.zip |
Updated ABC
Diffstat (limited to 'passes/abc')
-rw-r--r-- | passes/abc/abc.cc | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/passes/abc/abc.cc b/passes/abc/abc.cc index dae3a22fc..eaecb7910 100644 --- a/passes/abc/abc.cc +++ b/passes/abc/abc.cc @@ -640,9 +640,32 @@ static void abc_module(RTLIL::Design *design, RTLIL::Module *current_module, std f = popen(buffer.c_str(), "r"); if (f == NULL) log_error("Opening pipe to `%s' for reading failed: %s\n", buffer.c_str(), strerror(errno)); +#if 0 char logbuf[1024]; while (fgets(logbuf, 1024, f) != NULL) log("ABC: %s", logbuf); +#else + bool got_cr = false; + std::string linebuf; + char logbuf[1024]; + while (fgets(logbuf, 1024, f) != NULL) + for (char *p = logbuf; *p; p++) { + if (*p == '\r') { + got_cr = true; + continue; + } + if (*p == '\n') { + log("ABC: %s\n", linebuf.c_str()); + got_cr = false, linebuf.clear(); + continue; + } + if (got_cr) + got_cr = false, linebuf.clear(); + linebuf += *p; + } + if (!linebuf.empty()) + log("ABC: %s\n", linebuf.c_str()); +#endif errno = 0; int ret = pclose(f); if (ret < 0) |