From 11499eb6ed05deab682b51f36a9ff0dcb2c8703a Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Tue, 22 Jun 2010 20:51:02 +0000 Subject: [PATCH] * ./metis: - New: In computeQuadriPartitions, throw an exception when the size of the first quadri-partition is already under the critical size. --- metis/src/MetisEngine.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/metis/src/MetisEngine.cpp b/metis/src/MetisEngine.cpp index 9042d3cd..ae9821a6 100644 --- a/metis/src/MetisEngine.cpp +++ b/metis/src/MetisEngine.cpp @@ -285,8 +285,13 @@ namespace Metis { ysplits = ((int)(trunc ( (1.0/aspectRatio)+0.5 ) )) * 2; } - int partitionSizeStop = Cfg::getParamInt("metis.numberOfInstancesStopCriterion",45)->asInt(); - double quadPartitions = log((double)gates / (double)(partitionSizeStop*xsplits*ysplits) ) / log(4.0) + 1.0; + + size_t partitionSizeStop = Cfg::getParamInt("metis.numberOfInstancesStopCriterion",45)->asInt(); + if ( gates / (xsplits*ysplits) < partitionSizeStop ) + throw Error("Design <%s> is too small to be quadri-partionned, only %d gates." + ,getString(cell->getName()).c_str(),gates); + + double quadPartitions = log((double)gates / (double)(partitionSizeStop*xsplits*ysplits) ) / log(4.0) + 1.0; return (unsigned int)(quadPartitions); }