aboutsummaryrefslogtreecommitdiffstats
path: root/frontends/aiger
diff options
context:
space:
mode:
authorEddie Hung <eddie@fpgeh.com>2020-01-22 14:21:25 -0800
committerEddie Hung <eddie@fpgeh.com>2020-01-22 14:21:25 -0800
commit73526a6f103c927dd0d1504281659a87e7943688 (patch)
tree9e31df52a84af2d20ca5d4bb7b4f436557d7b1f9 /frontends/aiger
parent8eb5bb258c161d4d6cd5b00737dfc7622fdc7f69 (diff)
downloadyosys-73526a6f103c927dd0d1504281659a87e7943688.tar.gz
yosys-73526a6f103c927dd0d1504281659a87e7943688.tar.bz2
yosys-73526a6f103c927dd0d1504281659a87e7943688.zip
read_aiger: also parse abc9_mergeability
Diffstat (limited to 'frontends/aiger')
-rw-r--r--frontends/aiger/aigerparse.cc7
-rw-r--r--frontends/aiger/aigerparse.h1
2 files changed, 6 insertions, 2 deletions
diff --git a/frontends/aiger/aigerparse.cc b/frontends/aiger/aigerparse.cc
index e7478c316..b9c648afd 100644
--- a/frontends/aiger/aigerparse.cc
+++ b/frontends/aiger/aigerparse.cc
@@ -442,11 +442,13 @@ void AigerReader::parse_xaiger()
}
}
else if (c == 'r') {
- uint32_t dataSize YS_ATTRIBUTE(unused) = parse_xaiger_literal(f);
+ uint32_t dataSize = parse_xaiger_literal(f);
flopNum = parse_xaiger_literal(f);
log_debug("flopNum = %u\n", flopNum);
log_assert(dataSize == (flopNum+1) * sizeof(uint32_t));
- f.ignore(flopNum * sizeof(uint32_t));
+ mergeability.reserve(flopNum);
+ for (unsigned i = 0; i < flopNum; i++)
+ mergeability.emplace_back(parse_xaiger_literal(f));
}
else if (c == 'n') {
parse_xaiger_literal(f);
@@ -774,6 +776,7 @@ void AigerReader::post_process()
auto ff = module->addCell(NEW_ID, "$__ABC9_FF_");
ff->setPort("\\D", d);
ff->setPort("\\Q", q);
+ ff->attributes["\\abc9_mergeability"] = mergeability[i];
}
dict<RTLIL::IdString, int> wideports_cache;
diff --git a/frontends/aiger/aigerparse.h b/frontends/aiger/aigerparse.h
index 722f1e472..46ac81212 100644
--- a/frontends/aiger/aigerparse.h
+++ b/frontends/aiger/aigerparse.h
@@ -45,6 +45,7 @@ struct AigerReader
std::vector<RTLIL::Wire*> outputs;
std::vector<RTLIL::Wire*> bad_properties;
std::vector<RTLIL::Cell*> boxes;
+ std::vector<int> mergeability;
AigerReader(RTLIL::Design *design, std::istream &f, RTLIL::IdString module_name, RTLIL::IdString clk_name, std::string map_filename, bool wideports);
void parse_aiger();