mirror of https://github.com/YosysHQ/yosys.git
Merge remote-tracking branch 'origin/master' into eddie/abc9_mfs
This commit is contained in:
commit
93e680b7d3
2
Makefile
2
Makefile
|
@ -115,7 +115,7 @@ LDFLAGS += -rdynamic
|
||||||
LDLIBS += -lrt
|
LDLIBS += -lrt
|
||||||
endif
|
endif
|
||||||
|
|
||||||
YOSYS_VER := 0.9+932
|
YOSYS_VER := 0.9+1706
|
||||||
GIT_REV := $(shell cd $(YOSYS_SRC) && git rev-parse --short HEAD 2> /dev/null || echo UNKNOWN)
|
GIT_REV := $(shell cd $(YOSYS_SRC) && git rev-parse --short HEAD 2> /dev/null || echo UNKNOWN)
|
||||||
OBJS = kernel/version_$(GIT_REV).o
|
OBJS = kernel/version_$(GIT_REV).o
|
||||||
|
|
||||||
|
|
|
@ -114,20 +114,35 @@ void Pass::run_register()
|
||||||
|
|
||||||
void Pass::init_register()
|
void Pass::init_register()
|
||||||
{
|
{
|
||||||
|
vector<Pass*> added_passes;
|
||||||
while (first_queued_pass) {
|
while (first_queued_pass) {
|
||||||
|
added_passes.push_back(first_queued_pass);
|
||||||
first_queued_pass->run_register();
|
first_queued_pass->run_register();
|
||||||
first_queued_pass = first_queued_pass->next_queued_pass;
|
first_queued_pass = first_queued_pass->next_queued_pass;
|
||||||
}
|
}
|
||||||
|
for (auto added_pass : added_passes)
|
||||||
|
added_pass->on_register();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Pass::done_register()
|
void Pass::done_register()
|
||||||
{
|
{
|
||||||
|
for (auto &it : pass_register)
|
||||||
|
it.second->on_shutdown();
|
||||||
|
|
||||||
frontend_register.clear();
|
frontend_register.clear();
|
||||||
pass_register.clear();
|
pass_register.clear();
|
||||||
backend_register.clear();
|
backend_register.clear();
|
||||||
log_assert(first_queued_pass == NULL);
|
log_assert(first_queued_pass == NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Pass::on_register()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void Pass::on_shutdown()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
Pass::~Pass()
|
Pass::~Pass()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,6 +62,9 @@ struct Pass
|
||||||
virtual void run_register();
|
virtual void run_register();
|
||||||
static void init_register();
|
static void init_register();
|
||||||
static void done_register();
|
static void done_register();
|
||||||
|
|
||||||
|
virtual void on_register();
|
||||||
|
virtual void on_shutdown();
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ScriptPass : Pass
|
struct ScriptPass : Pass
|
||||||
|
|
|
@ -544,6 +544,8 @@ void yosys_shutdown()
|
||||||
already_shutdown = true;
|
already_shutdown = true;
|
||||||
log_pop();
|
log_pop();
|
||||||
|
|
||||||
|
Pass::done_register();
|
||||||
|
|
||||||
delete yosys_design;
|
delete yosys_design;
|
||||||
yosys_design = NULL;
|
yosys_design = NULL;
|
||||||
|
|
||||||
|
@ -553,7 +555,6 @@ void yosys_shutdown()
|
||||||
log_errfile = NULL;
|
log_errfile = NULL;
|
||||||
log_files.clear();
|
log_files.clear();
|
||||||
|
|
||||||
Pass::done_register();
|
|
||||||
yosys_celltypes.clear();
|
yosys_celltypes.clear();
|
||||||
|
|
||||||
#ifdef YOSYS_ENABLE_TCL
|
#ifdef YOSYS_ENABLE_TCL
|
||||||
|
|
|
@ -301,10 +301,9 @@ struct SccPass : public Pass {
|
||||||
RTLIL::Selection newSelection(false);
|
RTLIL::Selection newSelection(false);
|
||||||
int scc_counter = 0;
|
int scc_counter = 0;
|
||||||
|
|
||||||
for (auto &mod_it : design->modules_)
|
for (auto mod : design->selected_modules())
|
||||||
if (design->selected(mod_it.second))
|
|
||||||
{
|
{
|
||||||
SccWorker worker(design, mod_it.second, nofeedbackMode, allCellTypes, maxDepth);
|
SccWorker worker(design, mod, nofeedbackMode, allCellTypes, maxDepth);
|
||||||
|
|
||||||
if (!setAttr.empty())
|
if (!setAttr.empty())
|
||||||
{
|
{
|
||||||
|
|
|
@ -416,13 +416,11 @@ void abc9_module(RTLIL::Design *design, RTLIL::Module *module, std::string scrip
|
||||||
|
|
||||||
dict<IdString, bool> abc9_box;
|
dict<IdString, bool> abc9_box;
|
||||||
vector<RTLIL::Cell*> boxes;
|
vector<RTLIL::Cell*> boxes;
|
||||||
for (auto it = module->cells_.begin(); it != module->cells_.end(); ) {
|
for (auto cell : module->cells().to_vector()) {
|
||||||
auto cell = it->second;
|
|
||||||
if (cell->type.in(ID($_AND_), ID($_NOT_), ID($__ABC9_FF_))) {
|
if (cell->type.in(ID($_AND_), ID($_NOT_), ID($__ABC9_FF_))) {
|
||||||
it = module->cells_.erase(it);
|
module->remove(cell);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
++it;
|
|
||||||
RTLIL::Module* box_module = design->module(cell->type);
|
RTLIL::Module* box_module = design->module(cell->type);
|
||||||
auto jt = abc9_box.find(cell->type);
|
auto jt = abc9_box.find(cell->type);
|
||||||
if (jt == abc9_box.end())
|
if (jt == abc9_box.end())
|
||||||
|
|
Loading…
Reference in New Issue