Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed misaligned cells. #132

Merged
merged 2 commits into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cumulus/src/plugins/chip/chip.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ def doChipFloorplan ( self ):
x = (coronaAb.getWidth () - self.conf.coreAb.getWidth ()) // 2
y = (coronaAb.getHeight() - self.conf.coreAb.getHeight()) // 2
trace( 550, '\tCore X, {} '.format(DbU.getValueString(x)) )
x = x - (x % self.conf.sliceHeight)
trace( 550, ' adjusted on {}, {}\n'.format( DbU.getValueString(self.conf.sliceHeight)
x = x - (x % self.conf.sliceStep)
trace( 550, ' adjusted on {}, {}\n'.format( DbU.getValueString(self.conf.sliceStep)
, DbU.getValueString(x)) )
y = y - (y % self.conf.sliceHeight)
self.conf.icore.setTransformation ( Transformation(x,y,Transformation.Orientation.ID) )
Expand Down
4 changes: 2 additions & 2 deletions cumulus/src/plugins/chip/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ def setupICore ( self ):
trace( 550, '\tCORE ab:{}\n'.format(self.coreAb) )
coreX = (self.coronaAb.getWidth () - self.coreAb.getWidth ()) // 2
trace( 550, '\tCore X, {} '.format(DbU.getValueString(coreX)) )
coreX = coreX - (coreX % self.sliceHeight)
trace( 550, ' adjusted on {}, {}\n'.format( DbU.getValueString(self.sliceHeight)
coreX = coreX - (coreX % self.sliceStep)
trace( 550, ' adjusted on {}, {}\n'.format( DbU.getValueString(self.sliceStep)
, DbU.getValueString(coreX)) )
coreY = (self.coronaAb.getHeight() - self.coreAb.getHeight()) // 2
coreY = coreY - (coreY % self.sliceHeight)
Expand Down
33 changes: 25 additions & 8 deletions etesian/src/EtesianEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ namespace {
, DbU::Unit vpitch
)
{
DbU::Unit tx = position.x * vpitch;
DbU::Unit ty = position.y * hpitch;
DbU::Unit tx = position.x * hpitch;
DbU::Unit ty = position.y * vpitch;

Box cellBox = model->getAbutmentBox();
Transformation::Orientation orient = Transformation::Orientation::ID;
Expand Down Expand Up @@ -481,10 +481,11 @@ namespace Etesian {
_placeArea = topAb.getIntersection( placeArea );
}

DbU::Unit sliceStep = getSliceStep();
DbU::Unit sliceHeight = getSliceHeight();
_placeArea = Box( DbU::toCeil ( placeArea.getXMin(), sliceHeight )
_placeArea = Box( DbU::toCeil ( placeArea.getXMin(), sliceStep )
, DbU::toCeil ( placeArea.getYMin(), sliceHeight )
, DbU::toFloor( placeArea.getXMax(), sliceHeight )
, DbU::toFloor( placeArea.getXMax(), sliceStep )
, DbU::toFloor( placeArea.getYMax(), sliceHeight )
);
size_t bottomSlice = (_placeArea.getYMin() - topAb.getYMin()) / sliceHeight;
Expand Down Expand Up @@ -694,7 +695,7 @@ namespace Etesian {
clearColoquinte();
AllianceFramework* af = AllianceFramework::get();
DbU::Unit hpitch = getSliceStep();
DbU::Unit vpitch = getSliceStep();
DbU::Unit vpitch = getSliceHeight(); //getSliceStep();
DbU::Unit sliceHeight = getSliceHeight();
bool isFlexLib = (getGauge()->getName() == "FlexLib");

Expand Down Expand Up @@ -1216,7 +1217,7 @@ namespace Etesian {
for ( Occurrence occurrence : getCell()->getTerminalNetlistInstanceOccurrences(getBlockInstance()) )
{
DbU::Unit hpitch = getSliceStep();
DbU::Unit vpitch = getSliceStep();
DbU::Unit vpitch = getSliceHeight(); //getSliceStep();
Point instancePosition;
Instance* instance = static_cast<Instance*>(occurrence.getEntity());
string instanceName = occurrence.getCompactString();
Expand All @@ -1228,9 +1229,16 @@ namespace Etesian {
if (iid == _instsToIds.end() ) {
cerr << Error( "Unable to lookup instance <%s>.", instanceName.c_str() ) << endl;
} else {
if (instance->getPlacementStatus() == Instance::PlacementStatus::FIXED)
if (instance->getPlacementStatus() == Instance::PlacementStatus::FIXED) {
auto ab = instance->getAbutmentBox();
if ( ab.getXMin() % hpitch ) {
cerr << Error( "Instance <%s> fixed placed out of the hpitch.", instanceName.c_str() ) << endl;
}
if ( ab.getYMin() % vpitch ) {
cerr << Error( "Instance <%s> fixed placed out of the vpitch.", instanceName.c_str() ) << endl;
}
continue;

}
//uint32_t outputSide = getOutputSide( instance->getMasterCell() );
auto place = (*placement)[(*iid).second];
Transformation cellTrans = toTransformation( place.position
Expand All @@ -1245,6 +1253,15 @@ namespace Etesian {
// of all the intermediary instances.
instance->setTransformation( cellTrans );
instance->setPlacementStatus( Instance::PlacementStatus::PLACED );
{
auto ab = instance->getAbutmentBox();
if ( ab.getXMin() % hpitch ) {
cerr << Error( "Instance <%s> placed out of the hpitch.", instanceName.c_str() ) << endl;
}
if ( ab.getYMin() % vpitch ) {
cerr << Error( "Instance <%s> placed out of the vpitch.", instanceName.c_str() ) << endl;
}
}
}
}

Expand Down
Loading