-
Notifications
You must be signed in to change notification settings - Fork 865
Fix ODB: DEF_file in 3dbx (Issue #10077) #10096
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
base: master
Are you sure you want to change the base?
Changes from all commits
62eb530
fc03a5e
0b26cd1
362e77f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -398,6 +398,20 @@ static std::string getFileName(const std::string& tech_file_path) | |
| return tech_file_path_fs.stem().string(); | ||
| } | ||
|
|
||
| static inline void readDefForChip(odb::dbDatabase* db, | ||
| utl::Logger* logger, | ||
| odb::dbChip* chip, | ||
| const std::string& def_file) | ||
| { | ||
| odb::defin def_reader(db, logger, odb::defin::DEFAULT); | ||
| std::vector<odb::dbLib*> search_libs; | ||
| for (odb::dbLib* lib : db->getLibs()) { | ||
| search_libs.push_back(lib); | ||
| } | ||
| // No callbacks here as we are going to give one postRead3Dbx later | ||
| def_reader.readChip(search_libs, def_file.c_str(), chip, false); | ||
| } | ||
|
|
||
| void ThreeDBlox::createChiplet(const ChipletDef& chiplet) | ||
| { | ||
| dbTech* tech = nullptr; | ||
|
|
@@ -454,16 +468,7 @@ void ThreeDBlox::createChiplet(const ChipletDef& chiplet) | |
|
|
||
| // Read DEF file | ||
| if (!chiplet.external.def_file.empty()) { | ||
| odb::defin def_reader(db_, logger_, odb::defin::DEFAULT); | ||
| std::vector<odb::dbLib*> search_libs; | ||
| for (odb::dbLib* lib : db_->getLibs()) { | ||
| search_libs.push_back(lib); | ||
| } | ||
| // No callbacks here as we are going to give one postRead3Dbx later | ||
| def_reader.readChip(search_libs, | ||
| chiplet.external.def_file.c_str(), | ||
| chip, | ||
| /*issue_callback*/ false); | ||
| readDefForChip(db_, logger_, chip, chiplet.external.def_file); | ||
| } | ||
| const int dbu_per_micron = db_->getDbuPerMicron(); | ||
| if (chiplet.design_width != -1.0) { | ||
|
|
@@ -677,6 +682,22 @@ void ThreeDBlox::createChipInst(const ChipletInst& chip_inst) | |
| chip_inst.reference, | ||
| chip_inst.name); | ||
| } | ||
|
|
||
| if (!chip_inst.external.def_file.empty()) { | ||
| if (insts_with_def_.contains(chip)) { | ||
| logger_->error(utl::ODB, | ||
| 546, | ||
| "3DBX Parser Error: There can't be 2 instances of the " | ||
| "same chiplet {} with a def file each", | ||
| chip->getName()); | ||
| } | ||
| insts_with_def_.insert(chip); | ||
| if (chip->getBlock() != nullptr) { | ||
| odb::dbBlock::destroy(chip->getBlock()); | ||
| } | ||
| readDefForChip(db_, logger_, chip, chip_inst.external.def_file); | ||
| } | ||
|
Comment on lines
+686
to
+699
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The logic for reading a DEF file for a chiplet is duplicated between References
|
||
|
|
||
| dbChipInst* inst = dbChipInst::create(db_->getChip(), chip, chip_inst.name); | ||
| auto orient_str = chip_inst.orient; | ||
| if (dup_orient_map.contains(orient_str)) { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you probably should log an error here. There can't be 2 instances of the same chiplet with a def file each.