YosysHQ / yosys

Yosys Open SYnthesis Suite
https://yosyshq.net/yosys/
ISC License
3.3k stars 860 forks source link

fix hierarchy -generate mode handling of cells #4333

Closed nakengelhardt closed 2 months ago

nakengelhardt commented 2 months ago

This change in refactoring commit e38f40af5b7 (passes/hierarchy/hierarchy.cc:51) actually changed the behavior:

-       if (cell->type.substr(0, 1) == "$" && cell->type.substr(0, 3) != "$__")
+       if (cell->type.begins_with("$__"))

As far as I can tell, the intended behavior for hierarchy -generate is to only create the requested module if:

The testcase checks this behavior, but should the check perhaps be changed to use yosys_celltypes.cell_known() instead?