Skip to content

Commit

Permalink
mpl2: remove liberty cell checking
Browse files Browse the repository at this point in the history
Signed-off-by: Arthur Koucher <arthurckoucher@gmail.com>
  • Loading branch information
AcKoucher committed May 22, 2024
1 parent 19167b6 commit 4b4fc52
Showing 1 changed file with 11 additions and 49 deletions.
60 changes: 11 additions & 49 deletions src/mpl2/src/hier_rtlmp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -566,10 +566,6 @@ void HierRTLMP::treatEachMacroAsSingleCluster()
{
auto module = block_->getTopModule();
for (odb::dbInst* inst : module->getInsts()) {
const sta::LibertyCell* liberty_cell = network_->libertyCell(inst);
if (liberty_cell == nullptr) {
continue;
}
odb::dbMaster* master = inst->getMaster();

if (master->isPad() || master->isCover()) {
Expand Down Expand Up @@ -673,11 +669,6 @@ Metrics* HierRTLMP::computeMetrics(odb::dbModule* module)
float macro_area = 0.0;

for (odb::dbInst* inst : module->getInsts()) {
const sta::LibertyCell* liberty_cell = network_->libertyCell(inst);
if (liberty_cell == nullptr) {
continue;
}

odb::dbMaster* master = inst->getMaster();

if (master->isPad() || master->isCover()) {
Expand Down Expand Up @@ -1156,16 +1147,12 @@ void HierRTLMP::breakCluster(Cluster* parent)
= std::string("(") + parent->getName() + ")_glue_logic";
Cluster* cluster = new Cluster(cluster_id_, cluster_name, logger_);
for (odb::dbInst* inst : module->getInsts()) {
const sta::LibertyCell* liberty_cell = network_->libertyCell(inst);
if (liberty_cell == nullptr) {
continue;
}
odb::dbMaster* master = inst->getMaster();
// check if the instance is a Pad, Cover or empty block (such as
// marker)

if (master->isPad() || master->isCover()) {
continue;
}

if (master->isBlock()) {
cluster->addLeafMacro(inst);
} else {
Expand All @@ -1186,10 +1173,6 @@ void HierRTLMP::breakCluster(Cluster* parent)
}
} else {
for (odb::dbInst* inst : module->getInsts()) {
const sta::LibertyCell* liberty_cell = network_->libertyCell(inst);
if (liberty_cell == nullptr) {
continue;
}
odb::dbMaster* master = inst->getMaster();
// check if the instance is a Pad, Cover or empty block (such as
// marker)
Expand Down Expand Up @@ -1225,10 +1208,6 @@ void HierRTLMP::breakCluster(Cluster* parent)
= std::string("(") + parent->getName() + ")_glue_logic";
Cluster* cluster = new Cluster(cluster_id_, cluster_name, logger_);
for (odb::dbInst* inst : module->getInsts()) {
const sta::LibertyCell* liberty_cell = network_->libertyCell(inst);
if (liberty_cell == nullptr) {
continue;
}
odb::dbMaster* master = inst->getMaster();
// check if the instance is a Pad, Cover or empty block (such as marker)
if (master->isPad() || master->isCover()) {
Expand Down Expand Up @@ -1513,12 +1492,6 @@ void HierRTLMP::calculateConnection()

for (odb::dbITerm* iterm : net->getITerms()) {
odb::dbInst* inst = iterm->getInst();
const sta::LibertyCell* liberty_cell = network_->libertyCell(inst);

if (liberty_cell == nullptr) {
continue;
}

odb::dbMaster* master = inst->getMaster();

if (master->isPad() || master->isCover()) {
Expand Down Expand Up @@ -1590,23 +1563,23 @@ void HierRTLMP::createDataFlow()
io_pin_vertex[stop_flag_vec.size()] = term;
stop_flag_vec.push_back(true);
}

// assign vertex_id property of each instance
for (auto inst : block_->getInsts()) {
const sta::LibertyCell* liberty_cell = network_->libertyCell(inst);
if (liberty_cell == nullptr) {
continue;
}
odb::dbMaster* master = inst->getMaster();
// check if the instance is a Pad, Cover or a block
// We ignore nets connecting Pads, Covers
// for blocks, we iterate over the block pins
if (master->isPad() || master->isCover() || master->isBlock()) {
continue;
}

// mark sequential instances
odb::dbIntProperty::create(inst, "vertex_id", stop_flag_vec.size());
std_cell_vertex[stop_flag_vec.size()] = inst;

const sta::LibertyCell* liberty_cell = network_->libertyCell(inst);
if (!liberty_cell) {
continue;
}

if (liberty_cell->hasSequentials()) {
stop_flag_vec.push_back(true);
} else {
Expand Down Expand Up @@ -1653,10 +1626,6 @@ void HierRTLMP::createDataFlow()
// check the connected instances
for (odb::dbITerm* iterm : net->getITerms()) {
odb::dbInst* inst = iterm->getInst();
const sta::LibertyCell* liberty_cell = network_->libertyCell(inst);
if (liberty_cell == nullptr) {
continue;
}
odb::dbMaster* master = inst->getMaster();
// check if the instance is a Pad, Cover or empty block (such as marker)
// We ignore nets connecting Pads, Covers, or markers
Expand Down Expand Up @@ -2119,10 +2088,6 @@ void HierRTLMP::breakLargeFlatCluster(Cluster* parent)
// check the connected instances
for (odb::dbITerm* iterm : net->getITerms()) {
odb::dbInst* inst = iterm->getInst();
const sta::LibertyCell* liberty_cell = network_->libertyCell(inst);
if (liberty_cell == nullptr) {
continue;
}
odb::dbMaster* master = inst->getMaster();
// check if the instance is a Pad, Cover or empty block (such as marker)
// if the nets connects to such pad, cover or empty block,
Expand Down Expand Up @@ -2369,15 +2334,12 @@ void HierRTLMP::getHardMacros(odb::dbModule* module,
std::vector<HardMacro*>& hard_macros)
{
for (odb::dbInst* inst : module->getInsts()) {
const sta::LibertyCell* liberty_cell = network_->libertyCell(inst);
if (liberty_cell == nullptr) {
continue;
}
odb::dbMaster* master = inst->getMaster();
// check if the instance is a pad or empty block (such as marker)

if (master->isPad() || master->isCover()) {
continue;
}

if (master->isBlock()) {
hard_macros.push_back(hard_macro_map_[inst]);
}
Expand Down

0 comments on commit 4b4fc52

Please sign in to comment.