From 84a27c3ebf1273de55a17ddd01c07ddf3007757b Mon Sep 17 00:00:00 2001 From: YRabbit Date: Fri, 18 Aug 2023 09:33:05 +1000 Subject: [PATCH] gowin: Himbaechel. Improve error messages OSER16/IDES16 placement issue reports now indicate which location is having trouble. Signed-off-by: YRabbit --- himbaechel/uarch/gowin/pack.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/himbaechel/uarch/gowin/pack.cc b/himbaechel/uarch/gowin/pack.cc index 327bca88..34a7e88d 100644 --- a/himbaechel/uarch/gowin/pack.cc +++ b/himbaechel/uarch/gowin/pack.cc @@ -629,6 +629,11 @@ struct GowinPacker // =================================== void check_io16_placement(CellInfo &ci, Loc main_loc, Loc aux_off, int diff /* 1 - diff */) { + if (main_loc.z != BelZ::IOBA_Z) { + log_error("Can't place %s at %s because OSER16/IDES16 must be placed at A pin\n", ctx->nameOf(&ci), + ctx->nameOfBel(ctx->getBelByLocation(main_loc))); + } + int mod[][3] = {{0, 0, 1}, {1, 1, 0}, {1, 1, 1}}; for (int i = diff; i < 3; ++i) { Loc aux_loc(main_loc.x + mod[i][0] * aux_off.x, main_loc.y + mod[i][1] * aux_off.y, main_loc.z + mod[i][2]); @@ -655,7 +660,7 @@ struct GowinPacker Loc aux_offset = gwu.get_tile_io16_offs(iob_loc.x, iob_loc.y); if (aux_offset.x == 0 && aux_offset.y == 0) { - log_error("OSER16 %s can not be placed here\n", ctx->nameOf(&ci)); + log_error("OSER16 %s can not be placed at %s\n", ctx->nameOf(&ci), ctx->nameOfBel(iob_bel)); } check_io16_placement(ci, iob_loc, aux_offset, out_iob->attrs.count(id_DIFF_TYPE)); @@ -729,7 +734,7 @@ struct GowinPacker Loc aux_offset = gwu.get_tile_io16_offs(iob_loc.x, iob_loc.y); if (aux_offset.x == 0 && aux_offset.y == 0) { - log_error("IDES16 %s can not be placed here\n", ctx->nameOf(&ci)); + log_error("IDES16 %s can not be placed at %s\n", ctx->nameOf(&ci), ctx->nameOfBel(iob_bel)); } check_io16_placement(ci, iob_loc, aux_offset, in_iob->attrs.count(id_DIFF_TYPE));