From 1796b158a2f5e5d61d32db16615a044c221566b3 Mon Sep 17 00:00:00 2001 From: James Cherry Date: Fri, 26 Jun 2026 20:20:09 -0700 Subject: [PATCH] Graph member alignment Signed-off-by: James Cherry --- graph/Graph.cc | 31 +++++++++++++++---------------- include/sta/Graph.hh | 35 +++++++++++++++++------------------ search/Bfs.cc | 12 ++---------- 3 files changed, 34 insertions(+), 44 deletions(-) diff --git a/graph/Graph.cc b/graph/Graph.cc index e2123cf2..589e1fa0 100644 --- a/graph/Graph.cc +++ b/graph/Graph.cc @@ -50,9 +50,9 @@ namespace sta { Graph::Graph(StaState *sta, DcalcAPIndex ap_count) : StaState(sta), - ap_count_(ap_count), period_check_annotations_(network_), - reg_clk_vertices_(makeVertexSet(this)) + reg_clk_vertices_(makeVertexSet(this)), + ap_count_(ap_count) { // For the benifit of reg_clk_vertices_ that references graph_. graph_ = this; @@ -1040,22 +1040,22 @@ Vertex::init(Pin *pin, bool is_reg_clk) { pin_ = pin; - is_reg_clk_ = is_reg_clk; - is_bidirect_drvr_ = is_bidirect_drvr; in_edges_ = edge_id_null; out_edges_ = edge_id_null; slews_ = nullptr; paths_ = nullptr; tag_group_index_ = tag_group_index_max; - slew_annotated_ = false; + bfs_in_queue_ = 0; + is_bidirect_drvr_ = is_bidirect_drvr; + is_reg_clk_ = is_reg_clk; has_checks_ = false; is_check_clk_ = false; has_downstream_clk_pin_ = false; - level_ = 0; visited1_ = false; visited2_ = false; has_sim_value_ = false; - bfs_in_queue_ = 0; + level_ = 0; + slew_annotated_ = false; } Vertex::~Vertex() @@ -1281,20 +1281,19 @@ Edge::init(VertexId from, VertexId to, TimingArcSet *arc_set) { - from_ = from; - to_ = to; arc_set_ = arc_set; - vertex_in_next_ = edge_id_null; - vertex_out_next_ = edge_id_null; - vertex_out_prev_ = edge_id_null; - is_bidirect_inst_path_ = false; - is_bidirect_net_path_ = false; - is_bidirect_port_path_ = false; - arc_delays_ = nullptr; arc_delay_annotated_is_bits_ = true; arc_delay_annotated_.bits_ = 0; + from_ = from; + to_ = to; + vertex_in_next_ = edge_id_null; + vertex_out_next_ = edge_id_null; + vertex_out_prev_ = edge_id_null; delay_annotation_is_incremental_ = false; + is_bidirect_inst_path_ = false; + is_bidirect_net_path_ = false; + is_bidirect_port_path_ = false; is_disabled_loop_ = false; has_sim_sense_ = false; has_disabled_cond_ = false; diff --git a/include/sta/Graph.hh b/include/sta/Graph.hh index abe38883..e4a1be0a 100644 --- a/include/sta/Graph.hh +++ b/include/sta/Graph.hh @@ -192,7 +192,7 @@ public: VertexSet ®ClkVertices() { return reg_clk_vertices_; } static constexpr int vertex_level_bits = 24; - static constexpr int vertex_level_max = (1< bfs_in_queue_; // 8 - int level_:Graph::vertex_level_bits; // 24 - unsigned int slew_annotated_:slew_annotated_bits; // 4 // Bidirect pins have two vertices. // This flag distinguishes the driver and load vertices. - bool is_bidirect_drvr_:1; - - bool is_reg_clk_:1; + unsigned int is_bidirect_drvr_:1; + unsigned int is_reg_clk_:1; // Constrained by timing check edge. - bool has_checks_:1; + unsigned int has_checks_:1; // Is the clock for a timing check. - bool is_check_clk_:1; - bool has_downstream_clk_pin_:1; - bool visited1_:1; - bool visited2_:1; - bool has_sim_value_:1; + unsigned int is_check_clk_:1; + unsigned int has_downstream_clk_pin_:1; + unsigned int visited1_:1; + unsigned int visited2_:1; + unsigned int has_sim_value_:1; + int level_:Graph::vertex_level_bits; // 24 + unsigned int slew_annotated_:slew_annotated_bits; // 4 private: friend class Graph; @@ -405,16 +404,16 @@ protected: static uintptr_t arcDelayAnnotateBit(size_t index); TimingArcSet *arc_set_; - VertexId from_; - VertexId to_; - EdgeId vertex_in_next_; // Vertex in edges list. - EdgeId vertex_out_next_; // Vertex out edges doubly linked list. - EdgeId vertex_out_prev_; float *arc_delays_; union { uintptr_t bits_; std::vector *seq_; } arc_delay_annotated_; + VertexId from_; + VertexId to_; + EdgeId vertex_in_next_; // Vertex in edges list. + EdgeId vertex_out_next_; // Vertex out edges doubly linked list. + EdgeId vertex_out_prev_; bool arc_delay_annotated_is_bits_:1; bool delay_annotation_is_incremental_:1; bool is_bidirect_inst_path_:1; diff --git a/search/Bfs.cc b/search/Bfs.cc index 69b9c28b..ee099344 100644 --- a/search/Bfs.cc +++ b/search/Bfs.cc @@ -343,11 +343,7 @@ BfsIterator::remove(Vertex *vertex) BfsFwdIterator::BfsFwdIterator(BfsIndex bfs_index, SearchPred *search_pred, StaState *sta) : - BfsIterator(bfs_index, - 0, - level_max, - search_pred, - sta) + BfsIterator(bfs_index, 0, Graph::vertex_level_max, search_pred, sta) { } @@ -415,11 +411,7 @@ BfsFwdIterator::enqueueAdjacentVertices(Vertex *vertex, BfsBkwdIterator::BfsBkwdIterator(BfsIndex bfs_index, SearchPred *search_pred, StaState *sta) : - BfsIterator(bfs_index, - level_max, - 0, - search_pred, - sta) + BfsIterator(bfs_index, Graph::vertex_level_max, 0, search_pred, sta) { }