Skip to content

Commit

Permalink
Merged in latest master. Signed-off-by: Andy Fox <[email protected]>
Browse files Browse the repository at this point in the history
Signed-off-by: andyfox-rushc <[email protected]>
  • Loading branch information
andyfox-rushc committed Sep 13, 2024
2 parents 85a9c3d + 3eff2c7 commit 0466823
Show file tree
Hide file tree
Showing 18 changed files with 201 additions and 111 deletions.
11 changes: 11 additions & 0 deletions etc/DependencyInstaller.sh
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,9 @@ Usage: $0
$0 -save-deps-prefixes=FILE
# Dumps OpenROAD build arguments and variables
# to FILE
$0 -constant-build-dir
# Use constant build directory, instead of
# random one.
EOF
exit "${1:-1}"
Expand Down Expand Up @@ -794,6 +797,14 @@ while [ "$#" -gt 0 ]; do
export PREFIX="${HOME}/.local"
export isLocal="true"
;;
-constant-build-dir)
if [[ -d "$baseDir" ]]; then
echo "INFO: removing old building directory $baseDir"
rm -r "$baseDir"
fi
baseDir="/tmp/DependencyInstaller-OpenROAD"
mkdir -p "$baseDir"
;;
-prefix=*)
if [[ ! -z ${PREFIX} ]]; then
echo "WARNING: previous argument -local will be overwritten with -prefix"
Expand Down
6 changes: 3 additions & 3 deletions src/ant/include/ant/AntennaChecker.hh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

#include <map>
#include <queue>
#include <unordered_set>
#include <set>

#include "odb/db.h"
#include "odb/dbWireGraph.h"
Expand Down Expand Up @@ -127,11 +127,11 @@ struct Violation

using LayerToNodeInfo = std::map<odb::dbTechLayer*, NodeInfo>;
using GraphNodes = std::vector<std::unique_ptr<GraphNode>>;
using LayerToGraphNodes = std::unordered_map<odb::dbTechLayer*, GraphNodes>;
using LayerToGraphNodes = std::map<odb::dbTechLayer*, GraphNodes>;
using GateToLayerToNodeInfo = std::map<odb::dbITerm*, LayerToNodeInfo>;
using Violations = std::vector<Violation>;
using GateToViolationLayers
= std::unordered_map<odb::dbITerm*, std::unordered_set<odb::dbTechLayer*>>;
= std::map<odb::dbITerm*, std::set<odb::dbTechLayer*>>;

