mirror of
https://github.com/YosysHQ/yosys
synced 2025-06-19 04:13:39 +00:00
Merge branch 'xaig' into xc7mux
This commit is contained in:
commit
4e8f0fbce8
4 changed files with 9 additions and 21 deletions
|
@ -22,9 +22,6 @@
|
||||||
// Armin Biere. The AIGER And-Inverter Graph (AIG) Format Version 20071012. Technical Report 07/1, October 2011, FMV Reports Series, Institute for Formal Models and Verification, Johannes Kepler University, Altenbergerstr. 69, 4040 Linz, Austria.
|
// Armin Biere. The AIGER And-Inverter Graph (AIG) Format Version 20071012. Technical Report 07/1, October 2011, FMV Reports Series, Institute for Formal Models and Verification, Johannes Kepler University, Altenbergerstr. 69, 4040 Linz, Austria.
|
||||||
// http://fmv.jku.at/papers/Biere-FMV-TR-07-1.pdf
|
// http://fmv.jku.at/papers/Biere-FMV-TR-07-1.pdf
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
#include <libgen.h>
|
|
||||||
#endif
|
|
||||||
// https://stackoverflow.com/a/46137633
|
// https://stackoverflow.com/a/46137633
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
|
@ -1565,21 +1565,14 @@ void RTLIL::Module::remove(const pool<RTLIL::Wire*> &wires)
|
||||||
|
|
||||||
void RTLIL::Module::remove(RTLIL::Cell *cell)
|
void RTLIL::Module::remove(RTLIL::Cell *cell)
|
||||||
{
|
{
|
||||||
auto it = cells_.find(cell->name);
|
|
||||||
log_assert(it != cells_.end());
|
|
||||||
remove(it);
|
|
||||||
}
|
|
||||||
|
|
||||||
dict<RTLIL::IdString, RTLIL::Cell*>::iterator RTLIL::Module::remove(dict<RTLIL::IdString, RTLIL::Cell*>::iterator it)
|
|
||||||
{
|
|
||||||
RTLIL::Cell *cell = it->second;
|
|
||||||
while (!cell->connections_.empty())
|
while (!cell->connections_.empty())
|
||||||
cell->unsetPort(cell->connections_.begin()->first);
|
cell->unsetPort(cell->connections_.begin()->first);
|
||||||
|
|
||||||
|
auto it = cells_.find(cell->name);
|
||||||
|
log_assert(it != cells_.end());
|
||||||
log_assert(refcount_cells_ == 0);
|
log_assert(refcount_cells_ == 0);
|
||||||
it = cells_.erase(it);
|
cells_.erase(it);
|
||||||
delete cell;
|
delete cell;
|
||||||
return it;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void RTLIL::Module::rename(RTLIL::Wire *wire, RTLIL::IdString new_name)
|
void RTLIL::Module::rename(RTLIL::Wire *wire, RTLIL::IdString new_name)
|
||||||
|
|
|
@ -1040,7 +1040,6 @@ public:
|
||||||
// Removing wires is expensive. If you have to remove wires, remove them all at once.
|
// Removing wires is expensive. If you have to remove wires, remove them all at once.
|
||||||
void remove(const pool<RTLIL::Wire*> &wires);
|
void remove(const pool<RTLIL::Wire*> &wires);
|
||||||
void remove(RTLIL::Cell *cell);
|
void remove(RTLIL::Cell *cell);
|
||||||
dict<RTLIL::IdString, RTLIL::Cell*>::iterator remove(dict<RTLIL::IdString, RTLIL::Cell*>::iterator it);
|
|
||||||
|
|
||||||
void rename(RTLIL::Wire *wire, RTLIL::IdString new_name);
|
void rename(RTLIL::Wire *wire, RTLIL::IdString new_name);
|
||||||
void rename(RTLIL::Cell *cell, RTLIL::IdString new_name);
|
void rename(RTLIL::Cell *cell, RTLIL::IdString new_name);
|
||||||
|
|
|
@ -510,16 +510,15 @@ void abc9_module(RTLIL::Design *design, RTLIL::Module *current_module, std::stri
|
||||||
}
|
}
|
||||||
|
|
||||||
vector<RTLIL::Cell*> boxes;
|
vector<RTLIL::Cell*> boxes;
|
||||||
for (auto it = module->cells_.begin(); it != module->cells_.end(); ) {
|
for (auto it = module->cells_.begin(); it != module->cells_.end(); ++it) {
|
||||||
RTLIL::Cell *cell = it->second;
|
RTLIL::Cell *cell = it->second;
|
||||||
if (cell->type.in("$_AND_", "$_NOT_", "$__ABC_FF_")) {
|
if (cell->type.in("$_AND_", "$_NOT_", "$__ABC_FF_")) {
|
||||||
it = module->remove(it);
|
module->remove(cell);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
RTLIL::Module* box_module = design->module(cell->type);
|
RTLIL::Module* box_module = design->module(cell->type);
|
||||||
if (box_module && box_module->attributes.count("\\abc_box_id"))
|
if (box_module && box_module->attributes.count("\\abc_box_id"))
|
||||||
boxes.emplace_back(it->second);
|
boxes.emplace_back(cell);
|
||||||
++it;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::map<std::string, int> cell_stats;
|
std::map<std::string, int> cell_stats;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue