diff --git a/src/bookShelfIO.cpp b/src/bookShelfIO.cpp index 9d67b69..e8438ec 100644 --- a/src/bookShelfIO.cpp +++ b/src/bookShelfIO.cpp @@ -3255,7 +3255,8 @@ void WriteNodes( char* dir_tier, int curLayer, int lab, int pin_term_cnt, bool i } // *.nets writing -void WriteNet( char* dir_tier, int curLayer, int pin_cnt, int net_cnt, bool isShapeDrawing) { +void WriteNet( char* dir_tier, int curLayer, int pin_cnt, int net_cnt, + vector& netChk, bool isShapeDrawing) { char fn_nets[BUF_SZ] = {0, }; sprintf(fn_nets, "%s/%s.nets", dir_tier, gbch); @@ -3281,8 +3282,9 @@ void WriteNet( char* dir_tier, int curLayer, int pin_cnt, int net_cnt, bool isSh total_pinCNTinObject2 += net->pinCNTinObject2; - if(net->tier != curLayer) + if( netChk[i] != 1 ){ continue; + } fprintf(fp_nets, "NetDegree : %d %s\n", net->pinCNTinObject_tier, net->name); @@ -3458,18 +3460,25 @@ void WriteScl( char* dir_tier, int curLayer ) { fprintf(fp_scl, "NumRows : \t%d\n", tier->row_cnt + tier->row_term_cnt); fputs("\n", fp_scl); - for(int i = 0; i < tier->row_cnt; i++) { - ROW* row = &(tier->row_st[i]); - + // sort the Y-Order due to limit of DP + vector tmpRowStor; + for(int i=0; irow_cnt; i++) { + tmpRowStor.push_back(row_st[i]); + } + sort( tmpRowStor.begin(), tmpRowStor.end(), [](ROW& lhs, ROW& rhs) { + return (lhs.pmin.y < rhs.pmin.y);}); + + // iterate based on the sorted order + for(auto& curRow : tmpRowStor){ fprintf(fp_scl, "CoreRow Horizontal\n"); - fprintf(fp_scl, " Coordinate : %d\n", row->pmin.y); + fprintf(fp_scl, " Coordinate : %d\n", curRow.pmin.y); fprintf(fp_scl, " Height : %d\n", (int)(rowHeight+0.5f)); - fprintf(fp_scl, " Sitewidth : %d\n", row->site_wid); - fprintf(fp_scl, " Sitespacing : %d\n", row->site_spa); - fprintf(fp_scl, " Siteorient : %s\n", (row->isYSymmetry)? "Y" : "1"); - fprintf(fp_scl, " Sitesymmetry : %s\n", row->ori.c_str()); + fprintf(fp_scl, " Sitewidth : %d\n", curRow.site_wid); + fprintf(fp_scl, " Sitespacing : %d\n", curRow.site_spa); + fprintf(fp_scl, " Siteorient : %s\n", (curRow.isYSymmetry)? "Y" : "1"); + fprintf(fp_scl, " Sitesymmetry : %s\n", curRow.ori.c_str()); fprintf(fp_scl, " SubrowOrigin : %d\tNumSites : %d\n", - row->pmin.x, row->x_cnt); + curRow.pmin.x, curRow.x_cnt); fprintf(fp_scl, "End\n"); } @@ -3499,9 +3508,7 @@ void WriteBookshelfWithTier(int z, int lab, bool isShapeDrawing) { int net_cnt = 0; // to calculate net_cnt - for(int i=0; i netChk( netCNT, -1); for(int i = 0; i < pinCNT; i++) { pin = &pinInstance[i]; @@ -3511,9 +3518,8 @@ void WriteBookshelfWithTier(int z, int lab, bool isShapeDrawing) { pin_term_cnt++; } else if(pin->tier == z) { - net = &netInstance[pin->netID]; - if(net->tier < z) { - net->tier = z; + if(netChk[pin->netID] == -1) { + netChk[pin->netID] = 1; net_cnt++; } } @@ -3528,8 +3534,9 @@ void WriteBookshelfWithTier(int z, int lab, bool isShapeDrawing) { net = &netInstance[i]; net->pinCNTinObject_tier = 0; - if(net->tier != z) + if( netChk[i] != 1 ) { continue; + } for(int j = 0; j < net->pinCNTinObject2; j++) { pin = net->pin[j]; @@ -3548,7 +3555,7 @@ void WriteBookshelfWithTier(int z, int lab, bool isShapeDrawing) { // cout << "shape finish" << endl; WriteNodes( dir_tier, z, lab, pin_term_cnt, isShapeDrawing ); // cout << "nodes finish" << endl; - WriteNet( dir_tier, z, pin_cnt, net_cnt, isShapeDrawing ); + WriteNet( dir_tier, z, pin_cnt, net_cnt, netChk, isShapeDrawing ); // cout << "net finish" << endl; WritePl( dir_tier, z, lab, isShapeDrawing ); // cout << "pl finish" << endl; diff --git a/src/detailPlace.cpp b/src/detailPlace.cpp index d4c42fb..838727b 100644 --- a/src/detailPlace.cpp +++ b/src/detailPlace.cpp @@ -148,11 +148,17 @@ void call_FastDP_tier(char *tier_dir, char *tier_aux, char *tier_pl) { void CallNtuPlacer3(char *tier_dir, char *tier_aux, char *tier_pl) { char cmd[BUF_SZ] = {0, }; - if(INPUT_FLG == ISPD || INPUT_FLG == MMS || INPUT_FLG == ETC) { +// if(INPUT_FLG == ISPD || INPUT_FLG == MMS) { + if(hasDensityDP || + INPUT_FLG == ISPD || INPUT_FLG == MMS ) { sprintf(cmd, "%s -aux %s/%s -loadpl %s/%s -util %.2lf -noglobal \n", dpLocation.c_str(), tier_dir, tier_aux, tier_dir, tier_pl, ((hasDensityDP)? densityDP : target_cell_den)); } + else if( isOnlyLGinDP ){ + sprintf(cmd, "%s -aux %s/%s -loadpl %s/%s -noglobal -nodetail\n", + dpLocation.c_str(), tier_dir, tier_aux, tier_dir, tier_pl); + } else { sprintf(cmd, "%s -aux %s/%s -loadpl %s/%s -noglobal \n", dpLocation.c_str(), tier_dir, tier_aux, tier_dir, tier_pl); diff --git a/src/global.h b/src/global.h index 238ce27..33665c0 100644 --- a/src/global.h +++ b/src/global.h @@ -349,6 +349,7 @@ struct PIN { int Y_MIN; int X_MAX; int Y_MAX; + PIN() { fp.SetZero(); e1.SetZero(); e2.SetZero(); flg1.SetZero(); flg2.SetZero();} }; // for saving pinName diff --git a/src/lefdefIO.cpp b/src/lefdefIO.cpp index 5d634a1..c6db6a8 100644 --- a/src/lefdefIO.cpp +++ b/src/lefdefIO.cpp @@ -188,7 +188,7 @@ void SetParameter() { if( __ckt.lefUnit.hasDatabase() ) { cout << "\n** WARNING : LEF unit Info is missing..! (UNITS/DATABASE)" << endl; } - cout << "INFO: LEF UNIT: " << l2d << endl; + cout << "INFO: DEF SCALE UNIT: " << l2d << endl; if( __ckt.lefLayerStor.size() == 0) { cout << "\n** ERROR : LAYER statements not exists in lef file!" << endl; @@ -992,6 +992,9 @@ void GenerateNetDefOnly(Circuit::Circuit &__ckt) { // memory reserve netInstance = (NET*) mkl_malloc( sizeof(NET)* netCNT, 64 ); pinInstance = (PIN*) mkl_malloc( sizeof(PIN)* pinCNT, 64 ); + for(int i=0; iname, net.name() ); diff --git a/src/ns.cpp b/src/ns.cpp index 6f77e46..45b5f02 100644 --- a/src/ns.cpp +++ b/src/ns.cpp @@ -579,7 +579,7 @@ int myNesterov::DoNesterovOptimization() { #pragma omp parallel \ default(none) \ private(j) \ - shared( x_st, start_idx, end_idx, gcell_st, cof, x0_st, y0_st ) + shared( gcell_st ) { FPOS u, v; FPOS half_desize; diff --git a/src/opt.cpp b/src/opt.cpp index 2b78b30..183be29 100644 --- a/src/opt.cpp +++ b/src/opt.cpp @@ -128,8 +128,12 @@ int setup_before_opt_cGP2D(void) { tile_init_cGP2D(); // if (isRoutabilityInit == false) routability_init(); - if(dim_bin_cGP2D.x <= dim_bin.x && dim_bin_cGP2D.y <= dim_bin.y) + if(dim_bin_cGP2D.x <= dim_bin.x && dim_bin_cGP2D.y <= dim_bin.y) { + cout << "** ERROR: Minimum required Density is too low" << endl; + cout << " Try Skip IP (initial placement) commend." << endl; + exit(0); return 0; + } charge_fft_init(dim_bin_cGP2D, bin_stp_cGP2D, 0); wcof_init(bin_stp_cGP2D);