class AntennaChecker
{
Expand Down
9 changes: 3 additions & 6 deletions src/ant/src/AntennaChecker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@
#include <fstream>
#include <iostream>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <utility>

#include "Polygon.hh"
Expand Down Expand Up @@ -236,7 +234,7 @@ void AntennaChecker::saveGates(odb::dbNet* db_net,
LayerToGraphNodes& node_by_layer_map,
const int node_count)
{
std::unordered_map<PinType, std::vector<int>, PinTypeHash> pin_nbrs;
std::map<PinType, std::vector<int>, PinTypeCmp> pin_nbrs;
std::vector<int> ids;
// iterate all instance pins
for (odb::dbITerm* iterm : db_net->getITerms()) {
Expand Down Expand Up @@ -806,8 +804,7 @@ int AntennaChecker::checkGates(odb::dbNet* db_net,
net_to_report_.at(db_net).report += "\n";
}

std::unordered_map<odb::dbTechLayer*, std::unordered_set<odb::dbITerm*>>
pin_added;
std::map<odb::dbTechLayer*, std::set<odb::dbITerm*>> pin_added;
// if checkGates is used by repair antennas
if (pin_violation_count > 0) {
for (const auto& [gate, violation_layers] : gates_with_violations) {
Expand Down Expand Up @@ -914,7 +911,7 @@ void AntennaChecker::buildLayerMaps(odb::dbNet* db_net,
{
odb::dbWire* wires = db_net->getWire();

std::unordered_map<odb::dbTechLayer*, PolygonSet> set_by_layer;
std::map<odb::dbTechLayer*, PolygonSet> set_by_layer;

wiresToPolygonSetMap(wires, set_by_layer);
avoidPinIntersection(db_net, set_by_layer);
Expand Down
6 changes: 3 additions & 3 deletions src/ant/src/PinType.hh
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ struct PinType
bool operator==(const PinType& t) const { return (this->name == t.name); }
};

class PinTypeHash
class PinTypeCmp
{
public:
size_t operator()(const PinType& t) const
size_t operator()(const PinType& t1, const PinType& t2) const
{
return std::hash<std::string>{}(t.name);
return t1.name < t2.name;
}
};

Expand Down
10 changes: 4 additions & 6 deletions src/ant/src/Polygon.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,8 @@ std::vector<int> findNodesWithIntersection(const GraphNodes& graph_nodes,
return ids;
}

void wiresToPolygonSetMap(
odb::dbWire* wires,
std::unordered_map<odb::dbTechLayer*, PolygonSet>& set_by_layer)
void wiresToPolygonSetMap(odb::dbWire* wires,
std::map<odb::dbTechLayer*, PolygonSet>& set_by_layer)
{
odb::dbShape shape;
odb::dbWireShapeItr shapes_it;
Expand Down Expand Up @@ -99,9 +98,8 @@ void wiresToPolygonSetMap(
}
}

void avoidPinIntersection(
odb::dbNet* db_net,
std::unordered_map<odb::dbTechLayer*, PolygonSet>& set_by_layer)
void avoidPinIntersection(odb::dbNet* db_net,
std::map<odb::dbTechLayer*, PolygonSet>& set_by_layer)
{
// iterate all instance pin
for (odb::dbITerm* iterm : db_net->getITerms()) {
Expand Down
6 changes: 3 additions & 3 deletions src/ant/src/Polygon.hh
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ struct GraphNode
bool isVia;
Polygon pol;
std::vector<int> low_adj;
std::unordered_set<PinType, PinTypeHash> gates;
std::set<PinType, PinTypeCmp> gates;
GraphNode() = default;
GraphNode(int id_, bool isVia_, const Polygon& pol_)
{
Expand All @@ -67,9 +67,9 @@ std::vector<int> findNodesWithIntersection(const GraphNodes& graph_nodes,
const Polygon& pol);
void wiresToPolygonSetMap(
odb::dbWire* wires,
std::unordered_map<odb::dbTechLayer*, PolygonSet>& set_by_layer);
std::map<odb::dbTechLayer*, PolygonSet>& set_by_layer);
void avoidPinIntersection(
odb::dbNet* db_net,
std::unordered_map<odb::dbTechLayer*, PolygonSet>& set_by_layer);
std::map<odb::dbTechLayer*, PolygonSet>& set_by_layer);

} // namespace ant
4 changes: 2 additions & 2 deletions src/dpo/src/Optdp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -694,12 +694,12 @@ void Optdp::createArchitecture()

odb::Rect dieRect = block->getDieArea();

odb::uint min_row_height = std::numeric_limits<odb::uint>::max();
auto min_row_height = std::numeric_limits<int>::max();
for (dbRow* row : block->getRows()) {
min_row_height = std::min(min_row_height, row->getSite()->getHeight());
}

std::map<odb::uint, std::unordered_set<std::string>> skip_list;
std::map<int, std::unordered_set<std::string>> skip_list;

for (dbRow* row : block->getRows()) {
if (row->getSite()->getClass() == odb::dbSiteClass::PAD) {
Expand Down
1 change: 1 addition & 0 deletions src/grt/src/GlobalRouter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@ void GlobalRouter::repairAntennas(odb::dbMTerm* diode_mterm,
if (diode_mterm == nullptr) {
diode_mterm = repair_antennas_->findDiodeMTerm();
if (diode_mterm == nullptr) {
logger_->metric("antenna_diodes_count", total_diodes_count_);
logger_->warn(
GRT, 246, "No diode with LEF class CORE ANTENNACELL found.");
return;
Expand Down
1 change: 1 addition & 0 deletions src/grt/src/RepairAntennas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ bool RepairAntennas::checkAntennaViolations(
float ratio_margin,
const int num_threads)
{
antenna_violations_.clear();
for (odb::dbNet* db_net : nets_to_repair) {
antenna_violations_[db_net];
}
Expand Down
2 changes: 1 addition & 1 deletion src/grt/src/fastroute/include/FastRoute.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ using stt::Tree;

struct parent3D
{
short l;
int16_t layer;
int x, y;
};

Expand Down
32 changes: 16 additions & 16 deletions src/grt/src/fastroute/src/FastRoute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,22 @@ void FastRouteCore::setGridsAndLayers(int x, int y, int nLayers)
cost_hvh_test_.resize(y_range_); // Vertical first Z
cost_v_test_.resize(x_range_); // Vertical segment cost
cost_tb_test_.resize(x_range_); // Top and bottom boundary cost

// maze3D variables
directions_3D_.resize(boost::extents[num_layers_][y_grid_][x_grid_]);
corr_edge_3D_.resize(boost::extents[num_layers_][y_grid_][x_grid_]);
pr_3D_.resize(boost::extents[num_layers_][y_grid_][x_grid_]);

int64 total_size = static_cast<int64>(num_layers_) * y_range_ * x_range_;
pop_heap2_3D_.resize(total_size, false);

// allocate memory for priority queue
total_size = static_cast<int64>(y_grid_) * x_grid_ * num_layers_;
src_heap_3D_.resize(total_size);
dest_heap_3D_.resize(total_size);

d1_3D_.resize(boost::extents[num_layers_][y_range_][x_range_]);
d2_3D_.resize(boost::extents[num_layers_][y_range_][x_range_]);
}

void FastRouteCore::addVCapacity(short verticalCapacity, int layer)
Expand Down Expand Up @@ -703,22 +719,6 @@ void FastRouteCore::initAuxVar()
parent_y1_.resize(boost::extents[y_grid_][x_grid_]);
parent_x3_.resize(boost::extents[y_grid_][x_grid_]);
parent_y3_.resize(boost::extents[y_grid_][x_grid_]);

// maze3D variables
directions_3D_.resize(boost::extents[num_layers_][y_grid_][x_grid_]);
corr_edge_3D_.resize(boost::extents[num_layers_][y_grid_][x_grid_]);
pr_3D_.resize(boost::extents[num_layers_][y_grid_][x_grid_]);

int64 total_size = static_cast<int64>(num_layers_) * y_range_ * x_range_;
pop_heap2_3D_.resize(total_size, false);

// allocate memory for priority queue
total_size = static_cast<int64>(y_grid_) * x_grid_ * num_layers_;
src_heap_3D_.resize(total_size);
dest_heap_3D_.resize(total_size);

d1_3D_.resize(boost::extents[num_layers_][y_range_][x_range_]);
d2_3D_.resize(boost::extents[num_layers_][y_range_][x_range_]);
}

NetRouteMap FastRouteCore::getRoutes()
Expand Down
60 changes: 44 additions & 16 deletions src/grt/src/fastroute/src/maze.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1528,10 +1528,17 @@ void FastRouteCore::mazeRouteMSMD(const int iter,
parent_y3_[curY][tmpX] = curY;
hv_[curY][tmpX] = false;
double* dtmp = &d1[curY][tmpX];
int ind = 0;
while (src_heap[ind] != dtmp)
ind++;
updateHeap(src_heap, ind);
const auto it = std::find(src_heap.begin(), src_heap.end(), dtmp);
if (it != src_heap.end()) {
const int pos = it - src_heap.begin();
updateHeap(src_heap, pos);
} else {
logger_->error(
GRT,
607,
"Unable to update: position not found in 2D heap for net {}.",
nets_[netID]->getName());
}
}
}
// right
Expand Down Expand Up @@ -1589,10 +1596,17 @@ void FastRouteCore::mazeRouteMSMD(const int iter,
parent_y3_[curY][tmpX] = curY;
hv_[curY][tmpX] = false;
double* dtmp = &d1[curY][tmpX];
int ind = 0;
while (src_heap[ind] != dtmp)
ind++;
updateHeap(src_heap, ind);
const auto it = std::find(src_heap.begin(), src_heap.end(), dtmp);
if (it != src_heap.end()) {
const int pos = it - src_heap.begin();
updateHeap(src_heap, pos);
} else {
logger_->error(
GRT,
608,
"Unable to update: position not found in 2D heap for net {}.",
nets_[netID]->getName());
}
}
}
// bottom
Expand Down Expand Up @@ -1649,10 +1663,17 @@ void FastRouteCore::mazeRouteMSMD(const int iter,
parent_y1_[tmpY][curX] = curY;
hv_[tmpY][curX] = true;
double* dtmp = &d1[tmpY][curX];
int ind = 0;
while (src_heap[ind] != dtmp)
ind++;
updateHeap(src_heap, ind);
const auto it = std::find(src_heap.begin(), src_heap.end(), dtmp);
if (it != src_heap.end()) {
const int pos = it - src_heap.begin();
updateHeap(src_heap, pos);
} else {
logger_->error(
GRT,
609,
"Unable to update: position not found in 2D heap for net {}.",
nets_[netID]->getName());
}
}
}
// top
Expand Down Expand Up @@ -1710,10 +1731,17 @@ void FastRouteCore::mazeRouteMSMD(const int iter,
parent_y1_[tmpY][curX] = curY;
hv_[tmpY][curX] = true;
double* dtmp = &d1[tmpY][curX];
int ind = 0;
while (src_heap[ind] != dtmp)
ind++;
updateHeap(src_heap, ind);
const auto it = std::find(src_heap.begin(), src_heap.end(), dtmp);
if (it != src_heap.end()) {
const int pos = it - src_heap.begin();
updateHeap(src_heap, pos);
} else {
logger_->error(
GRT,
610,
"Unable to update: position not found in 2D heap for net {}.",
nets_[netID]->getName());
}
}
}

Expand Down
Loading

0 comments on commit 0466823

Please sign in to comment.