@@ -185,13 +185,14 @@ void ThreeDBlox::writeDbx(const std::string& dbx_file, odb::dbChip* chip)
185185
186186void ThreeDBlox::calculateSize (dbChip* chip)
187187{
188- Rect box ;
189- box .mergeInit ();
188+ Cuboid cuboid ;
189+ cuboid .mergeInit ();
190190 for (auto inst : chip->getChipInsts ()) {
191- box .merge (inst->getBBox ());
191+ cuboid .merge (inst->getCuboid ());
192192 }
193- chip->setWidth (box.dx ());
194- chip->setHeight (box.dy ());
193+ chip->setWidth (cuboid.dx ());
194+ chip->setHeight (cuboid.dy ());
195+ chip->setThickness (cuboid.dz ());
195196}
196197
197198void ThreeDBlox::readHeaderIncludes (const std::vector<std::string>& includes)
@@ -295,30 +296,46 @@ void ThreeDBlox::createChiplet(const ChipletDef& chiplet)
295296 chip,
296297 /* issue_callback*/ false );
297298 }
298- chip->setWidth (chiplet.design_width * db_->getDbuPerMicron ());
299- chip->setHeight (chiplet.design_height * db_->getDbuPerMicron ());
300- chip->setThickness (chiplet.thickness * db_->getDbuPerMicron ());
301- chip->setShrink (chiplet.shrink );
299+ if (chiplet.design_width != -1.0 ) {
300+ chip->setWidth (chiplet.design_width * db_->getDbuPerMicron ());
301+ }
302+ if (chiplet.design_height != -1.0 ) {
303+ chip->setHeight (chiplet.design_height * db_->getDbuPerMicron ());
304+ }
305+ if (chiplet.thickness != -1.0 ) {
306+ chip->setThickness (chiplet.thickness * db_->getDbuPerMicron ());
307+ }
308+ if (chiplet.shrink != -1.0 ) {
309+ chip->setShrink (chiplet.shrink );
310+ }
302311 chip->setTsv (chiplet.tsv );
303312
304- chip->setScribeLineEast (chiplet.scribe_line_right * db_->getDbuPerMicron ());
305- chip->setScribeLineWest (chiplet.scribe_line_left * db_->getDbuPerMicron ());
306- chip->setScribeLineNorth (chiplet.scribe_line_top * db_->getDbuPerMicron ());
307- chip->setScribeLineSouth (chiplet.scribe_line_bottom * db_->getDbuPerMicron ());
308-
309- chip->setSealRingEast (chiplet.seal_ring_right * db_->getDbuPerMicron ());
310- chip->setSealRingWest (chiplet.seal_ring_left * db_->getDbuPerMicron ());
311- chip->setSealRingNorth (chiplet.seal_ring_top * db_->getDbuPerMicron ());
312- chip->setSealRingSouth (chiplet.seal_ring_bottom * db_->getDbuPerMicron ());
313+ if (chiplet.scribe_line_right != -1.0 ) {
314+ chip->setScribeLineEast (chiplet.scribe_line_right * db_->getDbuPerMicron ());
315+ chip->setScribeLineWest (chiplet.scribe_line_left * db_->getDbuPerMicron ());
316+ chip->setScribeLineNorth (chiplet.scribe_line_top * db_->getDbuPerMicron ());
317+ chip->setScribeLineSouth (chiplet.scribe_line_bottom
318+ * db_->getDbuPerMicron ());
319+ }
320+ if (chiplet.seal_ring_right != -1.0 ) {
321+ chip->setSealRingEast (chiplet.seal_ring_right * db_->getDbuPerMicron ());
322+ chip->setSealRingWest (chiplet.seal_ring_left * db_->getDbuPerMicron ());
323+ chip->setSealRingNorth (chiplet.seal_ring_top * db_->getDbuPerMicron ());
324+ chip->setSealRingSouth (chiplet.seal_ring_bottom * db_->getDbuPerMicron ());
325+ }
313326
314327 chip->setOffset (Point (chiplet.offset .x * db_->getDbuPerMicron (),
315328 chiplet.offset .y * db_->getDbuPerMicron ()));
316329 if (chip->getChipType () != dbChip::ChipType::HIER
317330 && chip->getBlock () == nullptr ) {
318331 // blackbox stage, create block
319332 auto block = odb::dbBlock::create (chip, chiplet.name .c_str ());
320- block->setDieArea (Rect (0 , 0 , chip->getWidth (), chip->getHeight ()));
321- block->setCoreArea (Rect (0 , 0 , chip->getWidth (), chip->getHeight ()));
333+ const int x_min = chip->getScribeLineWest () + chip->getSealRingWest ();
334+ const int y_min = chip->getScribeLineSouth () + chip->getSealRingSouth ();
335+ const int x_max = x_min + chip->getWidth ();
336+ const int y_max = y_min + chip->getHeight ();
337+ block->setDieArea (Rect (x_min, y_min, x_max, y_max));
338+ block->setCoreArea (Rect (x_min, y_min, x_max, y_max));
322339 }
323340 for (const auto & [_, region] : chiplet.regions ) {
324341 createRegion (region, chip);
@@ -398,8 +415,11 @@ void ThreeDBlox::createBump(const BumpMapEntry& entry,
398415 auto bump = dbChipBump::create (chip_region, inst);
399416 Rect bbox;
400417 inst->getMaster ()->getPlacementBoundary (bbox);
401- inst->setOrigin ((entry.x * db_->getDbuPerMicron ()) - bbox.xCenter (),
402- (entry.y * db_->getDbuPerMicron ()) - bbox.yCenter ());
418+ int x = (entry.x * db_->getDbuPerMicron ()) - bbox.xCenter ()
419+ + chip->getOffset ().x ();
420+ int y = (entry.y * db_->getDbuPerMicron ()) - bbox.yCenter ()
421+ + chip->getOffset ().y ();
422+ inst->setOrigin (x, y);
403423 inst->setPlacementStatus (dbPlacementStatus::FIRM);
404424 if (entry.net_name != " -" ) {
405425 auto net = block->findNet (entry.net_name .c_str ());
@@ -447,9 +467,6 @@ void ThreeDBlox::createChipInst(const ChipletInst& chip_inst)
447467 chip_inst.name );
448468 }
449469 dbChipInst* inst = dbChipInst::create (db_->getChip (), chip, chip_inst.name );
450- inst->setLoc (Point3D (chip_inst.loc .x * db_->getDbuPerMicron (),
451- chip_inst.loc .y * db_->getDbuPerMicron (),
452- chip_inst.z * db_->getDbuPerMicron ()));
453470 auto orient_str = chip_inst.orient ;
454471 if (dup_orient_map.find (orient_str) != dup_orient_map.end ()) {
455472 orient_str = dup_orient_map[orient_str];
@@ -463,6 +480,9 @@ void ThreeDBlox::createChipInst(const ChipletInst& chip_inst)
463480 chip_inst.name );
464481 }
465482 inst->setOrient (orient.value ());
483+ inst->setLoc (Point3D (chip_inst.loc .x * db_->getDbuPerMicron (),
484+ chip_inst.loc .y * db_->getDbuPerMicron (),
485+ chip_inst.z * db_->getDbuPerMicron ()));
466486}
467487std::vector<std::string> splitPath (const std::string& path)
468488{
0 commit comments