parallaxsw / OpenSTA

GNU General Public License v3.0
52 stars 23 forks source link

Add `src_attr` and `netlist_line` fields to `report_checks` #101

Closed akashlevy closed 1 month ago

akashlevy commented 2 months ago

See title. src_attr is the src attribute of an instance in the netlist (useful for tracking an object back to source in pre-synthesis RTL). netlist_line is the line number for tracking an instance back to its source in the Verilog netlist.

Breakdown of work:

Note that I updated the Sta API to support getting/setting line numbers on Instance/ConcreteInstance. I made specifying the line number optional by providing a default value, but anything implementing Network still needs to implement the line() function right now...

Let me know if you have any suggestions on the right strategy for annotating line numbers on instances.

jjcherry56 commented 1 month ago

I understand why the src_attr is useful, but why is the netlist line interesting?

akashlevy commented 1 month ago

To be able to track where an instance is instantiated in the netlist without searching? Feels kind of useful to me, e.g., when you see an unexpected cell type on a critical path. But maybe not. Happy to upstream just src_attr if you prefer.

QuantamHD commented 1 month ago

How does this interact with the ( src = "file.v:245" ) attributes emitted by Yosys? Should we somehow leverage the existing infrastructure for that rather than add new fields?

akashlevy commented 1 month ago

@QuantamHD It is leveraging the existing infrastructure for src attribute parsing that you added. So not quite sure what you mean

QuantamHD commented 1 month ago

Ah, my bad @akashlevy. I didn't read it carefully enough

akashlevy commented 1 month ago

@jjcherry56 wanted to give this a bump. Any feedback?

akashlevy commented 1 month ago

Going to close this and re-open with just src_attr soon as discussed.