Skip to content
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

Jumper insertion: modifications in DRT and ODB #6138

Open
wants to merge 39 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
426e936
odb: adding has_jumpers flag in dbNet
luis201420 Oct 19, 2024
c54c317
drt: using has_jumpers flag to increase the guide cost
luis201420 Oct 19, 2024
b894f2c
grt: using jumper insertion and set has_jumpers flag
luis201420 Oct 19, 2024
d67b15f
Merge remote-tracking branch 'origin' into drt_jumper_insertion
luis201420 Oct 19, 2024
9d77600
drt: increasing the jumper cost
luis201420 Oct 21, 2024
1b95a23
Merge remote-tracking branch 'origin' into drt_jumper_insertion
luis201420 Oct 21, 2024
405041a
Merge remote-tracking branch 'origin' into drt_jumper_insertion
luis201420 Oct 23, 2024
71cbe41
grt: running jumper insertion when there are new nets to repair
luis201420 Oct 23, 2024
a8f032c
Merge remote-tracking branch 'origin' into drt_jumper_insertion
luis201420 Oct 28, 2024
38fe8bd
Merge remote-tracking branch 'origin' into drt_jumper_insertion
luis201420 Oct 29, 2024
91278bd
drt: adding clang-format
luis201420 Oct 29, 2024
4e3fd2f
grt: adding clang-format
luis201420 Oct 29, 2024
c01575b
odb: adding comment for jumper insertion schema
luis201420 Oct 29, 2024
dd52984
odb: adding flag to mark guides that are jumpers
luis201420 Oct 31, 2024
5879673
grt: using flag to mark jumper guides
luis201420 Oct 31, 2024
765bcca
drt: checking the number of jumper guides
luis201420 Oct 31, 2024
27ceab3
Merge remote-tracking branch 'origin' into drt_jumper_insertion
luis201420 Nov 2, 2024
153481e
drt: finding nets with jumpers
luis201420 Nov 2, 2024
05327be
Merge remote-tracking branch 'origin' into drt_jumper_insertion
luis201420 Nov 4, 2024
cc3a830
Merge remote-tracking branch 'origin' into drt_jumper_insertion
luis201420 Nov 5, 2024
a41af71
Merge remote-tracking branch 'origin' into drt_jumper_insertion
luis201420 Nov 6, 2024
5c01269
Merge remote-tracking branch 'origin' into drt_jumper_insertion
luis201420 Nov 7, 2024
71ceb0f
Merge remote-tracking branch 'origin' into drt_jumper_insertion
luis201420 Nov 8, 2024
886627f
Merge remote-tracking branch 'origin' into drt_jumper_insertion
luis201420 Nov 9, 2024
434f182
drt: removing debug code
luis201420 Nov 11, 2024
1c4efbe
grt: removing debug code
luis201420 Nov 11, 2024
666ab85
grt: adding clang format
luis201420 Nov 11, 2024
9a54355
Merge remote-tracking branch 'origin' into drt_jumper_insertion
luis201420 Nov 11, 2024
25bfb2b
odb: adding is_jumper flag to dbGuide
luis201420 Nov 12, 2024
84a2560
Merge remote-tracking branch 'origin' into drt_jumper_insertion
luis201420 Nov 14, 2024
03267d7
Merge remote-tracking branch 'origin' into drt_jumper_insertion
luis201420 Nov 15, 2024
3c40cad
grt: running jumper insertion for each antenna violation of a net
luis201420 Nov 18, 2024
a4d1930
Merge remote-tracking branch 'origin' into drt_jumper_insertion
luis201420 Nov 18, 2024
1707cad
drt: adding requested changes
luis201420 Nov 18, 2024
265e4ac
grt: adding requested changes
luis201420 Nov 18, 2024
9c512f9
grt: updating unit tests
luis201420 Nov 18, 2024
1bad828
updating ibex_sky130hd and jpeg_sky130hd tests
luis201420 Nov 18, 2024
460b4f8
drt: adding comment with a brief explanation about what is a jumper
luis201420 Nov 18, 2024
1cb0909
Merge remote-tracking branch 'origin' into drt_jumper_insertion
luis201420 Nov 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/drt/src/db/obj/frNet.h
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,8 @@ class frNet : public frBlockObject
orig_guides_ = guides;
}
const std::vector<frRect>& getOrigGuides() const { return orig_guides_; }
void setHasJumpers(bool has_jumpers) { has_jumpers_ = has_jumpers; }
bool hasJumpers() { return has_jumpers_; }

protected:
frString name_;
Expand Down Expand Up @@ -272,6 +274,9 @@ class frNet : public frBlockObject
bool hasInitialRouting_{false};
bool isFixed_{false};

// Flag to mark when a frNet has a jumper, which is a special route guide used
// to prevent antenna violations
bool has_jumpers_{false};
std::vector<frPinFig*> all_pinfigs_;
};
} // namespace drt
2 changes: 1 addition & 1 deletion src/drt/src/dr/FlexDR_graphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ gui::Descriptor::Properties GridGraphDescriptor::getProperties(
costs.push_back(
{name + " total cost",
graph->getCosts(
x, y, z, dir, layer, data.graph->getNDR() != nullptr)});
x, y, z, dir, layer, data.graph->getNDR() != nullptr, false)});
}
props.insert(props.end(), costs.begin(), costs.end());
return props;
Expand Down
6 changes: 5 additions & 1 deletion src/drt/src/dr/FlexDR_maze.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3222,6 +3222,9 @@ bool FlexDRWorker::routeNet(drNet* net, std::vector<FlexMazeIdx>& paths)
{
// ProfileTask profile("DR:routeNet");

// Verify if net has jumpers
const bool route_with_jumpers = net->getFrNet()->hasJumpers();

if (net->getPins().size() <= 1) {
return true;
}
Expand Down Expand Up @@ -3273,7 +3276,8 @@ bool FlexDRWorker::routeNet(drNet* net, std::vector<FlexMazeIdx>& paths)
ccMazeIdx1,
ccMazeIdx2,
centerPt,
mazeIdx2TaperBox)) {
mazeIdx2TaperBox,
route_with_jumpers)) {
routeNet_postAstarUpdate(
path, connComps, unConnPins, mazeIdx2unConnPins, isFirstConn);
routeNet_postAstarWritePath(
Expand Down
15 changes: 10 additions & 5 deletions src/drt/src/dr/FlexGridGraph.h
Original file line number Diff line number Diff line change
Expand Up @@ -914,7 +914,8 @@ class FlexGridGraph
frMIdx gridZ,
frDirEnum dir,
frLayer* layer,
bool considerNDR) const;
bool considerNDR,
bool route_with_jumpers) const;
bool useNDRCosts(const FlexWavefrontGrid& p) const;

