mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-13 04:28:18 +00:00
Further clean up passes/techmap/techmap.cc
.
Co-Authored-By: Eddie Hung <eddie@fpgeh.com>
This commit is contained in:
parent
982562ff13
commit
bd54d67ad4
|
@ -568,7 +568,7 @@ struct TechmapWorker
|
||||||
{
|
{
|
||||||
IdString derived_name = tpl_name;
|
IdString derived_name = tpl_name;
|
||||||
RTLIL::Module *tpl = map->module(tpl_name);
|
RTLIL::Module *tpl = map->module(tpl_name);
|
||||||
dict<IdString, RTLIL::Const> parameters(cell->parameters.begin(), cell->parameters.end());
|
dict<IdString, RTLIL::Const> parameters(cell->parameters);
|
||||||
|
|
||||||
if (tpl->get_blackbox_attribute(ignore_wb))
|
if (tpl->get_blackbox_attribute(ignore_wb))
|
||||||
continue;
|
continue;
|
||||||
|
@ -782,16 +782,17 @@ struct TechmapWorker
|
||||||
// do not register techmap_wrap modules with techmap_cache
|
// do not register techmap_wrap modules with techmap_cache
|
||||||
} else {
|
} else {
|
||||||
std::pair<IdString, dict<IdString, RTLIL::Const>> key(tpl_name, parameters);
|
std::pair<IdString, dict<IdString, RTLIL::Const>> key(tpl_name, parameters);
|
||||||
if (techmap_cache.count(key) > 0) {
|
auto it = techmap_cache.find(key);
|
||||||
tpl = techmap_cache[key];
|
if (it != techmap_cache.end()) {
|
||||||
|
tpl = it->second;
|
||||||
} else {
|
} else {
|
||||||
if (parameters.size() != 0) {
|
if (parameters.size() != 0) {
|
||||||
mkdebug.on();
|
mkdebug.on();
|
||||||
derived_name = tpl->derive(map, dict<IdString, RTLIL::Const>(parameters.begin(), parameters.end()));
|
derived_name = tpl->derive(map, parameters);
|
||||||
tpl = map->module(derived_name);
|
tpl = map->module(derived_name);
|
||||||
log_continue = true;
|
log_continue = true;
|
||||||
}
|
}
|
||||||
techmap_cache[key] = tpl;
|
techmap_cache.emplace(std::move(key), tpl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue