Skip to content

Commit 5e6bb55

Browse files
authored
Merge pull request verilog-to-routing#12 from elmsfu/fasm_clb_prefix
fasm: Use root_clb fasm_prefix if it exists
2 parents a2006a0 + 6bf0b25 commit 5e6bb55

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

utils/fasm/src/fasm.cpp

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ void FasmWriterVisitor::visit_clb_impl(ClusterBlockId blk_id, const t_pb* clb) {
4545

4646
root_clb_ = clb->pb_graph_node;
4747

48-
auto *pb_type = clb->pb_graph_node->pb_type;
4948
int x = place_ctx.block_locs[blk_id].x;
5049
int y = place_ctx.block_locs[blk_id].y;
5150
auto &grid_loc = device_ctx.grid[x][y];
@@ -59,13 +58,6 @@ void FasmWriterVisitor::visit_clb_impl(ClusterBlockId blk_id, const t_pb* clb) {
5958
current_blk_has_prefix_= false;
6059
}
6160

62-
std::string pb_type_prefix;
63-
if (pb_type->meta != nullptr && pb_type->meta->has("fasm_prefix")) {
64-
pb_type_prefix = pb_type->meta->get("fasm_prefix")->front().as_string();
65-
} else {
66-
current_blk_has_prefix_ = false;
67-
}
68-
6961
if(current_blk_has_prefix_) {
7062
blk_prefix_ = grid_prefix + ".";
7163
}
@@ -103,13 +95,9 @@ void FasmWriterVisitor::check_interconnect(const t_pb_route *pb_route, int inode
10395
}
10496

10597
std::string FasmWriterVisitor::build_clb_prefix(const t_pb_graph_node* pb_graph_node) const {
106-
if(pb_graph_node == root_clb_) {
107-
return "";
108-
}
109-
11098
std::string clb_prefix = "";
11199

112-
if(pb_graph_node->parent_pb_graph_node != root_clb_) {
100+
if(root_clb_ != pb_graph_node && pb_graph_node->parent_pb_graph_node != root_clb_) {
113101
VTR_ASSERT(pb_graph_node->parent_pb_graph_node != nullptr);
114102
clb_prefix = build_clb_prefix(pb_graph_node->parent_pb_graph_node);
115103
}

0 commit comments

Comments
 (0)