frNonDefaultRule* getNDR() const { return ndr_; }
Expand All @@ -938,7 +939,8 @@ class FlexGridGraph
FlexMazeIdx& ccMazeIdx1,
FlexMazeIdx& ccMazeIdx2,
const Point& centerPt,
std::map<FlexMazeIdx, frBox3D*>& mazeIdx2TaperBox);
std::map<FlexMazeIdx, frBox3D*>& mazeIdx2TaperBox,
bool route_with_jumpers);
void setCost(frUInt4 drcCostIn,
frUInt4 markerCostIn,
frUInt4 FixedShapeCostIn)
Expand Down Expand Up @@ -1284,7 +1286,8 @@ class FlexGridGraph
const FlexMazeIdx& dstMazeIdx2,
const frDirEnum& dir) const;
frCost getNextPathCost(const FlexWavefrontGrid& currGrid,
const frDirEnum& dir) const;
const frDirEnum& dir,
bool route_with_jumpers) const;
frDirEnum getLastDir(const std::bitset<WAVEFRONTBITSIZE>& buffer) const;
void traceBackPath(const FlexWavefrontGrid& currGrid,
std::vector<FlexMazeIdx>& path,
Expand All @@ -1294,15 +1297,17 @@ class FlexGridGraph
void expandWavefront(FlexWavefrontGrid& currGrid,
const FlexMazeIdx& dstMazeIdx1,
const FlexMazeIdx& dstMazeIdx2,
const Point& centerPt);
const Point& centerPt,
bool route_with_jumpers);
bool isExpandable(const FlexWavefrontGrid& currGrid, frDirEnum dir) const;
FlexMazeIdx getTailIdx(const FlexMazeIdx& currIdx,
const FlexWavefrontGrid& currGrid) const;
void expand(FlexWavefrontGrid& currGrid,
const frDirEnum& dir,
const FlexMazeIdx& dstMazeIdx1,
const FlexMazeIdx& dstMazeIdx2,
const Point& centerPt);
const Point& centerPt,
bool route_with_jumpers);
bool hasAlignedUpDefTrack(
frLayerNum layerNum,
const std::map<frLayerNum, frTrackPattern*>& xSubMap,
Expand Down
41 changes: 30 additions & 11 deletions src/drt/src/dr/FlexGridGraph_maze.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ void FlexGridGraph::expand(FlexWavefrontGrid& currGrid,
const frDirEnum& dir,
const FlexMazeIdx& dstMazeIdx1,
const FlexMazeIdx& dstMazeIdx2,
const Point& centerPt)
const Point& centerPt,
bool route_with_jumpers)
{
frCost nextEstCost, nextPathCost;
int gridX = currGrid.x();
Expand All @@ -53,7 +54,7 @@ void FlexGridGraph::expand(FlexWavefrontGrid& currGrid,
dstMazeIdx1,
dstMazeIdx2,
dir);
nextPathCost = getNextPathCost(currGrid, dir);
nextPathCost = getNextPathCost(currGrid, dir, route_with_jumpers);
Point currPt;
getPoint(currPt, gridX, gridY);
frCoord currDist = Point::manhattanDistance(currPt, centerPt);
Expand Down Expand Up @@ -153,11 +154,17 @@ void FlexGridGraph::expand(FlexWavefrontGrid& currGrid,
void FlexGridGraph::expandWavefront(FlexWavefrontGrid& currGrid,
const FlexMazeIdx& dstMazeIdx1,
const FlexMazeIdx& dstMazeIdx2,
const Point& centerPt)
const Point& centerPt,
bool route_with_jumpers)
{
for (const auto dir : frDirEnumAll) {
if (isExpandable(currGrid, dir)) {
expand(currGrid, dir, dstMazeIdx1, dstMazeIdx2, centerPt);
expand(currGrid,
dir,
dstMazeIdx1,
dstMazeIdx2,
centerPt,
route_with_jumpers);
}
}
}
Expand Down Expand Up @@ -322,7 +329,8 @@ void FlexGridGraph::getPrevGrid(frMIdx& gridX,
}

frCost FlexGridGraph::getNextPathCost(const FlexWavefrontGrid& currGrid,
const frDirEnum& dir) const
const frDirEnum& dir,
bool route_with_jumpers) const
{
frMIdx gridX = currGrid.x();
frMIdx gridY = currGrid.y();
Expand Down Expand Up @@ -473,8 +481,13 @@ frCost FlexGridGraph::getNextPathCost(const FlexWavefrontGrid& currGrid,
}
}
}
nextPathCost
+= getCosts(gridX, gridY, gridZ, dir, layer, useNDRCosts(currGrid));
nextPathCost += getCosts(gridX,
gridY,
gridZ,
dir,
layer,
useNDRCosts(currGrid),
route_with_jumpers);

