Skip to content

Commit ca7328f

Browse files
committed
drt: set unidirectional layers in router_cfg_
Signed-off-by: osamahammad21 <[email protected]>
1 parent 0bbb4a0 commit ca7328f

File tree

4 files changed

+17
-19
lines changed

4 files changed

+17
-19
lines changed

src/drt/src/TritonRoute.cpp

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -572,13 +572,14 @@ void TritonRoute::initDesign()
572572
|| db_->getChip()->getBlock() == nullptr) {
573573
logger_->error(utl::DRT, 151, "Database, chip or block not initialized.");
574574
}
575+
const bool design_exists = getDesign()->getTopBlock() != nullptr;
575576
io::Parser parser(db_, getDesign(), logger_, router_cfg_.get());
576-
if (getDesign()->getTopBlock() != nullptr) {
577+
if (design_exists) {
577578
parser.updateDesign();
578-
return;
579+
} else {
580+
parser.readTechAndLibs(db_);
581+
parser.readDesign(db_);
579582
}
580-
parser.readTechAndLibs(db_);
581-
parser.readDesign(db_);
582583
auto tech = getDesign()->getTech();
583584

584585
if (!router_cfg_->VIAINPIN_BOTTOMLAYER_NAME.empty()) {
@@ -628,9 +629,11 @@ void TritonRoute::initDesign()
628629
router_cfg_->REPAIR_PDN_LAYER_NAME);
629630
}
630631
}
631-
parser.postProcess();
632-
db_callback_->addOwner(db_->getChip()->getBlock());
633-
initGraphics();
632+
if (!design_exists) {
633+
parser.postProcess();
634+
db_callback_->addOwner(db_->getChip()->getBlock());
635+
initGraphics();
636+
}
634637
}
635638

636639
void TritonRoute::initGraphics()
@@ -1277,7 +1280,7 @@ void TritonRoute::setUnidirectionalLayer(const std::string& layerName)
12771280
"Non-routing layer {} can't be set unidirectional",
12781281
layerName);
12791282
}
1280-
design_->getTech()->setUnidirectionalLayer(dbLayer);
1283+
router_cfg_->unidirectional_layers_.insert(dbLayer);
12811284
}
12821285

12831286
void TritonRoute::setParams(const ParamStruct& params)

src/drt/src/db/tech/frTechObject.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,6 @@ class frTechObject
5959
{
6060
return viaRuleGenerates_;
6161
}
62-
bool hasUnidirectionalLayer(odb::dbTechLayer* dbLayer) const
63-
{
64-
return unidirectional_layers_.find(dbLayer) != unidirectional_layers_.end();
65-
}
6662
bool hasMaxSpacingConstraints() const
6763
{
6864
for (const auto& layer : layers_) {
@@ -126,10 +122,6 @@ class frTechObject
126122
}
127123
return nullptr;
128124
}
129-
void setUnidirectionalLayer(odb::dbTechLayer* dbLayer)
130-
{
131-
unidirectional_layers_.insert(dbLayer);
132-
}
133125

134126
// forbidden length table related
135127
bool isVia2ViaForbiddenLen(int tableLayerIdx,
@@ -406,8 +398,6 @@ class frTechObject
406398
ByLayer<std::array<bool, 4>> viaForbiddenThrough_;
407399
bool hasVia2viaMinStep_ = false;
408400
bool hasCornerSpacingConstraint_ = false;
409-
// unidirectional layers
410-
std::set<odb::dbTechLayer*> unidirectional_layers_;
411401

412402
friend class FlexRP;
413403
};

src/drt/src/global.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@
99
#include <memory>
1010
#include <optional>
1111
#include <string>
12+
#include <unordered_set>
1213

1314
#include "db/obj/frMarker.h"
1415
#include "frBaseTypes.h"
1516

1617
namespace odb {
1718
class Point;
1819
class Rect;
20+
class dbTechLayer;
1921
} // namespace odb
2022

2123
namespace drt {
@@ -97,6 +99,9 @@ struct RouterConfiguration
9799
std::string REPAIR_PDN_LAYER_NAME;
98100
frLayerNum REPAIR_PDN_LAYER_NUM = -1;
99101
frLayerNum GC_IGNORE_PDN_LAYER_NUM = -1;
102+
103+
// unidirectional layers
104+
std::unordered_set<odb::dbTechLayer*> unidirectional_layers_;
100105
};
101106

102107
constexpr int DIRBITSIZE = 3;

src/drt/src/io/io.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1574,7 +1574,7 @@ void io::Parser::setRoutingLayerProperties(odb::dbTechLayer* layer,
15741574
getTech()->addUConstraint(std::move(uCon));
15751575
tmpLayer->addLef58SpacingWrongDirConstraint(rptr);
15761576
}
1577-
if (getTech()->hasUnidirectionalLayer(layer)) {
1577+
if (router_cfg_->unidirectional_layers_.contains(layer)) {
15781578
tmpLayer->setUnidirectional(true);
15791579
}
15801580
if (layer->isRectOnly()) {

0 commit comments

Comments
 (0)