Cleanup to enable routing-driven placement

This commit is contained in:
Gabriel Gouvine 2015-04-20 14:49:12 +02:00
parent ef671cb944
commit 6a6def8252
6 changed files with 52 additions and 37 deletions

View File

@ -14,11 +14,11 @@ projects = [
#, "nimbus"
#, "metis"
#, "mauka"
, "knik"
, "katabatic"
, "kite"
, "coloquinte"
, "etesian"
, "knik"
, "kite"
, "equinox"
, "solstice"
, "unicorn"

View File

@ -130,13 +130,16 @@ class region_distribution{
std::vector<region> prepare_regions(index_t x_cnt, index_t y_cnt) const;
public:
inline box<int_t> placement_area() const;
inline point<float_t> region_dimensions() const;
inline index_t x_regions_cnt() const;
inline index_t y_regions_cnt() const;
inline index_t regions_cnt() const;
inline index_t x_regions_cnt() const;
inline index_t y_regions_cnt() const;
inline index_t regions_cnt() const;
inline index_t cell_cnt() const;
inline index_t fractional_cell_cnt() const;
inline index_t cell_cnt() const;
inline index_t fractional_cell_cnt() const;
/*
* Two types of export
@ -206,6 +209,12 @@ class region_distribution{
inline region_distribution::movable_cell::movable_cell(){}
inline region_distribution::movable_cell::movable_cell(capacity_t demand, point<float_t> p, index_t ind) : demand_(demand), pos_(p), index_in_placement_(ind){}
inline box<int_t> region_distribution::placement_area() const { return placement_area_; }
inline point<float_t> region_distribution::region_dimensions() const {
point<int_t> s = static_cast<point<float_t> >(placement_area().dimensions());
return point<float_t>(s.x_/x_regions_cnt(), s.y_/y_regions_cnt());
}
inline index_t region_distribution::x_regions_cnt() const { return x_regions_cnt_; }
inline index_t region_distribution::y_regions_cnt() const { return y_regions_cnt_; }
inline index_t region_distribution::regions_cnt() const { index_t ret = x_regions_cnt() * y_regions_cnt(); assert(placement_regions_.size() == ret); return ret; }

View File

@ -201,6 +201,7 @@ int_t piecewise_linear_function::last_before(int_t pos) const{
++it;
}
assert(false); // We should have found it if the bound was correct
return -1;
}
int_t piecewise_linear_function::value_at(int_t pos) const{

View File

@ -30,7 +30,8 @@
PyGraphicEtesianEngine.cpp
)
qtX_wrap_cpp( mocCpps ${mocIncludes} )
set( depLibs ${CORIOLIS_PYTHON_LIBRARIES}
set( depLibs ${KATABATIC_LIBRARIES}
${CORIOLIS_PYTHON_LIBRARIES}
${CORIOLIS_LIBRARIES}
${HURRICANE_PYTHON_LIBRARIES}
${HURRICANE_GRAPHICAL_LIBRARIES}

View File

@ -603,6 +603,31 @@ namespace Etesian {
_progressReport2(" [--]" );
}
void EtesianEngine::roughLegalize( float minDisruption, unsigned options ){
using namespace coloquinte::gp;
// Create a legalizer and bipartition it until we have sufficient precision
auto legalizer = (options & ForceUniformDensity) != 0 ?
region_distribution::uniform_density_distribution (_surface, _circuit, _placementLB, _densityLimits)
: region_distribution::full_density_distribution (_surface, _circuit, _placementLB, _densityLimits);
while(legalizer.region_dimensions().x_ > 2*legalizer.region_dimensions().y_)
legalizer.x_bipartition();
while(2*legalizer.region_dimensions().x_ < legalizer.region_dimensions().y_)
legalizer.y_bipartition();
while( std::max(legalizer.region_dimensions().x_, legalizer.region_dimensions().y_)*4 > minDisruption ) {
legalizer.x_bipartition();
legalizer.y_bipartition();
legalizer.redo_line_partitions();
legalizer.redo_diagonal_bipartitions();
legalizer.redo_line_partitions();
legalizer.redo_diagonal_bipartitions();
legalizer.selfcheck();
}
// Keep the orientation between LB and UB
_placementUB = _placementLB;
// Update UB
get_rough_legalization( _circuit, _placementUB, legalizer );
}
void EtesianEngine::feedRoutingBack(){
using namespace Katabatic;
/*
@ -656,25 +681,7 @@ namespace Etesian {
index_t i=0;
do{
// Create a legalizer and bipartition it until we have sufficient precision
auto legalizer = (options & ForceUniformDensity) != 0 ?
region_distribution::uniform_density_distribution (_surface, _circuit, _placementLB, _densityLimits)
: region_distribution::full_density_distribution (_surface, _circuit, _placementLB, _densityLimits);
// Until there is about 10 standard cells per region
for ( int quad_part=0 ; _circuit.cell_cnt() > (index_t)(10 * (1 << (quad_part*2))) ; ++quad_part ) {
legalizer.x_bipartition();
legalizer.y_bipartition();
legalizer.redo_line_partitions();
legalizer.redo_diagonal_bipartitions();
legalizer.redo_line_partitions();
legalizer.redo_diagonal_bipartitions();
legalizer.selfcheck();
}
// Keep the orientation between LB and UB
_placementUB = _placementLB;
// Update UB
get_rough_legalization( _circuit, _placementUB, legalizer );
roughLegalize(minDisruption, options);
if(options & UpdateUB)
_updatePlacement( _placementUB );
@ -699,11 +706,6 @@ namespace Etesian {
if(options & UpdateLB)
_updatePlacement( _placementLB );
// First way to exit the loop: the legalization is close enough to the previous result
linearDisruption = get_mean_linear_disruption(_circuit, _placementLB, _placementUB);
if(linearDisruption <= minDisruption)
break;
// Optimize orientation sometimes
if (i%5 == 0) {
optimize_exact_orientations( _circuit, _placementLB );
@ -728,9 +730,11 @@ namespace Etesian {
pullingForce += penaltyIncrease;
prevOptRatio = optRatio;
linearDisruption = get_mean_linear_disruption(_circuit, _placementLB, _placementUB);
++i;
// Second way to exit the loop: UB and LB difference is <10%
}while(prevOptRatio <= 0.9);
// First way to exit the loop: UB and LB difference is <10%
// Second way to exit the loop: the legalization is close enough to the previous result
}while(linearDisruption > minDisruption and prevOptRatio <= 0.9);
_updatePlacement( _placementUB );
}
@ -739,6 +743,7 @@ namespace Etesian {
using namespace coloquinte::dp;
int_t sliceHeight = getSliceHeight() / getPitch();
roughLegalize(sliceHeight, options);
for ( int i=0; i<iterations; ++i ){
ostringstream label;

View File

@ -79,8 +79,7 @@ namespace Etesian {
void toColoquinte ();
void preplace ();
void roughLegalize ( float minDisruption );
void completeLegalize ();
void roughLegalize ( float minDisruption, unsigned options );
void globalPlace ( float initPenalty, float minDisruption, float targetImprovement, float minInc, float maxInc, unsigned options=0 );
void detailedPlace ( int iterations, int effort, unsigned options=0 );
void feedRoutingBack ();