return nextPathCost;
}
Expand All @@ -484,7 +497,8 @@ frCost FlexGridGraph::getCosts(frMIdx gridX,
frMIdx gridZ,
frDirEnum dir,
frLayer* layer,
bool considerNDR) const
bool considerNDR,
bool route_with_jumpers) const
{
bool gridCost = hasGridCost(gridX, gridY, gridZ, dir);
bool drcCost = hasRouteShapeCostAdj(gridX, gridY, gridZ, dir, considerNDR);
Expand All @@ -494,14 +508,17 @@ frCost FlexGridGraph::getCosts(frMIdx gridX,
bool guideCost = hasGuide(gridX, gridY, gridZ, dir);
frCoord edgeLength = getEdgeLength(gridX, gridY, gridZ, dir);

// increase cost when a net has jumper
frUInt4 jumper_cost = route_with_jumpers ? 10 : 1;

// temporarily disable guideCost
return getEdgeLength(gridX, gridY, gridZ, dir)
+ (gridCost ? GRIDCOST * edgeLength : 0)
+ (drcCost ? ggDRCCost_ * edgeLength : 0)
+ (markerCost ? ggMarkerCost_ * edgeLength : 0)
+ (shapeCost ? ggFixedShapeCost_ * edgeLength : 0)
+ (blockCost ? BLOCKCOST * layer->getMinWidth() * 20 : 0)
+ (!guideCost ? GUIDECOST * edgeLength : 0);
+ (!guideCost ? (GUIDECOST * jumper_cost) * edgeLength : 0);
}

bool FlexGridGraph::useNDRCosts(const FlexWavefrontGrid& p) const
Expand Down Expand Up @@ -659,7 +676,8 @@ bool FlexGridGraph::search(std::vector<FlexMazeIdx>& connComps,
FlexMazeIdx& ccMazeIdx1,
FlexMazeIdx& ccMazeIdx2,
const Point& centerPt,
std::map<FlexMazeIdx, frBox3D*>& mazeIdx2TaperBox)
std::map<FlexMazeIdx, frBox3D*>& mazeIdx2TaperBox,
bool route_with_jumpers)
{
if (drWorker_->getDRIter() >= debugMazeIter) {
std::cout << "INIT search: target pin " << nextPin->getName()
Expand Down Expand Up @@ -735,7 +753,8 @@ bool FlexGridGraph::search(std::vector<FlexMazeIdx>& connComps,
return true;
}
// expand and update wavefront
expandWavefront(currGrid, dstMazeIdx1, dstMazeIdx2, centerPt);
expandWavefront(
currGrid, dstMazeIdx1, dstMazeIdx2, centerPt, route_with_jumpers);
}
return false;
}
Expand Down
4 changes: 4 additions & 0 deletions src/drt/src/io/io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -976,6 +976,7 @@ void io::Parser::setNets(odb::dbBlock* block)
frNet* io::Parser::addNet(odb::dbNet* db_net)
{
bool is_special = db_net->isSpecial();
bool has_jumpers = db_net->hasJumpers();
if (!is_special && db_net->getSigType().isSupply()) {
logger_->error(DRT,
305,
Expand All @@ -996,6 +997,9 @@ frNet* io::Parser::addNet(odb::dbNet* db_net)
if (is_special) {
uNetIn->setIsSpecial(true);
}
if (has_jumpers) {
uNetIn->setHasJumpers(has_jumpers);
}
updateNetRouting(netIn, db_net);
netIn->setType(db_net->getSigType());
if (is_special) {
Expand Down
4 changes: 3 additions & 1 deletion src/grt/include/grt/GRoute.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,11 @@ struct GSegment
int final_x;
int final_y;
int final_layer;
bool is_jumper;
GSegment() = default;
GSegment(int x0, int y0, int l0, int x1, int y1, int l1);
GSegment(int x0, int y0, int l0, int x1, int y1, int l1, bool jumper = false);
bool isVia() const { return (init_x == final_x && init_y == final_y); }
bool isJumper() const { return is_jumper; }
int length() const
{
return std::abs(init_x - final_x) + std::abs(init_y - final_y);
Expand Down
29 changes: 27 additions & 2 deletions src/grt/src/GlobalRouter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@ int GlobalRouter::repairAntennas(odb::dbMTerm* diode_mterm,
"repair_antennas should perform only one iteration when the "
"routing source is detailed routing.");
}

while (violations && itr < iterations) {
if (verbose_) {
logger_->info(GRT, 6, "Repairing antennas, iteration {}.", itr + 1);
Expand All @@ -408,6 +409,23 @@ int GlobalRouter::repairAntennas(odb::dbMTerm* diode_mterm,
diode_mterm,
ratio_margin,
num_threads);
// if run in GRT and it need run jumper insertion
if (!haveDetailedRoutes(nets_to_repair)
&& repair_antennas_->hasNewViolations()) {
// Run jumper insertion and clean
repair_antennas_->jumperInsertion(
routes_, grid_->getTileSize(), getMaxRoutingLayer());
repair_antennas_->clearViolations();

// run again antenna checker
violations
= repair_antennas_->checkAntennaViolations(routes_,
nets_to_repair,
getMaxRoutingLayer(),
diode_mterm,
ratio_margin,
num_threads);
}
if (violations) {
IncrementalGRoute incr_groute(this, block_);
repair_antennas_->repairAntennas(diode_mterm);
Expand Down Expand Up @@ -2357,7 +2375,13 @@ void GlobalRouter::saveGuides()
}

odb::dbTechLayer* layer = routing_layers_[segment.init_layer];
odb::dbGuide::create(db_net, layer, layer, box, is_congested);
// Set guide flag when it is jumper
bool is_jumper = segment.isJumper();
auto guide
= odb::dbGuide::create(db_net, layer, layer, box, is_congested);
if (is_jumper) {
guide->setIsJumper(true);
}
}
}
}
Expand Down Expand Up @@ -4861,14 +4885,15 @@ void GRouteDbCbk::inDbBTermPreDisconnect(odb::dbBTerm* bterm)

////////////////////////////////////////////////////////////////

GSegment::GSegment(int x0, int y0, int l0, int x1, int y1, int l1)
GSegment::GSegment(int x0, int y0, int l0, int x1, int y1, int l1, bool jumper)
{
init_x = std::min(x0, x1);
init_y = std::min(y0, y1);
init_layer = l0;
final_x = std::max(x0, x1);
final_y = std::max(y0, y1);
final_layer = l1;
is_jumper = jumper;
}

bool GSegment::operator==(const GSegment& segment) const
Expand Down
Loading
Loading