YosysHQ / yosys

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

Print a note about finding attribute (* top *) in hierarchy #4742

Open nakengelhardt opened 1 week ago

nakengelhardt commented 1 week ago

What are the reasons/motivation for this change?

As suggested in https://github.com/YosysHQ/yosys/issues/3717#issuecomment-2460672212, make it more obvious to the user if the top module was selected due to an attribute overriding the heuristic.

Explain how this is achieved.

Print a log message. If multiple modules are marked (* top *), the message gets repeated multiple times, matching how the code works (the last attribute encountered while iterating over design->modules() overrides any previously seen attributes).

whitequark commented 1 week ago

Thanks, this is quite useful!