Skip to content
This repository has been archived by the owner on Jan 26, 2021. It is now read-only.

Commit

Permalink
Sync Up
Browse files Browse the repository at this point in the history
Consider onlyDP flow
PIN structure initialize
LEF/DEF-unit strategy changed
debug for compiling gcc/5.4.0 -- openMP statement fix
low-density control
Overcome the DP's problem w.r.t row's order
Bookshelf clean up
  • Loading branch information
mgwoo committed Sep 15, 2018
1 parent abff122 commit 73cb0d3
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 28 deletions.
45 changes: 26 additions & 19 deletions src/bookShelfIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<int>& netChk, bool isShapeDrawing) {

char fn_nets[BUF_SZ] = {0, };
sprintf(fn_nets, "%s/%s.nets", dir_tier, gbch);
Expand All @@ -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);
Expand Down Expand Up @@ -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<ROW> tmpRowStor;
for(int i=0; i<tier->row_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");
}

Expand Down Expand Up @@ -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<netCNT; i++) {
netInstance[i].tier = -1;
}
vector<int> netChk( netCNT, -1);

for(int i = 0; i < pinCNT; i++) {
pin = &pinInstance[i];
Expand All @@ -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++;
}
}
Expand All @@ -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];
Expand All @@ -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;
Expand Down
8 changes: 7 additions & 1 deletion src/detailPlace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions src/global.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 10 additions & 6 deletions src/lefdefIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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; i<pinCNT; i++) {
new (&pinInstance[i]) PIN;
}

TERM* curTerm = NULL;
MODULE* curModule = NULL;
Expand All @@ -1007,11 +1010,7 @@ void GenerateNetDefOnly(Circuit::Circuit &__ckt) {
mPinName.resize(moduleCNT);

for(auto& net : __ckt.defNetStor) {
// skip for Power/Ground/Reset Nets
if( net.hasUse() ) {
continue;
}


if( strcmp (net.name(), "iccad_clk") == 0 ||
strcmp( net.name(), "clk") == 0 ||
strcmp( net.name(), "clock") == 0 ) {
Expand All @@ -1023,6 +1022,11 @@ void GenerateNetDefOnly(Circuit::Circuit &__ckt) {
clockNetsDef.push_back( &net - &__ckt.defNetStor[0]);
continue;
}

// skip for Power/Ground/Reset Nets
if( net.hasUse() ) {
continue;
}

curNet = &netInstance[netIdx];
strcpy( curNet->name, net.name() );
Expand Down
2 changes: 1 addition & 1 deletion src/ns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 5 additions & 1 deletion src/opt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 73cb0d3

Please sign in to comment.