@@ -89,7 +89,6 @@ void ThreeDBlox::readDbx(const std::string& dbx_file)
8989 }
9090 calculateSize (db_->getChip ());
9191 db_->triggerPostRead3Dbx (chip);
92- check ();
9392}
9493
9594void ThreeDBlox::check ()
@@ -192,13 +191,14 @@ void ThreeDBlox::writeDbx(const std::string& dbx_file, odb::dbChip* chip)
192191
193192void ThreeDBlox::calculateSize (dbChip* chip)
194193{
195- Rect box ;
196- box .mergeInit ();
194+ Cuboid cuboid ;
195+ cuboid .mergeInit ();
197196 for (auto inst : chip->getChipInsts ()) {
198- box .merge (inst->getBBox ());
197+ cuboid .merge (inst->getCuboid ());
199198 }
200- chip->setWidth (box.dx ());
201- chip->setHeight (box.dy ());
199+ chip->setWidth (cuboid.dx ());
200+ chip->setHeight (cuboid.dy ());
201+ chip->setThickness (cuboid.dz ());
202202}
203203
204204void ThreeDBlox::readHeaderIncludes (const std::vector<std::string>& includes)
@@ -302,30 +302,46 @@ void ThreeDBlox::createChiplet(const ChipletDef& chiplet)
302302 chip,
303303 /* issue_callback*/ false );
304304 }
305- chip->setWidth (chiplet.design_width * db_->getDbuPerMicron ());
306- chip->setHeight (chiplet.design_height * db_->getDbuPerMicron ());
307- chip->setThickness (chiplet.thickness * db_->getDbuPerMicron ());
308- chip->setShrink (chiplet.shrink );
305+ if (chiplet.design_width != -1.0 ) {
306+ chip->setWidth (chiplet.design_width * db_->getDbuPerMicron ());
307+ }
308+ if (chiplet.design_height != -1.0 ) {
309+ chip->setHeight (chiplet.design_height * db_->getDbuPerMicron ());
310+ }
311+ if (chiplet.thickness != -1.0 ) {
312+ chip->setThickness (chiplet.thickness * db_->getDbuPerMicron ());
313+ }
314+ if (chiplet.shrink != -1.0 ) {
315+ chip->setShrink (chiplet.shrink );
316+ }
309317 chip->setTsv (chiplet.tsv );
310318
311- chip->setScribeLineEast (chiplet.scribe_line_right * db_->getDbuPerMicron ());
312- chip->setScribeLineWest (chiplet.scribe_line_left * db_->getDbuPerMicron ());
313- chip->setScribeLineNorth (chiplet.scribe_line_top * db_->getDbuPerMicron ());
314- chip->setScribeLineSouth (chiplet.scribe_line_bottom * db_->getDbuPerMicron ());
315-
316- chip->setSealRingEast (chiplet.seal_ring_right * db_->getDbuPerMicron ());
317- chip->setSealRingWest (chiplet.seal_ring_left * db_->getDbuPerMicron ());
318- chip->setSealRingNorth (chiplet.seal_ring_top * db_->getDbuPerMicron ());
319- chip->setSealRingSouth (chiplet.seal_ring_bottom * db_->getDbuPerMicron ());
319+ if (chiplet.scribe_line_right != -1.0 ) {
320+ chip->setScribeLineEast (chiplet.scribe_line_right * db_->getDbuPerMicron ());
321+ chip->setScribeLineWest (chiplet.scribe_line_left * db_->getDbuPerMicron ());
322+ chip->setScribeLineNorth (chiplet.scribe_line_top * db_->getDbuPerMicron ());
323+ chip->setScribeLineSouth (chiplet.scribe_line_bottom
324+ * db_->getDbuPerMicron ());
325+ }
326+ if (chiplet.seal_ring_right != -1.0 ) {
327+ chip->setSealRingEast (chiplet.seal_ring_right * db_->getDbuPerMicron ());
328+ chip->setSealRingWest (chiplet.seal_ring_left * db_->getDbuPerMicron ());
329+ chip->setSealRingNorth (chiplet.seal_ring_top * db_->getDbuPerMicron ());
330+ chip->setSealRingSouth (chiplet.seal_ring_bottom * db_->getDbuPerMicron ());
331+ }
320332
321333 chip->setOffset (Point (chiplet.offset .x * db_->getDbuPerMicron (),
322334 chiplet.offset .y * db_->getDbuPerMicron ()));
323335 if (chip->getChipType () != dbChip::ChipType::HIER
324336 && chip->getBlock () == nullptr ) {
325337 // blackbox stage, create block
326338 auto block = odb::dbBlock::create (chip, chiplet.name .c_str ());
327- block->setDieArea (Rect (0 , 0 , chip->getWidth (), chip->getHeight ()));
328- block->setCoreArea (Rect (0 , 0 , chip->getWidth (), chip->getHeight ()));
339+ const int x_min = chip->getScribeLineWest () + chip->getSealRingWest ();
340+ const int y_min = chip->getScribeLineSouth () + chip->getSealRingSouth ();
341+ const int x_max = x_min + chip->getWidth ();
342+ const int y_max = y_min + chip->getHeight ();
343+ block->setDieArea (Rect (x_min, y_min, x_max, y_max));
344+ block->setCoreArea (Rect (x_min, y_min, x_max, y_max));
329345 }
330346 for (const auto & [_, region] : chiplet.regions ) {
331347 createRegion (region, chip);
@@ -405,8 +421,11 @@ void ThreeDBlox::createBump(const BumpMapEntry& entry,
405421 auto bump = dbChipBump::create (chip_region, inst);
406422 Rect bbox;
407423 inst->getMaster ()->getPlacementBoundary (bbox);
408- inst->setOrigin ((entry.x * db_->getDbuPerMicron ()) - bbox.xCenter (),
409- (entry.y * db_->getDbuPerMicron ()) - bbox.yCenter ());
424+ int x = (entry.x * db_->getDbuPerMicron ()) - bbox.xCenter ()
425+ + chip->getOffset ().x ();
426+ int y = (entry.y * db_->getDbuPerMicron ()) - bbox.yCenter ()
427+ + chip->getOffset ().y ();
428+ inst->setOrigin (x, y);
410429 inst->setPlacementStatus (dbPlacementStatus::FIRM);
411430 if (entry.net_name != " -" ) {
412431 auto net = block->findNet (entry.net_name .c_str ());
@@ -454,9 +473,6 @@ void ThreeDBlox::createChipInst(const ChipletInst& chip_inst)
454473 chip_inst.name );
455474 }
456475 dbChipInst* inst = dbChipInst::create (db_->getChip (), chip, chip_inst.name );
457- inst->setLoc (Point3D (chip_inst.loc .x * db_->getDbuPerMicron (),
458- chip_inst.loc .y * db_->getDbuPerMicron (),
459- chip_inst.z * db_->getDbuPerMicron ()));
460476 auto orient_str = chip_inst.orient ;
461477 if (dup_orient_map.find (orient_str) != dup_orient_map.end ()) {
462478 orient_str = dup_orient_map[orient_str];
@@ -470,6 +486,9 @@ void ThreeDBlox::createChipInst(const ChipletInst& chip_inst)
470486 chip_inst.name );
471487 }
472488 inst->setOrient (orient.value ());
489+ inst->setLoc (Point3D (chip_inst.loc .x * db_->getDbuPerMicron (),
490+ chip_inst.loc .y * db_->getDbuPerMicron (),
491+ chip_inst.z * db_->getDbuPerMicron ()));
473492}
474493std::vector<std::string> splitPath (const std::string& path)
475494{
0 commit comments