3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-06-03 04:41:22 +00:00

Call abc9 with "&write -n", and parse_xaiger() to cope

This commit is contained in:
Eddie Hung 2019-12-06 16:35:57 -08:00
parent c767525441
commit ab667d3d47
2 changed files with 88 additions and 95 deletions

View file

@ -376,19 +376,15 @@ void AigerReader::parse_xaiger(const dict<int,IdString> &box_lookup)
if (n0)
module->connect(n0, State::S0);
int c = f.get();
if (c != 'c')
log_error("Line %u: cannot interpret first character '%c'!\n", line_count, c);
c = f.get();
log_assert(c == '\n');
// Parse footer (symbol table, comments, etc.)
std::string s;
bool comment_seen = false;
for (int c = f.peek(); c != EOF; c = f.peek()) {
if (comment_seen || c == 'c') {
if (!comment_seen) {
f.ignore(1);
c = f.peek();
comment_seen = true;
}
if (c == '\n')
break;
f.ignore(1);
for (int c = f.get(); c != EOF; c = f.get()) {
// XAIGER extensions
if (c == 'm') {
uint32_t dataSize YS_ATTRIBUTE(unused) = parse_xaiger_literal(f);
@ -473,9 +469,6 @@ void AigerReader::parse_xaiger(const dict<int,IdString> &box_lookup)
break;
}
}
else
log_error("Line %u: cannot interpret first character '%c'!\n", line_count, c);
}
post_process();
}

View file

@ -30,7 +30,7 @@
"&st; &if -g -K 6; &synch2; &if {W} -v; &save; &load; "\
"&mfs; &ps -l"
#else
#define ABC_COMMAND_LUT "&st; &scorr; &sweep; &dc2; &st; &dch -f; &ps; &if {W} {D} -v; &mfs; &ps -l"
#define ABC_COMMAND_LUT "&st; &scorr; &sweep; &dc2; &st; &dch -f; &ps; &if {W} {D} -v; &mfs; &ps -l; &verify -s"
#endif
@ -311,7 +311,7 @@ void abc9_module(RTLIL::Design *design, RTLIL::Module *module, std::string scrip
for (size_t pos = abc9_script.find("&mfs"); pos != std::string::npos; pos = abc9_script.find("&mfs", pos))
abc9_script = abc9_script.erase(pos, strlen("&mfs"));
abc9_script += stringf("; &write %s/output.aig", tempdir_name.c_str());
abc9_script += stringf("; &write -n %s/output.aig", tempdir_name.c_str());
abc9_script = add_echos_to_abc9_cmd(abc9_script);
for (size_t i = 0; i+1 < abc9_script.size(); i++)