mirror of
https://github.com/YosysHQ/yosys
synced 2025-06-06 06:03:23 +00:00
commit
edb95c69a9
20 changed files with 976 additions and 21 deletions
|
@ -35,10 +35,12 @@ struct keep_cache_t
|
|||
{
|
||||
Design *design;
|
||||
dict<Module*, bool> cache;
|
||||
bool purge_mode = false;
|
||||
|
||||
void reset(Design *design = nullptr)
|
||||
void reset(Design *design = nullptr, bool purge_mode = false)
|
||||
{
|
||||
this->design = design;
|
||||
this->purge_mode = purge_mode;
|
||||
cache.clear();
|
||||
}
|
||||
|
||||
|
@ -88,6 +90,9 @@ struct keep_cache_t
|
|||
if (cell->has_keep_attr())
|
||||
return true;
|
||||
|
||||
if (!purge_mode && cell->type == ID($scopeinfo))
|
||||
return true;
|
||||
|
||||
if (cell->module && cell->module->design)
|
||||
return query(cell->module->design->module(cell->type));
|
||||
|
||||
|
@ -236,6 +241,8 @@ int count_nontrivial_wire_attrs(RTLIL::Wire *w)
|
|||
{
|
||||
int count = w->attributes.size();
|
||||
count -= w->attributes.count(ID::src);
|
||||
count -= w->attributes.count(ID::hdlname);
|
||||
count -= w->attributes.count(ID(scopename));
|
||||
count -= w->attributes.count(ID::unused_bits);
|
||||
return count;
|
||||
}
|
||||
|
@ -661,7 +668,7 @@ struct OptCleanPass : public Pass {
|
|||
}
|
||||
extra_args(args, argidx, design);
|
||||
|
||||
keep_cache.reset(design);
|
||||
keep_cache.reset(design, purge_mode);
|
||||
|
||||
ct_reg.setup_internals_mem();
|
||||
ct_reg.setup_internals_anyinit();
|
||||
|
|
|
@ -272,6 +272,9 @@ struct OptMergeWorker
|
|||
if ((!mode_share_all && !ct.cell_known(cell->type)) || !cell->known())
|
||||
continue;
|
||||
|
||||
if (cell->type == ID($scopeinfo))
|
||||
continue;
|
||||
|
||||
uint64_t hash = hash_cell_parameters_and_connections(cell);
|
||||
auto r = sharemap.insert(std::make_pair(hash, cell));
|
||||
if (!r.second) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue