diff --git a/libs/libclkarchopenfpga/src/base/clock_network.cpp b/libs/libclkarchopenfpga/src/base/clock_network.cpp index 9de997e6c..d89492c58 100644 --- a/libs/libclkarchopenfpga/src/base/clock_network.cpp +++ b/libs/libclkarchopenfpga/src/base/clock_network.cpp @@ -381,6 +381,18 @@ bool ClockNetwork::validate_tree() const { spine_end_point(spine_id).y()); return false; } + /* parent spine and child spine should be in different track type */ + ClockSpineId parent_spine = spine_parents_[spine_id]; + if (valid_spine_id(parent_spine)) { + if (spine_track_type(spine_id) == spine_track_type(parent_spine)) { + VTR_LOG_ERROR( + "Spine '%s' and its parent '%s' are in the same track type (both " + "horizental or vertical). Expect they are othorgonal (one " + "horizental and one vertical)!\n", + spine_name(spine_id).c_str(), spine_name(parent_spine).c_str()); + return false; + } + } } } return true; diff --git a/openfpga/src/annotation/append_clock_rr_graph.cpp b/openfpga/src/annotation/append_clock_rr_graph.cpp index ae4c607a2..bad9d2074 100644 --- a/openfpga/src/annotation/append_clock_rr_graph.cpp +++ b/openfpga/src/annotation/append_clock_rr_graph.cpp @@ -106,7 +106,9 @@ static void add_rr_graph_block_clock_nodes(RRGraphBuilder& rr_graph_builder, rr_graph_builder.set_node_direction(clk_node, node_dir); rr_graph_builder.set_node_capacity(clk_node, 1); /* set cost_index using segment id */ - rr_graph_builder.set_node_cost_index(clk_node, RRIndexedDataId(cost_index_offset + size_t(clk_ntwk.default_segment()))); + rr_graph_builder.set_node_cost_index( + clk_node, RRIndexedDataId(cost_index_offset + + size_t(clk_ntwk.default_segment()))); /* FIXME: need to set rc_index and cost_index when building the graph * in VTR */ /* TODO: register the node to a dedicated lookup for clock nodes only @@ -141,7 +143,8 @@ static void add_rr_graph_clock_nodes(RRGraphBuilder& rr_graph_builder, continue; } add_rr_graph_block_clock_nodes(rr_graph_builder, rr_graph_view, clk_ntwk, - chanx_coord, CHANX, CHANX_COST_INDEX_START); + chanx_coord, CHANX, + CHANX_COST_INDEX_START); } } @@ -155,8 +158,9 @@ static void add_rr_graph_clock_nodes(RRGraphBuilder& rr_graph_builder, (false == is_chany_exist(grids, chany_coord))) { continue; } - add_rr_graph_block_clock_nodes(rr_graph_builder, rr_graph_view, clk_ntwk, - chany_coord, CHANY, CHANX_COST_INDEX_START + rr_graph_view.num_rr_segments()); + add_rr_graph_block_clock_nodes( + rr_graph_builder, rr_graph_view, clk_ntwk, chany_coord, CHANY, + CHANX_COST_INDEX_START + rr_graph_view.num_rr_segments()); } } }