From 90aeb41c1e3741512bffca2ab16c5d721dd2c0f1 Mon Sep 17 00:00:00 2001 From: Christophe Alexandre Date: Thu, 30 Mar 2006 19:07:47 +0000 Subject: [PATCH] New version with user provided connectors --- alliance/src/ocp/doc/ocp.1 | 10 +++--- alliance/src/ocp/src/placer/PCon.cpp | 40 ++++++++++++++++------ alliance/src/ocp/src/placer/PCon.h | 3 +- alliance/src/ocp/src/placer/PPlacement.cpp | 39 ++++++++++++++++----- alliance/src/ocp/src/placer/PPlacement.h | 2 +- 5 files changed, 70 insertions(+), 24 deletions(-) diff --git a/alliance/src/ocp/doc/ocp.1 b/alliance/src/ocp/doc/ocp.1 index 8226b7ec..4e5e9bae 100644 --- a/alliance/src/ocp/doc/ocp.1 +++ b/alliance/src/ocp/doc/ocp.1 @@ -1,4 +1,4 @@ -.\" $Id: ocp.1,v 1.6 2003/10/07 14:03:05 fred Exp $ +.\" $Id: ocp.1,v 1.7 2006/03/30 19:07:45 xtof Exp $ .\" @(#)Labo.l 0.0 92/09/24 UPMC; Author: Christophe ALEXANDRE .pl -.4 .TH OCP 1 "September 27, 2001" "ASIM/LIP6" "CAO\-VLSI Reference Manual" @@ -35,7 +35,7 @@ The file containing the placed block will have the name \fIoutputname\fP. This n .br \fB-partial \fP .br -A user defined placement can be specified, thanks to a placement file. +A user defined pre-placement can be specified, thanks to a placement file. .br The optional placement file must be given by the user. It must have an extension that denotes the format defined by the environment variable \fBMBK_IN_PH\fP. .br @@ -44,12 +44,14 @@ The optional placement file must be given by the user. It must have an extension .br The placement of connectors can be also specified. .br -There are three ways to place connectors in a physical view : +There are four ways to place connectors in a physical view : .br .br +\fB-partial \fP pre-placed connectors defined by the user can be provided through the pre-placement file. In that case, automatic connector placement is impossible. +.br \fB-c\fP option will automatically place the connectors randomly. The auto placement will set connectors on each side of the abutment box. .br -\fB-ring\fP option will automatically place the connectors for the ring pad placement tool. The placement is random but only on the north and south side unless the \fB-ioc \fP option is given, in which case the constraints given in the .ioc file will be respected, but with layers suitable for ring. This option is temporary and is provided for the ring pad placement tool. +\fB-ring\fP option will automatically place the connectors for the ring pad placement tool. The placement is random but only on the north and south side unless the \fB-ioc \fP option is given, in which case the constraints given in the .ioc file will be respected, but with layers suitable for ring. .br \fB-ioc \fP option will place connectors as specified by the .ioc given file. .br diff --git a/alliance/src/ocp/src/placer/PCon.cpp b/alliance/src/ocp/src/placer/PCon.cpp index c0c3ddd6..c190defb 100644 --- a/alliance/src/ocp/src/placer/PCon.cpp +++ b/alliance/src/ocp/src/placer/PCon.cpp @@ -31,9 +31,17 @@ #include "PCon.h" -PCon::PCon(const locon* con): - PElem(), _con(con), _pos() -{} +PCon::PCon(const locon* con, phcon* pcon, int dx, int dy) + : PElem() + , _con(con) + , _phcon(pcon) + , _pos() +{ + if (_phcon) + { + _pos = PPos((_phcon->XCON - dx)/PITCH, (_phcon->YCON - dy)/PITCH); + } +} PCon::PCon(const locon* con, PPos pos, char orient): PElem(), _con(con), _pos(pos), _orient(orient) @@ -42,14 +50,26 @@ PCon::PCon(const locon* con, PPos pos, char orient): void PCon::Save(struct phfig *physicalfig, const double dx, const double dy) const { + if (!_phcon) + addphcon(physicalfig + , _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)); + else + addphcon(physicalfig + , _phcon->ORIENT + , _phcon->NAME + , _phcon->XCON + , _phcon->YCON + , _phcon->LAYER + , _phcon->WIDTH + ); - addphcon(physicalfig, - _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 diff --git a/alliance/src/ocp/src/placer/PCon.h b/alliance/src/ocp/src/placer/PCon.h index 60806761..50db5eeb 100644 --- a/alliance/src/ocp/src/placer/PCon.h +++ b/alliance/src/ocp/src/placer/PCon.h @@ -34,11 +34,12 @@ class PCon: public PElem { private: const locon* _con; + phcon* _phcon; //can be NULL PPos _pos; char _orient; public: - PCon(const locon* con); + PCon(const locon* con, phcon* pcon=NULL, int dx=0, int dy=0); PCon(const locon* con, PPos pos, char orient); PPos GetPos() const { return _pos; } const locon* GetLocon() const { return _con; } diff --git a/alliance/src/ocp/src/placer/PPlacement.cpp b/alliance/src/ocp/src/placer/PPlacement.cpp index 526f1afd..ae6781cb 100644 --- a/alliance/src/ocp/src/placer/PPlacement.cpp +++ b/alliance/src/ocp/src/placer/PPlacement.cpp @@ -145,6 +145,23 @@ PPlacement::Init(lofig* fig, int NbRows) PFixedIns* fixedins = InsertFixedIns(ins, pins, _dx, _dy); pinsmap[ins->INSNAME] = fixedins; } + + if (_prePlaceFig->PHCON && + (_placeCons || _ringPlaceCons || _iocFile)) + { + cerr << " o ERROR: impossible to have simultaneously preplaced connectors" << endl + << " and automatically placed connectors" << endl; + exit(1); + + } + + for (phcon* pcon = _prePlaceFig->PHCON; pcon; pcon = pcon->NEXT) + { + locon* lCon = getlocon(_fig, pcon->NAME); + //generates an error if no locon + PCon* pCon = InsertCon(lCon, pcon, _dx, _dy); + pconmap[pcon->NAME] = pCon; + } } @@ -209,11 +226,14 @@ PPlacement::Init(lofig* fig, int NbRows) locon_list* con = (locon_list*)(it->DATA); if (con->TYPE == EXTERNAL) { - if (_placeCons || _ringPlaceCons || _iocFile) + if ( (_prePlaceFig && _prePlaceFig->PHCON) + || _placeCons || _ringPlaceCons || _iocFile) { - PConMap::iterator cit = pconmap.find(con->NAME); - if (cit != pconmap.end()) - ++totreatinscpt; + PConMap::iterator cit = pconmap.find(con->NAME); + if (cit != pconmap.end()) + { + ++totreatinscpt; + } } } else @@ -297,7 +317,8 @@ PPlacement::Init(lofig* fig, int NbRows) } } - if (_placeCons || _ringPlaceCons || _iocFile) + if ( (_prePlaceFig && _prePlaceFig->PHCON) + || _placeCons || _ringPlaceCons || _iocFile) { for (locon* con = fig->LOCON; con; con = con->NEXT) { @@ -354,8 +375,10 @@ PPlacement::Init(lofig* fig, int NbRows) siginsset.insert(ins); } } - else if (_placeCons || _ringPlaceCons || _iocFile) + else if ( (_prePlaceFig && _prePlaceFig->PHCON) + || _placeCons || _ringPlaceCons || _iocFile) { + PConMap::iterator cit = pconmap.find(con->NAME); if (cit != pconmap.end()) { @@ -860,9 +883,9 @@ PPlacement::InsertToPlaceIns(const loins* ins) } PCon* -PPlacement::InsertCon(const locon* con) +PPlacement::InsertCon(const locon* con, phcon* phycon, int dx, int dy) { - PCon* pcon = new PCon(con); + PCon* pcon = new PCon(con, phycon); _cons.push_back(pcon); return pcon; } diff --git a/alliance/src/ocp/src/placer/PPlacement.h b/alliance/src/ocp/src/placer/PPlacement.h index 8147c723..def4892f 100644 --- a/alliance/src/ocp/src/placer/PPlacement.h +++ b/alliance/src/ocp/src/placer/PPlacement.h @@ -249,7 +249,7 @@ class PPlacement { private: PFixedIns* InsertFixedIns(const loins* ins, const phins* pins, const int dx, const int dy); PToPlaceIns* InsertToPlaceIns(const loins* ins); - PCon* InsertCon(const locon* con); + PCon* InsertCon(const locon* con, phcon* pcon=NULL, int dx=0, int dy=0); PCon* InsertCon(const locon* con, PPos position, const char orientation); PONet* InsertNet(const losig* sig); int AddRowend(struct phfig* physicalfig);