From 5f3681b3c5424c217a1cc0f6e6b49f898c6270a8 Mon Sep 17 00:00:00 2001 From: Frederic Petrot Date: Tue, 7 Oct 2003 14:02:33 +0000 Subject: [PATCH] Changing the behavior of Ocp when the -ring -ioc options are given. In that case, the pins are placed as given in the ioc file, but with metal2 of witdh 2 on all faces. Also the left and right connectors are not anymore placed on the power supplies, but between them. --- alliance/src/ocp/src/placer/Ocp.cpp | 7 ++-- alliance/src/ocp/src/placer/PCon.cpp | 25 +++++++++++---- alliance/src/ocp/src/placer/PCon.h | 1 + alliance/src/ocp/src/placer/PPlacement.cpp | 32 ++++++++++++++++--- .../src/ocp/src/placer/PPlacementFinal.cpp | 3 ++ .../src/ocp/src/placer/PPlacementGlobal.cpp | 3 ++ 6 files changed, 58 insertions(+), 13 deletions(-) diff --git a/alliance/src/ocp/src/placer/Ocp.cpp b/alliance/src/ocp/src/placer/Ocp.cpp index c83de0cc..03002aed 100644 --- a/alliance/src/ocp/src/placer/Ocp.cpp +++ b/alliance/src/ocp/src/placer/Ocp.cpp @@ -17,7 +17,8 @@ Usage() << "o -v : verbose mode" << endl << "o -gnuplot : create statistics files to use with gnuplot" << endl << "o -c : create connectors (placement randomly generated)" << endl - << "o -ring : create connectors (placement randomly generated) suitable for ring pad placement tool" << endl + << "o -ring : create connectors suitable for ring pad placement tool" << endl + << " placement randomly generated unless -ioc is given" << endl << "o -ioc : create connectors and place it using .ioc file" << endl << "o -margin : The amount of free area added " << endl << " in percentage of the cells area. " << endl @@ -365,11 +366,11 @@ main(int argc, char **argv) << endl; } - if ((IocFlg && ConFlg) || (IocFlg && RingFlg)) + if (IocFlg && ConFlg) { cerr << " o You cannot have a connectors placement file and ask " << "for a automatic connectors placement at the same time ...." << endl - << " o Use -ioc or -c or -ring" << endl; + << " o Use either -ioc or -c" << endl; exit(1); } diff --git a/alliance/src/ocp/src/placer/PCon.cpp b/alliance/src/ocp/src/placer/PCon.cpp index 2067340c..f961c05c 100644 --- a/alliance/src/ocp/src/placer/PCon.cpp +++ b/alliance/src/ocp/src/placer/PCon.cpp @@ -14,13 +14,26 @@ PCon::PCon(const locon* con, PPos pos, char orient): void PCon::Save(struct phfig *physicalfig, const double dx, const double dy) const { + addphcon(physicalfig, - _orient, - _con->NAME, - (int)(GetPosX() * PITCH + dx), - (int)(GetPosY() * PITCH + dy), - ((_orient==NORTH) || (_orient == SOUTH))?ALU2:ALU3, - ((_orient==NORTH) || (_orient == SOUTH))?2 * (int)(PITCH/5):(int)(PITCH/5)); + _orient, + _con->NAME, + (int)(GetPosX() * PITCH + dx), + (int)(GetPosY() * PITCH + dy), + _orient==NORTH || _orient == SOUTH ? ALU2 : ALU3, + (_orient==NORTH || _orient == SOUTH ? 2 : 1) * (PITCH/5)); +} + +void +PCon::RingSave(struct phfig *physicalfig, const double dx, const double dy) const +{ + addphcon(physicalfig, + _orient, + _con->NAME, + (int)(GetPosX() * PITCH + dx), + (int)(GetPosY() * PITCH + dy), + ALU2, + 2 * (PITCH/5)); } ostream& diff --git a/alliance/src/ocp/src/placer/PCon.h b/alliance/src/ocp/src/placer/PCon.h index d684c40c..df59ab0a 100644 --- a/alliance/src/ocp/src/placer/PCon.h +++ b/alliance/src/ocp/src/placer/PCon.h @@ -19,6 +19,7 @@ class PCon: public PElem { void SetPos(const PPos pos) {_pos = pos;} void SetOrient(const char orient) {_orient = orient;} void Save(struct phfig *physicalfig, const double dx, const double dy) const; + void RingSave(struct phfig *physicalfig, const double dx, const double dy) const; ostream& Print(ostream& os) const; }; diff --git a/alliance/src/ocp/src/placer/PPlacement.cpp b/alliance/src/ocp/src/placer/PPlacement.cpp index 22f99d18..b7bec19f 100644 --- a/alliance/src/ocp/src/placer/PPlacement.cpp +++ b/alliance/src/ocp/src/placer/PPlacement.cpp @@ -142,7 +142,7 @@ PPlacement::Init(lofig* fig, int NbRows) _nInsToPlace = _toPlaceInss.size(); // Traitement des connecteurs .... - if (_placeCons || _ringPlaceCons) + if (_placeCons || (_ringPlaceCons && !_iocFile)) { for (locon* con = fig->LOCON; con; con = con->NEXT) { @@ -383,7 +383,7 @@ PPlacement::Init(lofig* fig, int NbRows) // set positions of connectors in case of no ioc file if (_placeCons && !_ringPlaceCons) GenerateConsPlacement(); - if (_ringPlaceCons) GenerateRingConsPlacement(); + if (_ringPlaceCons && !_iocFile) GenerateRingConsPlacement(); // set positions of connectors when ioc file is given if (_iocFile) SetPosIocFile(pconmap); @@ -649,7 +649,7 @@ PPlacement::SetPosIocFile(PConMap& pconmap) if (leftcount != 0) { - double pos = 0.0; + double pos = 0.0, ppos = pos; if (leftspace >= Width-topcount) { cerr << " o ERROR : in ioc file : space too important" << endl; @@ -657,6 +657,7 @@ PPlacement::SetPosIocFile(PConMap& pconmap) } double conspace = ((double)(Height-leftspace)/ (double)(leftcount-nbspaceleft)); + if (_ringPlaceCons) ppos = pos; pos += conspace / 2.0; for(con_list* tmpcon = ptleft ; tmpcon; tmpcon = tmpcon->NEXT) @@ -668,12 +669,23 @@ PPlacement::SetPosIocFile(PConMap& pconmap) } else { + if (_ringPlaceCons) + { + int delta = (int)pos % ROWHEIGHT; + if (delta == 0) pos -= 2.0; + else if (delta == 1) pos += 1.0; + else if (delta == 9) pos -= 1.0; + // Just in case there are so many connectors + if (pos < ppos) pos = ppos + 1; + } + if (_verbose) cout << " o adding connector : " << tmpcon->NAME << " x : " << 0 << " y : " << (int)pos << endl; position.SetX(0.0); position.SetY((double)(int)pos); // test a rajouter pour verifier si locon present ou pas!!! pconmap[tmpcon->NAME]->SetPos(position); + if (_ringPlaceCons) ppos = pos; pos += conspace; } } @@ -681,7 +693,7 @@ PPlacement::SetPosIocFile(PConMap& pconmap) if (rightcount != 0) { - double pos = 0.0; + double pos = 0.0, ppos = pos; if (rightspace >= Width-topcount) { cerr << " o ERROR : in ioc file : space too important" << endl; @@ -689,6 +701,7 @@ PPlacement::SetPosIocFile(PConMap& pconmap) } double conspace = ((double)(Height-rightspace)/ (double)(rightcount-nbspaceright)); + if (_ringPlaceCons) ppos = pos; pos += conspace / 2.0; for(con_list* tmpcon = ptright ; tmpcon; tmpcon = tmpcon->NEXT) @@ -700,12 +713,23 @@ PPlacement::SetPosIocFile(PConMap& pconmap) } else { + if (_ringPlaceCons) + { + int delta = (int)pos % ROWHEIGHT; + if (delta == 0) pos -= 2.0; + else if (delta == 1) pos += 1.0; + else if (delta == 9) pos -= 1.0; + // Just in case there are so many connectors + if (pos < ppos) pos = ppos + 1; + } + if (_verbose) cout << " o adding connector: " << tmpcon->NAME << " x : " << Width << " y : " << (int)pos << endl; position.SetX(Width); position.SetY((double)(int)pos); // test a rajouter pour verifier si locon present ou pas!!! pconmap[tmpcon->NAME]->SetPos(position); + if (_ringPlaceCons) ppos = pos; pos += conspace; } } diff --git a/alliance/src/ocp/src/placer/PPlacementFinal.cpp b/alliance/src/ocp/src/placer/PPlacementFinal.cpp index c048f9cf..565a13c1 100644 --- a/alliance/src/ocp/src/placer/PPlacementFinal.cpp +++ b/alliance/src/ocp/src/placer/PPlacementFinal.cpp @@ -248,6 +248,9 @@ PPlacement::Save() for (PCons::const_iterator cit = _cons.begin(); cit != _cons.end(); cit++) { + if (_ringPlaceCons) + (*cit)->RingSave(physicalfig, _dx, _dy); + else (*cit)->Save(physicalfig, _dx, _dy); } diff --git a/alliance/src/ocp/src/placer/PPlacementGlobal.cpp b/alliance/src/ocp/src/placer/PPlacementGlobal.cpp index e5252bc5..1a3dd6b7 100644 --- a/alliance/src/ocp/src/placer/PPlacementGlobal.cpp +++ b/alliance/src/ocp/src/placer/PPlacementGlobal.cpp @@ -360,6 +360,9 @@ PPlacement::PlaceGlobal() } while (Temperature != 0.0 && StdDev > 0.0001 / Cost); + if (!_boolPlot) + unlink("alldata.dat"); + if (!stucked) { // Freeze out