From 0c6db7e8b94a58167ce56a29b6476f33af0225a0 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Tue, 11 Aug 2020 14:45:57 +0200 Subject: [PATCH] More explicit throw messages in Coloquinte/legalizer.cxx. --- coloquinte/src/legalizer.cxx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/coloquinte/src/legalizer.cxx b/coloquinte/src/legalizer.cxx index 439296e3..4a386e8b 100644 --- a/coloquinte/src/legalizer.cxx +++ b/coloquinte/src/legalizer.cxx @@ -3,6 +3,7 @@ #include "coloquinte/optimization_subproblems.hxx" #include +#include #include #include #include @@ -397,7 +398,6 @@ detailed_placement legalize(netlist const & circuit, placement_t const & pl, box int_t rnd_hgh_y_pos = std::min(surface.y_max, hgh_y_pos); int_t rnd_low_x_pos = std::max(surface.x_min, low_x_pos); int_t rnd_low_y_pos = std::max(surface.y_min, low_y_pos); - index_t first_row = (rnd_low_y_pos - surface.y_min) / row_height; index_t last_row = (index_t) (rnd_hgh_y_pos - surface.y_min + row_height - 1) / row_height; // Exclusive: if the cell spans the next row, i.e. pos % row_height >= 0, include it too assert(last_row <= nbr_rows); @@ -415,8 +415,12 @@ detailed_placement legalize(netlist const & circuit, placement_t const & pl, box std::sort(L.begin(), L.end()); // Sorts from last to first, so that we may use pop_back() // Doesn't collapse them yet, which may make for bigger complexities for(index_t i=0; i+1 min_x:" << L[i+1].min_x << "\n"; + throw std::runtime_error(message.str()); + } } }