00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 #include "FPcommon.h"
00036 #include "Annealer.h"
00037 #include "CommandLine.h"
00038 #include "ClusterDB.h"
00039 #include "SolveMulti.h"
00040 #include "ABKCommon/paramproc.h"
00041 #include "ABKCommon/infolines.h"
00042 using namespace parquetfp;
00043
00044 int main(int argc, const char *argv[])
00045 {
00046 Timer T;
00047 T.stop();
00048 double currArea, lastArea;
00049 double currWS;
00050 double currWL;
00051 double currXSize;
00052 double currYSize;
00053 double currAR;
00054
00055 BoolParam help1 ("h", argc, argv);
00056 BoolParam help2 ("help", argc, argv);
00057 NoParams noParams(argc,argv);
00058 Command_Line* params = new Command_Line(argc, argv);
00059 params->printAnnealerParams();
00060 if (noParams.found() || help1.found() || help2.found())
00061 {
00062 cerr<<"This test case solves heirarchical floorplans\n"
00063 <<"Options \n"
00064 <<"FPEvalTest4.exe\n"
00065 <<"-f baseFileName\n"
00066 <<"-compact (compact the final multilevel solution)\n"
00067 <<"-plot (plot floorplan)\n"
00068 <<"-save (save in bookshelf floorplan format)\n"
00069 <<"-savePl (save only .pl file)\n"
00070 <<"-saveCapoPl (save .pl in Capo bookshelf format)\n"
00071 <<"-saveCapo (save design in Capo bookshelf format)\n";
00072 exit (0);
00073 }
00074
00075 DB* db = new DB(params->inFileName);
00076
00077 T.start(0.0);
00078 SolveMulti solveMulti(db, params);
00079 solveMulti.go();
00080
00081 if(params->compact)
00082 {
00083
00084 Annealer annealer(params, db);
00085 bool whichDir = 0;
00086 annealer.takeSPfromDB();
00087 annealer.eval();
00088 currArea = annealer.getXSize()*annealer.getYSize();
00089 annealer.evalCompact(whichDir);
00090 do
00091 {
00092 whichDir = !whichDir;
00093 lastArea = currArea;
00094 annealer.takeSPfromDB();
00095 annealer.evalCompact(whichDir);
00096 currArea = annealer.getXSize()*annealer.getYSize();
00097 cout<<currArea<<"\t"<<lastArea<<endl;
00098 }
00099 while(int(currArea) < int(lastArea));
00100 }
00101 T.stop();
00102
00103 double blocksArea = db->getNodesArea();
00104
00105 currXSize = 0;
00106 currYSize = 1;
00107 currArea = db->evalArea();
00108 currWS = 100*(currArea - blocksArea)/blocksArea;
00109 currWL = db->evalHPWL();
00110 currAR = currXSize/currYSize;
00111
00112 if(params->plot)
00113 {
00114 bool plotSlacks = !params->plotNoSlacks;
00115 bool plotNets = !params->plotNoNets;
00116 bool plotNames = !params->plotNoNames;
00117
00118 db->plot("out.plt", currArea, currWS, currAR,
00119 T.getUserTime(), currWL, plotSlacks, plotNets,
00120 plotNames);
00121 }
00122 if(params->savePl)
00123 db->getNodes()->savePl(params->outPlFile);
00124
00125 if(params->saveCapoPl)
00126 db->getNodes()->saveCapoPl(params->capoPlFile);
00127
00128 if(params->saveCapo)
00129 db->saveCapo(params->capoBaseFile, params->reqdAR);
00130
00131 if(params->save)
00132 db->save(params->baseFile);
00133
00134 return 0;
00135 }