mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-25 01:55:33 +00:00
Merge pull request #1926 from YosysHQ/eddie/abc9_auto_dff
abc9: support seq synthesis when module has (* abc9_flop *) and bypass non-combinatorial (* abc9_box *)
This commit is contained in:
commit
2d573a0ff6
34 changed files with 1663 additions and 1860 deletions
|
@ -454,6 +454,14 @@ void AigerReader::parse_xaiger()
|
|||
for (unsigned i = 0; i < flopNum; i++)
|
||||
mergeability.emplace_back(parse_xaiger_literal(f));
|
||||
}
|
||||
else if (c == 's') {
|
||||
uint32_t dataSize YS_ATTRIBUTE(unused) = parse_xaiger_literal(f);
|
||||
flopNum = parse_xaiger_literal(f);
|
||||
log_assert(dataSize == (flopNum+1) * sizeof(uint32_t));
|
||||
initial_state.reserve(flopNum);
|
||||
for (unsigned i = 0; i < flopNum; i++)
|
||||
initial_state.emplace_back(parse_xaiger_literal(f));
|
||||
}
|
||||
else if (c == 'n') {
|
||||
parse_xaiger_literal(f);
|
||||
f >> s;
|
||||
|
@ -767,6 +775,7 @@ void AigerReader::post_process()
|
|||
}
|
||||
}
|
||||
|
||||
dict<int, Wire*> mergeability_to_clock;
|
||||
for (uint32_t i = 0; i < flopNum; i++) {
|
||||
RTLIL::Wire *d = outputs[outputs.size() - flopNum + i];
|
||||
log_assert(d);
|
||||
|
@ -778,10 +787,9 @@ void AigerReader::post_process()
|
|||
log_assert(q->port_input);
|
||||
q->port_input = false;
|
||||
|
||||
auto ff = module->addCell(NEW_ID, ID($__ABC9_FF_));
|
||||
ff->setPort(ID::D, d);
|
||||
ff->setPort(ID::Q, q);
|
||||
Cell* ff = module->addFfGate(NEW_ID, d, q);
|
||||
ff->attributes[ID::abc9_mergeability] = mergeability[i];
|
||||
q->attributes[ID::init] = initial_state[i];
|
||||
}
|
||||
|
||||
dict<RTLIL::IdString, std::pair<int,int>> wideports_cache;
|
||||
|
|
|
@ -45,7 +45,7 @@ struct AigerReader
|
|||
std::vector<RTLIL::Wire*> outputs;
|
||||
std::vector<RTLIL::Wire*> bad_properties;
|
||||
std::vector<RTLIL::Cell*> boxes;
|
||||
std::vector<int> mergeability;
|
||||
std::vector<int> mergeability, initial_state;
|
||||
|
||||
AigerReader(RTLIL::Design *design, std::istream &f, RTLIL::IdString module_name, RTLIL::IdString clk_name, std::string map_filename, bool wideports);
|
||||
void parse_aiger();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue