Main Page | Namespace List | Class Hierarchy | Compound List | File List | Namespace Members | Compound Members | File Members

BaseAnnealer Class Reference

#include <baseannealer.h>

Inheritance diagram for BaseAnnealer:

Inheritance graph
[legend]
Collaboration diagram for BaseAnnealer:

Collaboration graph
[legend]
List of all members.

Public Types

enum  MOVE_TYPES {
  MISC = -1, NOOP = 0, REP_SPEC_MIN = 1, REP_SPEC_ORIENT = 2,
  REP_SPEC_MAX = 5, SLACKS_MOVE = 6, AR_MOVE = 7, ORIENT = 10,
  SOFT_BL = 11, HPWL = 12, ARWL = 13
}

Public Member Functions

 BaseAnnealer (const parquetfp::Command_Line *const params, parquetfp::DB *const db)
virtual ~BaseAnnealer ()
virtual bool go ()=0
virtual bool packOneBlock ()=0
virtual void takePlfromDB ()=0
virtual void solveQP ()
virtual void compactSoln ()=0
void postHPWLOpt ()
void printResults (const Timer &tm, const SolutionInfo &curr) const

Public Attributes

double annealTime

Static Public Attributes

const int UNINITIALIZED = -1
const unsigned int UNSIGNED_UNINITIALIZED = 0
const int FREE_OUTLINE = -9999
const int NOT_FOUND = -1

Protected Member Functions

 BaseAnnealer ()

Protected Attributes

parquetfp::DB *const _db
const parquetfp::Command_Line
*const 
_params
parquetfp::AnalytSolve *const _analSolve
char _baseFileName [200]

Member Enumeration Documentation

enum BaseAnnealer::MOVE_TYPES
 

Enumeration values:
MISC 
NOOP 
REP_SPEC_MIN 
REP_SPEC_ORIENT 
REP_SPEC_MAX 
SLACKS_MOVE 
AR_MOVE 
ORIENT 
SOFT_BL 
HPWL 
ARWL 

Definition at line 72 of file baseannealer.h.

00072                    {MISC = -1,
00073                     NOOP = 0,
00074                     REP_SPEC_MIN = 1, // representation-specific
00075                     REP_SPEC_ORIENT = 2, 
00076                     REP_SPEC_MAX = 5,
00077                     SLACKS_MOVE = 6,
00078                     AR_MOVE = 7,
00079                     ORIENT = 10,
00080                     SOFT_BL = 11,
00081                     HPWL = 12,
00082                     ARWL = 13};


Constructor & Destructor Documentation

BaseAnnealer::BaseAnnealer const parquetfp::Command_Line *const  params,
parquetfp::DB *const  db
 

Definition at line 66 of file baseannealer.cxx.

References _baseFileName, _params, annealTime, Verbosity::forMajStats, parquetfp::Command_Line::getSeed, parquetfp::Command_Line::inFileName, parquetfp::Command_Line::seed, and parquetfp::Command_Line::verb.

00068    : _db(db),
00069      _params(params),
00070      _analSolve(new parquetfp::AnalytSolve(
00071                    const_cast<parquetfp::Command_Line*>(params),
00072                    const_cast<parquetfp::DB*>(db)))
00073 {
00074    // set the random seed for each invokation of the Annealer
00075    int rseed;
00076    if(_params->getSeed)
00077       rseed = int(time((time_t *)NULL));
00078    else
00079       rseed = _params->seed;
00080    
00081    srand(rseed);        //seed for rand function
00082    srand48(rseed);      //seed for random_shuffle function
00083    if(_params->verb.forMajStats > 0)
00084       cout << "The random seed for this run is: " << rseed << endl;
00085    
00086    const char* baseName = _params->inFileName;
00087    strcpy(_baseFileName, baseName);
00088    annealTime = 0.0;
00089 }

BaseAnnealer::~BaseAnnealer  )  [virtual]
 

Definition at line 91 of file baseannealer.cxx.

References _analSolve.

00092 {
00093    if (_analSolve != NULL)
00094       delete _analSolve;
00095 }

BaseAnnealer::BaseAnnealer  )  [inline, protected]
 

Definition at line 108 of file baseannealer.h.

References _analSolve, _db, and _params.

00109       : _db(NULL), _params(NULL), _analSolve(NULL) {}


Member Function Documentation

virtual void BaseAnnealer::compactSoln  )  [pure virtual]
 

Implemented in parquetfp::Annealer, and BTreeAreaWireAnnealer.

Referenced by parquetfp::SolveMulti::go(), and Parquet::go().

virtual bool BaseAnnealer::go  )  [pure virtual]
 

Implemented in parquetfp::Annealer, and BTreeAreaWireAnnealer.

Referenced by parquetfp::SolveMulti::go(), Parquet::go(), and parquetfp::SolveMulti::placeSubBlocks().

virtual bool BaseAnnealer::packOneBlock  )  [pure virtual]
 

Implemented in parquetfp::Annealer, and BTreeAreaWireAnnealer.

void BaseAnnealer::postHPWLOpt  ) 
 

Definition at line 103 of file baseannealer.cxx.

References _db, _params, FREE_OUTLINE, parquetfp::DB::getNodesArea(), parquetfp::Command_Line::maxWS, parquetfp::Command_Line::reqdAR, and parquetfp::DB::shiftOptimizeDesign().

Referenced by Parquet::go().

00104 {
00105 //    parquetfp::Point offset = _analSolve->getDesignOptLoc();
00106 //    cout << "offset.x " << offset.x
00107 //         << " offset.y " << offset.y << endl;
00108    
00109 //    double initHPWL = _db->evalHPWL();
00110 //    cout << "initHPWL: " << initHPWL << endl;
00111 //    _db->shiftDesign(offset);
00112    
00113 //    double afterHPWL = _db->evalHPWL();
00114 //    cout << "afterHPWL: " << afterHPWL << endl;      
00115 //    if(afterHPWL > initHPWL)
00116 //    {
00117 //       cout << "shifting not done." << endl;
00118 //       offset.x *= -1;
00119 //       offset.y *= -1;
00120 //       _db->shiftDesign(offset);
00121 //    }
00122 //    else
00123 //       cout << "shifting is done." << endl;
00124 
00125    // only shift in "fixed-outline" mode
00126    if (_params->reqdAR != FREE_OUTLINE)
00127    {
00128       double blocksArea = _db->getNodesArea();
00129       double reqdAR = _params->reqdAR;
00130       double reqdArea = blocksArea * (1 + _params->maxWS/100.0);
00131       double reqdWidth = sqrt(reqdArea * reqdAR);
00132       double reqdHeight = sqrt(reqdArea / reqdAR);
00133       
00134 //       printf("blocksArea: %.2f reqdWidth: %.2f reqdHeight: %.2f\n",
00135 //              blocksArea, reqdWidth, reqdHeight);
00136       _db->shiftOptimizeDesign(reqdWidth, reqdHeight);
00137    }
00138 }

Here is the call graph for this function:

void BaseAnnealer::printResults const Timer tm,
const SolutionInfo curr
const
 

Definition at line 140 of file baseannealer.cxx.

References _db, _params, BaseAnnealer::SolutionInfo::area, parquetfp::Command_Line::dontClusterMacros, Verbosity::forMajStats, Verbosity::forSysRes, FREE_OUTLINE, parquetfp::DB::getNodesArea(), Timer::getRealTime(), Timer::getUserTime(), parquetfp::DB::getXSizeWMacroOnly(), parquetfp::DB::getYSizeWMacroOnly(), BaseAnnealer::SolutionInfo::height, BaseAnnealer::SolutionInfo::HPWL, HPWL, parquetfp::Command_Line::maxWS, parquetfp::Command_Line::reqdAR, parquetfp::Command_Line::solveTop, parquetfp::Command_Line::verb, and BaseAnnealer::SolutionInfo::width.

Referenced by BTreeAreaWireAnnealer::go(), and parquetfp::Annealer::go().

00142 {
00143    double timeReqd = tm.getUserTime();
00144    double realTime = tm.getRealTime();
00145 
00146    double blocksArea = _db->getNodesArea();
00147    double currArea = curr.area;
00148    double currWidth = curr.width;
00149    double currHeight = curr.height;
00150    double currAR = currWidth / currHeight; 
00151    double whiteSpace = 100 * (currArea - blocksArea) / blocksArea;
00152    double HPWL = curr.HPWL;
00153 
00154    cout.precision(6);
00155    if(_params->verb.forSysRes > 0)
00156       cout << "realTime:" << realTime << "\tuserTime:" << timeReqd << endl;
00157    if(_params->verb.forMajStats > 0)
00158       cout << "Final Area: " << currArea << " WhiteSpace " << whiteSpace
00159            << "%" << " AR " << currAR << " HPWL " << HPWL << endl;
00160 
00161    double reqdAR = _params->reqdAR;
00162    double reqdArea = blocksArea * (1 + _params->maxWS/100.0);
00163    double reqdWidth = sqrt(reqdArea * reqdAR);
00164    double reqdHeight = sqrt(reqdArea / reqdAR);
00165    
00166    if(_params->verb.forMajStats > 0)
00167    {
00168       if (_params->dontClusterMacros && _params->solveTop)
00169          cout << "width w/ macros only: "
00170               << _db->getXSizeWMacroOnly() << " ";
00171       else
00172          cout << "width:  " << currWidth << " ";
00173 
00174       if (_params->reqdAR != FREE_OUTLINE)
00175          cout << "(outline width:  " << reqdWidth << ") ";
00176       cout << endl;
00177       
00178       if (_params->dontClusterMacros && _params->solveTop)
00179          cout << "height w/ macros only: "
00180               << _db->getYSizeWMacroOnly() << " ";
00181       else
00182          cout << "height: " << currHeight << " ";
00183 
00184       if (_params->reqdAR != FREE_OUTLINE)
00185           cout << "(outline height: " << reqdHeight << ") ";
00186       cout << endl;
00187       
00188       cout << "area utilization (wrt. total current area): "
00189            << (blocksArea / currArea) * 100 << "%." << endl;
00190       cout << "whitespace       (wrt. total current area): " 
00191            << (1 - (blocksArea/currArea)) * 100 << "% " << endl;
00192    }
00193 }

Here is the call graph for this function:

void BaseAnnealer::solveQP  )  [virtual]
 

Definition at line 97 of file baseannealer.cxx.

References _analSolve, _db, parquetfp::AnalytSolve::getXLocs(), parquetfp::AnalytSolve::getYLocs(), parquetfp::AnalytSolve::solveSOR(), and parquetfp::DB::updatePlacement().

Referenced by parquetfp::SolveMulti::go().

00098 {
00099    _analSolve->solveSOR();
00100    _db->updatePlacement(_analSolve->getXLocs(), _analSolve->getYLocs());
00101 }

Here is the call graph for this function:

virtual void BaseAnnealer::takePlfromDB  )  [pure virtual]
 

Implemented in parquetfp::Annealer, and BTreeAreaWireAnnealer.

Referenced by parquetfp::SolveMulti::go(), and Parquet::go().


Member Data Documentation

parquetfp::AnalytSolve* const BaseAnnealer::_analSolve [protected]
 

Definition at line 105 of file baseannealer.h.

Referenced by BaseAnnealer(), BTreeAreaWireAnnealer::locateSearchBlocks(), parquetfp::Annealer::makeARWLMove(), parquetfp::Annealer::makeHPWLMove(), solveQP(), and ~BaseAnnealer().

