mirror of
https://github.com/YosysHQ/yosys
synced 2025-06-04 21:31:23 +00:00
Call abc9 with "&write -n", and parse_xaiger() to cope
This commit is contained in:
parent
c767525441
commit
ab667d3d47
2 changed files with 88 additions and 95 deletions
|
@ -376,19 +376,15 @@ void AigerReader::parse_xaiger(const dict<int,IdString> &box_lookup)
|
||||||
if (n0)
|
if (n0)
|
||||||
module->connect(n0, State::S0);
|
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.)
|
// Parse footer (symbol table, comments, etc.)
|
||||||
std::string s;
|
std::string s;
|
||||||
bool comment_seen = false;
|
for (int c = f.get(); c != EOF; c = f.get()) {
|
||||||
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);
|
|
||||||
// XAIGER extensions
|
// XAIGER extensions
|
||||||
if (c == 'm') {
|
if (c == 'm') {
|
||||||
uint32_t dataSize YS_ATTRIBUTE(unused) = parse_xaiger_literal(f);
|
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;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
log_error("Line %u: cannot interpret first character '%c'!\n", line_count, c);
|
|
||||||
}
|
|
||||||
|
|
||||||
post_process();
|
post_process();
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
"&st; &if -g -K 6; &synch2; &if {W} -v; &save; &load; "\
|
"&st; &if -g -K 6; &synch2; &if {W} -v; &save; &load; "\
|
||||||
"&mfs; &ps -l"
|
"&mfs; &ps -l"
|
||||||
#else
|
#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
|
#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))
|
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 = 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);
|
abc9_script = add_echos_to_abc9_cmd(abc9_script);
|
||||||
|
|
||||||
for (size_t i = 0; i+1 < abc9_script.size(); i++)
|
for (size_t i = 0; i+1 < abc9_script.size(); i++)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue