Skip to content

Commit 1829a5e

Browse files
committed
Squashed 'libs/EXTERNAL/libtatum/' changes from 15296d1a4..ee66714ea
ee66714ea Allow nodes with no active (i.e. undisabled) input edges in the first level git-subtree-dir: libs/EXTERNAL/libtatum git-subtree-split: ee66714ea4801687083526e0e442c47429dcce76
1 parent 646dffd commit 1829a5e

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

libtatum/tatum/TimingGraph.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,15 @@ void find_transitive_fanin_nodes_recurr(const TimingGraph& tg,
125125
size_t max_depth=std::numeric_limits<size_t>::max(),
126126
size_t depth=0);
127127

128+
size_t TimingGraph::node_num_active_in_edges(const NodeId node) const {
129+
size_t active_edges = 0;
130+
for (EdgeId edge : node_in_edges(node)) {
131+
if (!edge_disabled(edge)) {
132+
++active_edges;
133+
}
134+
}
135+
return active_edges;
136+
}
128137

129138
EdgeId TimingGraph::node_clock_capture_edge(const NodeId node) const {
130139

libtatum/tatum/TimingGraph.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ class TimingGraph {
9292
///\returns A range of all in-coming edges the node drives
9393
edge_range node_in_edges(const NodeId id) const { return tatum::util::make_range(node_in_edges_[id].begin(), node_in_edges_[id].end()); }
9494

95+
///\param id The Node id
96+
///\returns The number of active (undisabled) edges terminating at the node
97+
size_t node_num_active_in_edges(const NodeId id) const;
9598

9699
///\param id The node id
97100
///\returns The edge id corresponding to the incoming clock capture edge, or EdgeId::INVALID() if none

libtatum/tatum/graph_visitors/CommonAnalysisVisitor.hpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,17 @@ class CommonAnalysisVisitor : public GraphVisitor {
7373
template<class AnalysisOps>
7474
bool CommonAnalysisVisitor<AnalysisOps>::do_arrival_pre_traverse_node(const TimingGraph& tg, const TimingConstraints& tc, const NodeId node_id) {
7575
//Logical Input
76-
TATUM_ASSERT_MSG(tg.node_in_edges(node_id).size() == 0, "Logical input has input edges: timing graph not levelized.");
76+
77+
//We expect this function to only be called on nodes in the first level of the timing graph
78+
//These nodes must have no un-disabled input edges (else they shouldn't be in the first level).
79+
//In the normal case (primary input) there are no incoming edges. However if set_disable_timing
80+
//was used it may be that the edges were explicitly disabled. We therefore verify that there are
81+
//no un-disabled edges in the fanin of the current node.
82+
TATUM_ASSERT_MSG(tg.node_num_active_in_edges(node_id) == 0, "Logical input has non-disabled input edges: timing graph not levelized.");
83+
84+
//
85+
//We now generate the various clock/data launch tags associated with the arrival time traversal
86+
//
7787

7888
NodeType node_type = tg.node_type(node_id);
7989

0 commit comments

Comments
 (0)