char BaseAnnealer::_baseFileName[200] [protected]
 

Definition at line 106 of file baseannealer.h.

Referenced by BaseAnnealer().

parquetfp::DB* const BaseAnnealer::_db [protected]
 

Definition at line 103 of file baseannealer.h.

Referenced by BTreeAreaWireAnnealer::anneal(), parquetfp::Annealer::anneal(), BaseAnnealer(), BTreeAreaWireAnnealer::constructor_core(), BTreeAreaWireAnnealer::DBfromSoln(), parquetfp::Annealer::eval(), parquetfp::Annealer::evalCompact(), parquetfp::Annealer::evalSlacks(), BTreeAreaWireAnnealer::go(), parquetfp::Annealer::go(), parquetfp::Annealer::makeIndexSoftBlMove(), parquetfp::Annealer::makeIslands(), parquetfp::Annealer::makeMoveOrient(), parquetfp::Annealer::makeMoveSlacksOrient(), parquetfp::Annealer::makeSoftBlMove(), BTreeAreaWireAnnealer::packOneBlock(), BTreeAreaWireAnnealer::packSoftBlocks(), parquetfp::Annealer::packSoftBlocks(), postHPWLOpt(), printResults(), solveQP(), BTreeAreaWireAnnealer::takePlfromDB(), parquetfp::Annealer::takeSPfromDB(), and parquetfp::Annealer::updatePlacement().

const parquetfp::Command_Line* const BaseAnnealer::_params [protected]
 

Definition at line 104 of file baseannealer.h.

Referenced by BTreeAreaWireAnnealer::anneal(), parquetfp::Annealer::anneal(), BaseAnnealer(), parquetfp::Annealer::compactSoln(), BTreeAreaWireAnnealer::constructor_core(), parquetfp::Annealer::go(), BTreeAreaWireAnnealer::makeARMove(), parquetfp::Annealer::makeARMove(), BTreeAreaWireAnnealer::makeARWLMove(), parquetfp::Annealer::makeARWLMove(), BTreeAreaWireAnnealer::packOneBlock(), BTreeAreaWireAnnealer::packSoftBlocks(), BTreeAreaWireAnnealer::perform_rotate(), postHPWLOpt(), and printResults().

double BaseAnnealer::annealTime
 

Definition at line 100 of file baseannealer.h.

Referenced by BaseAnnealer(), parquetfp::SolveMulti::go(), BTreeAreaWireAnnealer::go(), and parquetfp::Annealer::go().

const int BaseAnnealer::FREE_OUTLINE = -9999 [static]
 

Definition at line 62 of file baseannealer.cxx.

Referenced by BTreeAreaWireAnnealer::anneal(), Parquet::go(), BTreeAreaWireAnnealer::packOneBlock(), postHPWLOpt(), parquetfp::Command_Line::printAnnealerParams(), and printResults().

const int BaseAnnealer::NOT_FOUND = -1 [static]
 

Definition at line 63 of file baseannealer.cxx.

Referenced by BTreeAreaWireAnnealer::getSoftBlIndex(), and BTreeAreaWireAnnealer::makeSoftBlMove().

const int BaseAnnealer::UNINITIALIZED = -1 [static]
 

Definition at line 60 of file baseannealer.cxx.

Referenced by BTreeAreaWireAnnealer::anneal().

const unsigned int BaseAnnealer::UNSIGNED_UNINITIALIZED = 0 [static]
 

Definition at line 61 of file baseannealer.cxx.

Referenced by BTreeAreaWireAnnealer::anneal(), BTreeAreaWireAnnealer::makeARWLMove(), BTreeAreaWireAnnealer::makeHPWLMove(), and BTreeAreaWireAnnealer::makeMove().


The documentation for this class was generated from the following files:
Generated on Mon Apr 25 01:12:53 2005 for Parquete by doxygen 1.3.2