1111 * store all edges as bi-directional edges.
1212 *
1313 * NOTE: We store only the static connectivity and node information in the 'TimingGraph' class.
14- * Other dynamic information (edge delays, node arrival/required times) is stored seperately .
15- * This means that most actions opearting on the timing graph (e.g. TimingAnalyzers) only
14+ * Other dynamic information (edge delays, node arrival/required times) is stored separately .
15+ * This means that most actions operating on the timing graph (e.g. TimingAnalyzers) only
1616 * require read-only access to the timing graph.
1717 *
1818 * Accessing Graph Data
2828 * rather than the more typical "Array of Structs (AoS)" data layout.
2929 *
3030 * By using a SoA layout we keep all data for a particular field (e.g. node types) in contiguous
31- * memory. Using an AoS layout the various fields accross nodes would *not* be contiguous
31+ * memory. Using an AoS layout the various fields across nodes would *not* be contiguous
3232 * (although the different fields within each object (e.g. a TimingNode class) would be contiguous.
33- * Since we typically perform operations on particular fields accross nodes the SoA layout performs
33+ * Since we typically perform operations on particular fields across nodes the SoA layout performs
3434 * better (and enables memory ordering optimizations). The edges are also stored in a SOA format.
3535 *
3636 * The SoA layout also motivates the ID based approach, which allows direct indexing into the required
4848 * and ensures that each cache line pulled into the cache will (likely) be accessed multiple times
4949 * before being evicted.
5050 *
51- * Note that performing these optimizations is currently done explicity by calling the optimize_edge_layout()
52- * and optimize_node_layout() member functions. In the future (particularily if incremental modification
51+ * Note that performing these optimizations is currently done explicitly by calling the optimize_edge_layout()
52+ * and optimize_node_layout() member functions. In the future (particularly if incremental modification
5353 * support is added), it may be a good idea apply these modifications automatically as needed.
5454 *
5555 */
56+ #include < utility>
5657#include < vector>
5758#include < set>
5859#include < limits>
@@ -149,7 +150,7 @@ class TimingGraph {
149150
150151 // /\pre The graph must be levelized.
151152 // /\returns A range containing the nodes which are primary inputs (i.e. SOURCE's with no fanin, corresponding to top level design inputs pins)
152- // /\warning Not all SOURCE nodes in the graph are primary inputs (e.g. FF Q pins are SOURCE's but have incomming edges from the clock network)
153+ // /\warning Not all SOURCE nodes in the graph are primary inputs (e.g. FF Q pins are SOURCE's but have incoming edges from the clock network)
153154 // /\see levelize()
154155 node_range primary_inputs () const {
155156 TATUM_ASSERT_MSG (is_levelized_, " Timing graph must be levelized" );
@@ -282,7 +283,7 @@ class TimingGraph {
282283 // Node data
283284 tatum::util::linear_map<NodeId,NodeId> node_ids_; // The node IDs in the graph
284285 tatum::util::linear_map<NodeId,NodeType> node_types_; // Type of node
285- tatum::util::linear_map<NodeId,std::vector<EdgeId>> node_in_edges_; // Incomiing edge IDs for node
286+ tatum::util::linear_map<NodeId,std::vector<EdgeId>> node_in_edges_; // Incoming edge IDs for node
286287 tatum::util::linear_map<NodeId,std::vector<EdgeId>> node_out_edges_; // Out going edge IDs for node
287288 tatum::util::linear_map<NodeId,LevelId> node_levels_; // Out going edge IDs for node
288289
@@ -293,12 +294,12 @@ class TimingGraph {
293294 tatum::util::linear_map<EdgeId,NodeId> edge_src_nodes_; // Source node for each edge
294295 tatum::util::linear_map<EdgeId,bool > edges_disabled_;
295296
296- // Auxilary graph-level info, filled in by levelize()
297+ // Auxiliary graph-level info, filled in by levelize()
297298 tatum::util::linear_map<LevelId,LevelId> level_ids_; // The level IDs in the graph
298299 tatum::util::linear_map<LevelId,std::vector<NodeId>> level_nodes_; // Nodes in each level
299300 std::vector<NodeId> primary_inputs_; // Primary input nodes of the timing graph.
300301 std::vector<NodeId> logical_outputs_; // Logical output nodes of the timing graph.
301- bool is_levelized_ = false ; // Inidcates if the current levelization is valid
302+ bool is_levelized_ = false ; // Indicates if the current levelization is valid
302303
303304 bool allow_dangling_combinational_nodes_ = false ;
304305
@@ -310,26 +311,31 @@ std::vector<std::vector<NodeId>> identify_combinational_loops(const TimingGraph&
310311// Returns the set of nodes transitively connected (either fanin or fanout) to nodes in through_nodes
311312// up to max_depth (default infinite) hops away
312313std::vector<NodeId> find_transitively_connected_nodes (const TimingGraph& tg,
313- const std::vector<NodeId> through_nodes,
314+ const std::vector<NodeId>& through_nodes,
314315 size_t max_depth=std::numeric_limits<size_t >::max());
315316
316317// Returns the set of nodes in the transitive fanin of nodes in sinks up to max_depth (default infinite) hops away
317318std::vector<NodeId> find_transitive_fanin_nodes (const TimingGraph& tg,
318- const std::vector<NodeId> sinks,
319+ const std::vector<NodeId>& sinks,
319320 size_t max_depth=std::numeric_limits<size_t >::max());
320321
321322// Returns the set of nodes in the transitive fanout of nodes in sources up to max_depth (default infinite) hops away
322323std::vector<NodeId> find_transitive_fanout_nodes (const TimingGraph& tg,
323- const std::vector<NodeId> sources,
324+ const std::vector<NodeId>& sources,
324325 size_t max_depth=std::numeric_limits<size_t >::max());
325326
326327EdgeType infer_edge_type (const TimingGraph& tg, EdgeId edge);
327328
328329// Mappings from old to new IDs
329330struct GraphIdMaps {
330- GraphIdMaps (tatum::util::linear_map<NodeId,NodeId> node_map,
331- tatum::util::linear_map<EdgeId,EdgeId> edge_map)
331+ GraphIdMaps (const tatum::util::linear_map<NodeId,NodeId>& node_map,
332+ const tatum::util::linear_map<EdgeId,EdgeId>& edge_map)
332333 : node_id_map(node_map), edge_id_map(edge_map) {}
334+
335+ GraphIdMaps (tatum::util::linear_map<NodeId,NodeId>&& node_map,
336+ tatum::util::linear_map<EdgeId,EdgeId>&& edge_map)
337+ : node_id_map(std::move(node_map)), edge_id_map(std::move(edge_map)) {}
338+
333339 tatum::util::linear_map<NodeId,NodeId> node_id_map;
334340 tatum::util::linear_map<EdgeId,EdgeId> edge_id_map;
335341};
0 commit comments