From 580ca0892c7d4a5c7f7b420bbaf836b1f8ad59f2 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Fri, 13 Apr 2018 15:00:13 +0200 Subject: [PATCH] Correct rounding of GCell horizontal size in GCell::doGrid(). * Change: In Anabatic::GCell::doGrid(), the GCell where square using the slice height as side. This was leading to vertical edges with slightly different capacities when the vertical picth was not a multiple of the horizontal one. This was not a bug per se as the global router is able to manage any interval. Now the horizontal side is rounded on the slice step. --- anabatic/src/GCell.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/anabatic/src/GCell.cpp b/anabatic/src/GCell.cpp index f46d5da2..fb75ea6e 100644 --- a/anabatic/src/GCell.cpp +++ b/anabatic/src/GCell.cpp @@ -771,11 +771,16 @@ namespace Anabatic { bool openSession = Session::isOpen(); if (not openSession) getAnabatic()->openSession(); - DbU::Unit side = Session::getSliceHeight(); + DbU::Unit vside = Session::getSliceHeight(); + DbU::Unit hside = Session::getSliceHeight(); Interval hspan = getSide( Flags::Horizontal ); Interval vspan = getSide( Flags::Vertical ); - // if (hspan.getSize() < 2*side) { + if (hside % Session::getSliceStep()) { + hside += Session::getSliceStep() - hside % Session::getSliceStep(); + } + + // if (hspan.getSize() < 2*hside) { // cerr << Error( "GCell::doGrid(): GCell is too narrow (dx:%s) to build a grid.\n" // " (%s)" // , DbU::getValueString(hspan.getSize()).c_str() @@ -785,7 +790,7 @@ namespace Anabatic { // return false; // } - // if (vspan.getSize() < 2*side) { + // if (vspan.getSize() < 2*vside) { // cerr << Error( "GCell::doGrid(): GCell is too narrow (dy:%s) to build a grid.\n" // " (%s)" // , DbU::getValueString(vspan.getSize()).c_str() @@ -796,20 +801,20 @@ namespace Anabatic { GCell* row = this; GCell* column = NULL; - DbU::Unit ycut = vspan.getVMin()+side; - for ( ; ycut < vspan.getVMax() ; ycut += side ) { + DbU::Unit ycut = vspan.getVMin()+vside; + for ( ; ycut < vspan.getVMax() ; ycut += vside ) { column = row; row = row->hcut( ycut ); row->setType( Flags::MatrixGCell ); - for ( DbU::Unit xcut = hspan.getVMin()+side ; xcut < hspan.getVMax() ; xcut += side ) { + for ( DbU::Unit xcut = hspan.getVMin()+hside ; xcut < hspan.getVMax() ; xcut += hside ) { column = column->vcut( xcut ); column->setType( Flags::MatrixGCell ); } } column = row; - for ( DbU::Unit xcut = hspan.getVMin()+side ; xcut < hspan.getVMax() ; xcut += side ) { + for ( DbU::Unit xcut = hspan.getVMin()+hside ; xcut < hspan.getVMax() ; xcut += hside ) { column = column->vcut( xcut ); column->setType( Flags::MatrixGCell ); }