feat: add C++ port of STA CLI pipeline (cppver/)#2
Open
LenfIcefrost wants to merge 3 commits into
Open
Conversation
Reimplements the main.py CLI path (liberty parsing, timing graph construction, delay/slack propagation) in C++17, organized into domain modules (liberty, constraints, placement, ranking, netlist, graph, sta) each with a matching sub-namespace. Verified to produce identical TNS/WNS/critical-path output to the Python version. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Cache each cell TimingArc's resolved TimingArcDef pointer at graph-build time so calculate_node() no longer rebuilds a string key and hashes into CellInfo::timing_arcs on every fanin arc; falls back to the by-key lookup only for resizable nodes. Add graph::levelize() to group the topo order into dependency-free levels, and walk calculate_delay()'s forward pass level by level, marking the loop boundary a future parallel/GPU dispatch would split on. Document both in ARCHITECTURE.md along with what a real CUDA/Metal port would still need (CSR-style flattening of the graph). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
main.pySTA CLI pipeline in C++17 (cppver/) — liberty parsing, timing graph construction, and delay/slack propagation — organized into domain modules (liberty, constraints, placement, ranking, netlist, graph, sta), each with a matching sub-namespace. Verified to produce identical TNS/WNS/critical-path output to the Python version.cppver/ARCHITECTURE.mddocumenting the module layout and dataflow through the pipeline.TimingArc's resolvedTimingArcDefpointer at graph-build time (avoiding a string-key rebuild + hash lookup intoCellInfo::timing_arcsper fanin arc on everycalculate_node()call, falling back to by-key lookup only for resizable nodes), and addsgraph::levelize()to group the topo order into dependency-free levels socalculate_delay()'s forward pass walks level by level — marking where a future parallel/GPU dispatch would split. Documents what a real CUDA/Metal port would additionally need (CSR-style flattening of the graph).Test plan
cppver/via CMake and confirm it compiles cleanlycppver/run.sh(or the built binary) against a sample netlist/liberty/SDC set and diff TNS/WNS/critical-path output against the Pythonmain.pyresultgraph::levelize()output ordering matches the original topo order's dependency constraints🤖 Generated with Claude Code