[core] enhance clock tree arch validation

This commit is contained in:
tangxifan 2023-02-26 18:39:53 -08:00
parent b9e5ae7ae9
commit db36f87dfa
2 changed files with 20 additions and 4 deletions

View File

@ -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;

View File

@ -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());
}
}
}