From 315ab8b40801d0be2726daef94681314cf6fc44a Mon Sep 17 00:00:00 2001 From: Christophe Alexandre Date: Mon, 6 May 2002 15:39:28 +0000 Subject: [PATCH] new margin administration ... we now try to insert the maximum amount of 2-pitch tie cells to have the maximum amount of bodie-ties --- alliance/src/ocp/src/placer/Ocp.cpp | 88 ++++++++++--------- alliance/src/ocp/src/placer/PDetSubRow.cpp | 43 +++++++-- alliance/src/ocp/src/placer/PDetSubRow.h | 2 +- alliance/src/ocp/src/placer/PDetToPlaceIns.h | 1 + alliance/src/ocp/src/placer/PPlacement.h | 6 +- .../src/ocp/src/placer/PPlacementFinal.cpp | 7 +- 6 files changed, 93 insertions(+), 54 deletions(-) diff --git a/alliance/src/ocp/src/placer/Ocp.cpp b/alliance/src/ocp/src/placer/Ocp.cpp index ef5cb1fb..64937792 100644 --- a/alliance/src/ocp/src/placer/Ocp.cpp +++ b/alliance/src/ocp/src/placer/Ocp.cpp @@ -25,6 +25,8 @@ Usage() << " in percentage of the cells area. " << endl << " The resulting area will be equal to " << endl << " CELL_AREA * (1 + ). Default value : 0.2" << endl + << "o -eqmargin : The margin is equitably distributed between all cells" << endl + << " By default, we try to insert the maximum amount of 2-pitch tie cells" << endl << "o -partial : " << endl << " The design is already partially placed (there must be a" << endl << " physical view describing this partial placement)." << endl @@ -52,6 +54,8 @@ main(int argc, char **argv) bool RingFlg = false; // Connectors bool IocFlg = false; // file for Connectors bool VerboseFlg = false; // verbose mode + bool EqMarginFlg = false; // don't try to maximise + // 2-pitch cells double NetMult = 0.8 ; double BinMult = 0.1 ; double RowMult = 0.1 ; @@ -70,50 +74,53 @@ main(int argc, char **argv) Usage(); exit(0); } - - for (int i=1; iGetWidth(); } + //xtof: 06 05 2002 + //changing the white space repartition + //We want the maximum 2-pitch spaces for bodie-tie insertion + double whitespace = GetWidth() - totalinssize; - double inswhitespace = (double)(int)(whitespace / nins); - double whitespaceremain = (double)(int)(whitespace - - nins * inswhitespace + 0.5); + double inswhitespace = 0.0; + double whitespaceremain = 0.0; + if (eqmargin) + { + inswhitespace = (double)(int)(whitespace / nins); + whitespaceremain = (double)(int)(whitespace + - nins * inswhitespace + 0.5); + } + else + { + inswhitespace = (double)(int)(whitespace / (2 * nins)); + inswhitespace *= 2; + whitespaceremain = (double)(int)(whitespace + - nins * inswhitespace + 0.5); + } for (PDetInsVector::iterator iit = _detInsVector.begin(); iit != _detInsVector.end(); iit++) @@ -54,9 +70,24 @@ PDetSubRow::ExpandInstances() iit->SetMarginWidth(iit->GetWidth() + inswhitespace); } PDetInsVector::iterator iit = _detInsVector.begin(); - while (whitespaceremain-- > 0) + if (eqmargin) { - (iit++)->AddWhiteSpace(); + while (whitespaceremain-- > 0.0) + { + (iit++)->AddWhiteSpace(); + } + } + else + { + while (whitespaceremain >= 2.0) + { + (iit++)->AddDoubleWhiteSpace(); + whitespaceremain -= 2.0; + } + if (whitespaceremain > 0.0) + { + (iit)->AddWhiteSpace(); + } } double XPos = GetMinX(); diff --git a/alliance/src/ocp/src/placer/PDetSubRow.h b/alliance/src/ocp/src/placer/PDetSubRow.h index 98c1a4e5..93cc3942 100644 --- a/alliance/src/ocp/src/placer/PDetSubRow.h +++ b/alliance/src/ocp/src/placer/PDetSubRow.h @@ -25,7 +25,7 @@ class PDetSubRow : public PContainer { bool GetOrientation() const { return _orientation; } PDetInsVector& GetInssVector() { return _detInsVector; } const PDetInsVector& GetConstInssVector() const { return _detInsVector; } - void ExpandInstances(); + void ExpandInstances(const bool eqmargin); bool FinalOptimize(); ostream& Print(ostream& os) const; ofstream& Plot(ofstream& out) const; diff --git a/alliance/src/ocp/src/placer/PDetToPlaceIns.h b/alliance/src/ocp/src/placer/PDetToPlaceIns.h index 2a563cca..085517a1 100644 --- a/alliance/src/ocp/src/placer/PDetToPlaceIns.h +++ b/alliance/src/ocp/src/placer/PDetToPlaceIns.h @@ -28,6 +28,7 @@ class PDetToPlaceIns : public PIns { double GetLeftCornerX() const { return _leftCorner.GetX(); } void SetSubRow(PDetSubRow* subrow) { _subRow = subrow; } void AddWhiteSpace() { ++_marginWidth; } + void AddDoubleWhiteSpace() { _marginWidth += 2; } void UnPlace() { _placed = false; } void Place() { _placed = true; } bool IsPlaced() const { return _placed; } diff --git a/alliance/src/ocp/src/placer/PPlacement.h b/alliance/src/ocp/src/placer/PPlacement.h index 87896a7a..9e3b7bec 100644 --- a/alliance/src/ocp/src/placer/PPlacement.h +++ b/alliance/src/ocp/src/placer/PPlacement.h @@ -85,6 +85,7 @@ class PPlacement { bool _boolPlot; bool _verbose; bool _prePlace; + bool _eqMargin; unsigned _totalMoves; // Placement caracteristics @@ -110,12 +111,13 @@ class PPlacement { public: PPlacement(bool conflg, bool ringflg, double rowmult, double binmult, double netmult, bool iocfile, char *iocfilename, bool plotflg, - bool verbose, bool preflg, struct phfig* physfig, + bool verbose, bool preflg, bool eqmargin, + struct phfig* physfig, char* filename): _prePlaceFig(physfig), RowMult(rowmult), BinMult(binmult), NetMult(netmult), _placeCons(conflg), _ringPlaceCons(ringflg), _iocFile(iocfile), _iocFileName(iocfilename), - _boolPlot(plotflg), _verbose(verbose), _prePlace(preflg), + _boolPlot(plotflg), _verbose(verbose), _prePlace(preflg), _eqMargin(eqmargin), _totalMoves(0),_fileName(filename) {} diff --git a/alliance/src/ocp/src/placer/PPlacementFinal.cpp b/alliance/src/ocp/src/placer/PPlacementFinal.cpp index f07195f3..6fa1b346 100644 --- a/alliance/src/ocp/src/placer/PPlacementFinal.cpp +++ b/alliance/src/ocp/src/placer/PPlacementFinal.cpp @@ -63,9 +63,6 @@ PPlacement::PlaceFinal() } } -// ====================================================================== -// double FinalInitialize() -// ====================================================================== void PPlacement::FinalInitialize() { @@ -149,7 +146,7 @@ PPlacement::FinalInitialize() for (PDetSubRows::iterator dsrit = _detSubRows.begin(); dsrit != _detSubRows.end(); dsrit++) { - dsrit->ExpandInstances(); + dsrit->ExpandInstances(_eqMargin); } // Updating All _nets BBoxs @@ -305,7 +302,7 @@ int PPlacement::AddRowend(struct phfig* physicalfig) long width = (long) ((insfig->XAB2 - insfig->XAB1) / PITCH); long height = (long) ((insfig->YAB2 - insfig->YAB1) / (PITCH * ROWHEIGHT)); long posx = (long) ((It->XINS - _dx) / PITCH); - long posy = (long)((It->YINS - _dy)/ (PITCH * ROWHEIGHT)); + long posy = (long)((It->YINS - _dy) / (PITCH * ROWHEIGHT)); for (long ydecal=0 ; ydecal < height ; ydecal++) {