Skip to content

Commit 507d661

Browse files
committed
equivalent tiles: updated genfasm to produce a valid fasm output
Signed-off-by: Alessandro Comodi <[email protected]>
1 parent 07742a6 commit 507d661

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

utils/fasm/src/fasm.cpp

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,25 @@ std::string FasmWriterVisitor::build_clb_prefix(const t_pb *pb, const t_pb_graph
168168
clb_prefix = build_clb_prefix(pb, pb_graph_node->parent_pb_graph_node);
169169
}
170170

171-
const auto *pb_type = pb_graph_node->pb_type;
171+
/* Need to use the actual pb_type
172+
* There are three cases
173+
* 1) pb_graph_node is the root_clb: in this case fasm prefixes could change because the clb could have been placed in an
174+
* equivalent tile.
175+
* 2) pb_graph_node is the root_clb child: in case the clb has been placed in an equivalent tile, its child pb_types have
176+
* different fasm prefixes. (e.g. SLICEL_X0 becomes SLICEM_X0).
177+
* 3) pb_graph_node is non of the above: in this case the fasm prefixes should be the same even if the clb is placed in an
178+
* equivalent tile.
179+
*
180+
* XXX this is a temporary workaround.
181+
*/
182+
t_pb_type *pb_type;
183+
if (root_clb_ == pb_graph_node) {
184+
pb_type = blk_type_->pb_type;
185+
} else if (root_clb_ == pb_graph_node->parent_pb_graph_node) {
186+
pb_type = blk_type_->pb_graph_head->child_pb_graph_nodes[mode_index][pb_graph_node->placement_index]->pb_type;
187+
} else {
188+
pb_type = pb_graph_node->pb_type;
189+
}
172190

173191
clb_prefix += handle_fasm_prefix(&pb_type->meta, pb_graph_node, pb_type);
174192

0 commit comments

Comments
 (0)