Conversation
Signed-off-by: Arthur Koucher <arthurkoucher@precisioninno.com>
Signed-off-by: Arthur Koucher <arthurkoucher@precisioninno.com>
Signed-off-by: Arthur Koucher <arthurkoucher@precisioninno.com>
Signed-off-by: Arthur Koucher <arthurkoucher@precisioninno.com>
There was a problem hiding this comment.
Code Review
This pull request refactors the tmg_conn class by removing tmg_conn_w.cpp and restructuring how nets are analyzed. Specifically, it separates net assignment (setNet) from analysis (analyzeNet), moves several graph-related traversal methods directly into ConnectionGraph, and cleans up unused methods. The review feedback highlights a critical issue where clear() does not reset net-specific state variables (like connected_ and has_special_wires_), leading to potential state leakage across reused instances. Additionally, several defensive null checks are recommended for connection_graph_ to prevent potential null pointer dereferences in checkVisited(), getDisconnectedStart(), and copyWireIdToVisitedShorts().
Signed-off-by: Arthur Koucher <arthurkoucher@precisioninno.com>
Signed-off-by: Arthur Koucher <arthurkoucher@precisioninno.com>
Signed-off-by: Arthur Koucher <arthurkoucher@precisioninno.com>
|
Codex:
|
Signed-off-by: Arthur Koucher <arthurkoucher@precisioninno.com>
|
Fixed. As discussed, the bug was in the wire destroyer. |
| net->global_wire_ = 0; | ||
| } else { | ||
| net->wire_ = 0; | ||
| net->flags_.disconnected = 0; |
There was a problem hiding this comment.
Are you killing off disconnected? If so you should remove the APIs and storage too.
There was a problem hiding this comment.
I didn't realized that it was dead.
There was a problem hiding this comment.
@maliberty Killing off disconnected would imply more dead code in orderWires that I'll have to also remove here and the PR would get overloaded. I reverted the last commit and did as Codex suggested. I'll remove the flag in a subsequent hopefully removal-only PR.
This reverts commit bf6b494. Signed-off-by: Arthur Koucher <arthurkoucher@precisioninno.com>
Signed-off-by: Arthur Koucher <arthurkoucher@precisioninno.com>
Summary
General Organization
tmg_connmethod definitions live in tmg_conn.cpp.Structural Changes
tmg_conn::setNet.tmg_getDriveTerma method oftmg_conn.tmg_connmethods that just forwarded graph APIs. They were somewhat hiding that the DFS is referring to theConnectionGraph.tmg_conn::loadNetinto:tmg_conn::clear()now resets the entire state i.e., all member variables and it's called at the end of the top-level function.Removals
tmg_conn::checkConnOrdered. Not only it wasn't being used but the name oversold what it did. It basically just checked if a wire path's first point was a terminal. If we want a proper checker for normalized connectivity, we can write it ourselves. This method was defined alone in tmg_conn_w.cpp which I removed.tmg_conn::isConnectedwas also dead.Type of Change
Impact
None.
Verification
./etc/Build.sh).Related Issues
None.