コード例 #1
0
ファイル: config1.c プロジェクト: 5432935/crossbridge
void config1(void)
{

CELLBOXPTR cellptr ;
TILEBOXPTR tileptr ;
int l , r , b , t , totalArea , cell ;


/*
 *   Sum the areas of the cells
 */
totalArea = 0 ;
for( cell = 1 ; cell <= numcells ; cell++ ) {
    cellptr = cellarray[cell] ;
    if( cellptr->numtiles == 1 ) {
	tileptr = cellptr->config[cellptr->orient] ;
	l = tileptr->left   ;
	r = tileptr->right  ;
	b = tileptr->bottom ;
	t = tileptr->top    ;
	totalArea += (r - l) * (t - b) ;
    } else {
	tileptr = cellptr->config[cellptr->orient]->nexttile ;
	for( ; tileptr != TILENULL; tileptr = tileptr->nexttile ){
	    l = tileptr->left   ;
	    r = tileptr->right  ;
	    b = tileptr->bottom ;
	    t = tileptr->top    ;
	    totalArea += (r - l) * (t - b) ;
	}
    }
}
if( coreGiven == 0 ) {
    blockr = blockt = (int) sqrt( (double) totalArea ) + 1 ;
    totChanLen = perim / 2 - (blockr + blockt) ;
    aveChanWid = 0 ;
} else {
    r = t = (int) sqrt( (double) totalArea ) + 1 ;
    totChanLen = perim / 2 - (r + t) ;
    aveChanWid = 0 ;
}

slopeX = (double)(maxWeight - baseWeight) / ( (double) blockr * 0.5 ) ;
slopeY = (double)(maxWeight - baseWeight) / ( (double) blockt * 0.5 ) ;
basefactor = (double) baseWeight ;

placepads() ;

blockmx = (blockr + blockl) / 2 ;
blockmy = (blockt + blockb) / 2 ;

binWidthX = (blockr - blockl) / numBinsX ;
if( (blockr - blockl - binWidthX * numBinsX) >= numBinsX / 2 ) {
    binWidthX++ ;
}
binOffsetX = blockl + 1 - binWidthX ;

binWidthY = (blockt - blockb) / numBinsY ;
if( (blockt - blockb - binWidthY * numBinsY) >= numBinsY / 2 ) {
    binWidthY++ ;
}
binOffsetY = blockb + 1 - binWidthY ;

loadbins(1) ;

return ;
}
コード例 #2
0
ファイル: finalout.c プロジェクト: ChunHungLiu/timberwolf
finalout()
{

INT c ;
INT bbtop, bbbottom, bbleft, bbright ;

/* dump the results of the placement to graphics file */
G( graphics_dump() ) ;
G( TWsetMode(1) ) ;
G( draw_the_data() ) ;
G( TWsetMode(0) ) ;


/* we known wire area at this point don't need to estimate */
turn_wireest_on(FALSE) ;

/* let the user know which pins we couldn't place */
set_pin_verbosity( TRUE ) ;

/* before channel graph generation and global routing let use tweak */
/* placement if desired */
if( doGraphicsG && wait_for_userG ){
    G( TWmessage( "TimberWolfMC waiting for your response" ) ) ;
    G( process_graphics() ) ;
} 

savewolf( TRUE ) ;  /* for debug purposes force save to occur */
if( scale_dataG > 1 ){
    /* end of the line for scaled case - 
	will return to parent to continue using saved placement. */
    closegraphics() ;
    YexitPgm( PGMOK ) ;
}
grid_cells() ;      /* force cells to grid locations */
compact(VIOLATIONSONLY); /* remove cell overlap */

/* if this is a partitioning run determine row placement */
if( doPartitionG && !(quickrouteG) ){
    set_determine_side( FALSE ) ;  /* allow SC to pick side */
    G( set_graphic_context( PARTITION_PLACEMENT ) ) ;
    config_rows() ;
    print_paths() ; /* print path information */
    Output( 0 ) ;
    return ;
}
/* do final placement of pads using virtual core to insure pads */
/* are outside of core */
setVirtualCore( TRUE ) ;
placepads() ;

/* before channel graph generation and global routing let use tweak */
/* placement if desired */
check_graphics() ;

if( !scale_dataG ){ 
    /* reload bins to get new overlap penalty */
    loadbins(FALSE) ; /* wireArea not known */
}
prnt_cost( "\nFINAL PLACEMENT RESULTS AFTER VIOLATION REMOVAL ARE:\n" ) ;

print_paths() ; /* print path information */
Output( 0 ) ;

if( doCompactionG > 0 || quickrouteG ) {
    gmain( CHANNELGRAPH ) ;
    rmain( NOCONSTRAINTS ) ;
    gmain( UPDATE_ROUTING ) ;
    adapt_wire_estimator() ;
    check_graphics() ;

    if( quickrouteG ){
	return ;
    }

    for( c = 1 ; c <= doCompactionG ; c++ ) {

	funccostG = findcost() ;
	sprintf(YmsgG,"\n\nCompactor Pass Number: %d begins with:\n", c ) ;
	prnt_cost( YmsgG ) ;

	wirecosts() ;


	grid_cells() ;      /* force cells to grid locations */
	compact(COMPACT);   /* remove white space */
	reorigin() ;
	check_graphics() ;

	sprintf(YmsgG,"\n\nCompactor Pass Number: %d after cost:\n", c ) ;
	prnt_cost( YmsgG ) ;

	Output( c ) ;

	gmain( CHANNELGRAPH ) ;

	if( c == doCompactionG ){
	    rmain( CONSTRAINTS ) ;
	} else {
	    rmain( NOCONSTRAINTS ) ;
	    gmain( UPDATE_ROUTING ) ;
	    adapt_wire_estimator() ;
	    check_graphics() ;
	}

    } /* end compaction - global route loop */

} else {
    if( doChannelGraphG ) {
	gmain( CHANNELGRAPH ) ;
    }
    if( doGlobalRouteG ) {
	rmain( CONSTRAINTS ) ;
    }
}


prnt_cost("\nTIMBERWOLFMC FINAL RESULTS ARE:\n" ) ;

return ;
} /* end finalout */