keep_hierarchy - selectively add the keep_hierarchy attribute

yosys> help keep_hierarchy
keep_hierarchy [options] [selection]
Add the keep_hierarchy attribute.
-min_cost <min_cost>
only add the attribute to modules estimated to have more than <min_cost>
gates after simple techmapping. Intended for tuning trade-offs between
quality and yosys runtime.

When evaluating a module's cost, gates which are within a submodule
which is marked with the keep_hierarchy attribute are not counted
towards the upper module's cost. This applies to both when the attribute
was added by this command or was pre-existing.