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

Support incremental detailed routing #5059

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/ant/include/ant/AntennaChecker.hh
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ class AntennaChecker
std::ofstream& report_file,
// Return values.
int& net_violation_count,
int& pin_violation_count);
int& pin_violation_count,
bool use_grt_routes);
void checkGate(dbWireGraph::Node* gate,
vector<ARinfo>& CARtable,
vector<ARinfo>& VIA_CARtable,
Expand Down
73 changes: 55 additions & 18 deletions src/ant/src/AntennaChecker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1168,7 +1168,9 @@ std::pair<bool, bool> AntennaChecker::checkWirePar(const ARinfo& AntennaRatio,
if (report_file.is_open()) {
report_file << par_report << "\n";
}
logger_->report("{}", par_report);
if (verbose) {
logger_->report("{}", par_report);
}
}
} else {
if (diff_par_violation || verbose) {
Expand All @@ -1183,7 +1185,9 @@ std::pair<bool, bool> AntennaChecker::checkWirePar(const ARinfo& AntennaRatio,
if (report_file.is_open()) {
report_file << par_report << "\n";
}
logger_->report("{}", par_report);
if (verbose) {
logger_->report("{}", par_report);
}
}
}

Expand All @@ -1200,7 +1204,9 @@ std::pair<bool, bool> AntennaChecker::checkWirePar(const ARinfo& AntennaRatio,
if (report_file.is_open()) {
report_file << par_report << "\n";
}
logger_->report("{}", par_report);
if (verbose) {
logger_->report("{}", par_report);
}
}
} else {
if (diff_psr_violation || verbose) {
Expand All @@ -1215,7 +1221,9 @@ std::pair<bool, bool> AntennaChecker::checkWirePar(const ARinfo& AntennaRatio,
if (report_file.is_open()) {
report_file << par_report << "\n";
}
logger_->report("{}", par_report);
if (verbose) {
logger_->report("{}", par_report);
}
}
}
}
Expand Down Expand Up @@ -1555,10 +1563,17 @@ void AntennaChecker::checkNet(dbNet* net,
std::ofstream& report_file,
// Return values.
int& net_violation_count,
int& pin_violation_count)
int& pin_violation_count,
bool use_grt_routes)
{
dbWire* wire = net->getWire();
if (wire) {
std::vector<int> data;
std::vector<unsigned char> op_code;
if (!use_grt_routes) {
wire->getRawWireData(data, op_code);
odb::orderWires(logger_, net);
}
vector<dbWireGraph::Node*> wire_roots;
vector<dbWireGraph::Node*> gate_nodes;
findWireRoots(wire, wire_roots, gate_nodes);
Expand Down Expand Up @@ -1595,7 +1610,9 @@ void AntennaChecker::checkNet(dbNet* net,
if (report_file.is_open()) {
report_file << net_name << "\n";
}
logger_->report("{}", net_name);
if (verbose) {
logger_->report("{}", net_name);
}

for (dbWireGraph::Node* gate : gate_nodes) {
checkGate(gate,
Expand All @@ -1607,7 +1624,12 @@ void AntennaChecker::checkNet(dbNet* net,
violation,
violated_gates);
}
logger_->report("");
if (verbose) {
logger_->report("");
}
}
if (!use_grt_routes) {
wire->setRawWireData(data, op_code);
}
}
}
Expand Down Expand Up @@ -1652,7 +1674,9 @@ void AntennaChecker::checkGate(
if (report_file.is_open()) {
report_file << mterm_info << "\n";
}
logger_->report("{}", mterm_info);
if (verbose) {
logger_->report("{}", mterm_info);
}
}

std::string layer_name = fmt::format(
Expand All @@ -1661,7 +1685,9 @@ void AntennaChecker::checkGate(
if (report_file.is_open()) {
report_file << layer_name << "\n";
}
logger_->report("{}", layer_name);
if (verbose) {
logger_->report("{}", layer_name);
}
first_pin_violation = false;
}
checkWirePar(ar, true, verbose, report_file);
Expand All @@ -1670,8 +1696,9 @@ void AntennaChecker::checkGate(
if (report_file.is_open()) {
report_file << "\n";
}

logger_->report("");
if (verbose) {
logger_->report("");
}
}
}
}
Expand Down Expand Up @@ -1705,8 +1732,9 @@ void AntennaChecker::checkGate(
if (report_file.is_open()) {
report_file << "\n";
}

logger_->report("");
if (verbose) {
logger_->report("");
}
}
}
}
Expand Down Expand Up @@ -1734,9 +1762,6 @@ int AntennaChecker::checkAntennas(dbNet* net, bool verbose)

if (use_grt_routes) {
global_route_source_->makeNetWires();
} else {
// detailed routes
odb::orderWires(logger_, block_);
}

int net_violation_count = 0;
Expand All @@ -1749,7 +1774,8 @@ int AntennaChecker::checkAntennas(dbNet* net, bool verbose)
verbose,
report_file,
net_violation_count,
pin_violation_count);
pin_violation_count,
use_grt_routes);
} else {
logger_->error(
ANT, 14, "Skipped net {} because it is special.", net->getName());
Expand All @@ -1762,7 +1788,8 @@ int AntennaChecker::checkAntennas(dbNet* net, bool verbose)
verbose,
report_file,
net_violation_count,
pin_violation_count);
pin_violation_count,
use_grt_routes);
}
}
}
Expand Down Expand Up @@ -1971,6 +1998,13 @@ vector<Violation> AntennaChecker::getAntennaViolations(dbNet* net,
dbWire* wire = net->getWire();
dbWireGraph graph;
if (wire) {
bool wire_was_oredered = net->isWireOrdered();
std::vector<int> data;
std::vector<unsigned char> op_code;
if (!wire_was_oredered) {
wire->getRawWireData(data, op_code);
odb::orderWires(logger_, net);
}
auto wire_roots = findWireRoots(wire);

vector<PARinfo> PARtable = buildWireParTable(wire_roots);
Expand Down Expand Up @@ -2004,6 +2038,9 @@ vector<Violation> AntennaChecker::getAntennaViolations(dbNet* net,
antenna_violations.push_back(antenna_violation);
}
}
if (!wire_was_oredered) {
wire->setRawWireData(data, op_code);
}
}
return antenna_violations;
}
Expand Down
24 changes: 0 additions & 24 deletions src/ant/test/ant_report.ok
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,6 @@
[INFO ODB-0128] Design: gcd
[INFO ODB-0131] Created 3 components and 24 component-terminals.
[INFO ODB-0133] Created 1 nets and 3 connections.
Net: net50
Pin: _264_/B2 (sky130_fd_sc_ms__a222oi_1)
Layer: met3
Partial area ratio: 43.13
Required ratio: 15.15 (Side area) (VIOLATED)

Layer: met2
Partial area ratio: 208.38
Required ratio: 10.00 (Side area) (VIOLATED)

Pin: output50/A (sky130_fd_sc_ms__buf_1)
Layer: met3
Partial area ratio: 43.13
Required ratio: 15.15 (Side area) (VIOLATED)

Layer: met2
Partial area ratio: 208.38
Required ratio: 10.00 (Side area) (VIOLATED)

Layer: met1
Partial area ratio: 273.94
Required ratio: 10.00 (Side area) (VIOLATED)


[INFO ANT-0002] Found 1 net violations.
[INFO ANT-0001] Found 2 pin violations.
No differences found.
113 changes: 113 additions & 0 deletions src/ant/test/check_api1.ok
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,123 @@
[INFO ODB-0131] Created 6 components and 48 component-terminals.
[INFO ODB-0133] Created 2 nets and 6 connections.
Net: net50
Pin: _264_/B2 (sky130_fd_sc_ms__a222oi_1)
Layer: met3
Partial area ratio: 40.36
Required ratio: 0.00 (Gate area)
Partial area ratio: 217.37
Required ratio: 2878.88 (Side area)
Cumulative area ratio: 137.47
Required ratio: 0.00 (Cumulative area)
Cumulative area ratio: 705.14
Required ratio: 0.00 (Cumulative side area)

Layer: met2
Partial area ratio: 13.53
Required ratio: 0.00 (Gate area)
Partial area ratio: 68.43
Required ratio: 400.00 (Side area)
Cumulative area ratio: 13.53
Required ratio: 0.00 (Cumulative area)
Cumulative area ratio: 68.43
Required ratio: 0.00 (Cumulative side area)

Layer: met1
Partial area ratio: 0.00
Required ratio: 0.00 (Gate area)
Partial area ratio: 0.00
Required ratio: 400.00 (Side area)
Cumulative area ratio: 0.00
Required ratio: 0.00 (Cumulative area)
Cumulative area ratio: 0.00
Required ratio: 0.00 (Cumulative side area)

Layer: li1
Partial area ratio: 0.00
Required ratio: 0.00 (Gate area)
Partial area ratio: 0.00
Required ratio: 75.00 (Side area)
Cumulative area ratio: 0.00
Required ratio: 0.00 (Cumulative area)
Cumulative area ratio: 0.00
Required ratio: 0.00 (Cumulative side area)

Via: M2M3_PR_M
Partial area ratio: 0.16
Required ratio: 6.00 (Gate area)
Cumulative area ratio: 0.37
Required ratio: 0.00 (Cumulative area)

Via: M1M2_PR
Partial area ratio: 0.09
Required ratio: 6.00 (Gate area)
Cumulative area ratio: 0.21
Required ratio: 0.00 (Cumulative area)

Via: L1M1_PR_MR
Partial area ratio: 0.12
Required ratio: 3.00 (Gate area)
Cumulative area ratio: 0.12
Required ratio: 0.00 (Cumulative area)

Pin: output50/A (sky130_fd_sc_ms__buf_1)
Layer: met3
Partial area ratio: 40.36
Required ratio: 0.00 (Gate area)
Partial area ratio: 217.37
Required ratio: 2878.88 (Side area)
Cumulative area ratio: 178.73
Required ratio: 0.00 (Cumulative area)
Cumulative area ratio: 911.59
Required ratio: 0.00 (Cumulative side area)

Layer: met2
Partial area ratio: 83.58
Required ratio: 0.00 (Gate area)
Partial area ratio: 419.33
Required ratio: 400.00 (Side area) (VIOLATED)
Cumulative area ratio: 138.37
Required ratio: 0.00 (Cumulative area)
Cumulative area ratio: 694.21
Required ratio: 0.00 (Cumulative side area)

Layer: met1
Partial area ratio: 54.79
Required ratio: 0.00 (Gate area)
Partial area ratio: 274.88
Required ratio: 400.00 (Side area)
Cumulative area ratio: 54.79
Required ratio: 0.00 (Cumulative area)
Cumulative area ratio: 274.88
Required ratio: 0.00 (Cumulative side area)

Layer: li1
Partial area ratio: 0.00
Required ratio: 0.00 (Gate area)
Partial area ratio: 0.00
Required ratio: 75.00 (Side area)
Cumulative area ratio: 0.00
Required ratio: 0.00 (Cumulative area)
Cumulative area ratio: 0.00
Required ratio: 0.00 (Cumulative side area)

Via: M2M3_PR_M
Partial area ratio: 0.38
Required ratio: 6.00 (Gate area)
Cumulative area ratio: 0.63
Required ratio: 0.00 (Cumulative area)

Via: M1M2_PR
Partial area ratio: 0.11
Required ratio: 6.00 (Gate area)
Cumulative area ratio: 0.25
Required ratio: 0.00 (Cumulative area)

Via: L1M1_PR_MR
Partial area ratio: 0.14
Required ratio: 3.00 (Gate area)
Cumulative area ratio: 0.14
Required ratio: 0.00 (Cumulative area)


[INFO ANT-0002] Found 1 net violations.
Expand Down
2 changes: 1 addition & 1 deletion src/ant/test/check_api1.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
design.readDef("sw130_random.def")
ack = design.getAntennaChecker()

ack.checkAntennas()
ack.checkAntennas(verbose=True)
count = ack.antennaViolationCount()
print(f"violation count = {count}", flush=True)

Expand Down
2 changes: 1 addition & 1 deletion src/ant/test/check_api1.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ source "helpers.tcl"
read_lef merged_spacing.lef
read_def sw130_random.def

check_antennas
check_antennas -verbose
puts "violation count = [ant::antenna_violation_count]"

# check if net50 has a violation
Expand Down
14 changes: 0 additions & 14 deletions src/ant/test/check_drt1.ok
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@
[INFO ODB-0128] Design: gcd
[INFO ODB-0131] Created 6 components and 48 component-terminals.
[INFO ODB-0133] Created 2 nets and 6 connections.
Net: net50
Pin: output50/A (sky130_fd_sc_ms__buf_1)
Layer: met2
Partial area ratio: 419.33
Required ratio: 400.00 (Side area) (VIOLATED)


[INFO ANT-0002] Found 1 net violations.
[INFO ANT-0001] Found 1 pin violations.
Net: net50
Expand Down Expand Up @@ -133,13 +126,6 @@ Net: net50

[INFO ANT-0002] Found 1 net violations.
[INFO ANT-0001] Found 1 pin violations.
Net: net50
Pin: output50/A (sky130_fd_sc_ms__buf_1)
Layer: met2
Partial area ratio: 419.33
Required ratio: 400.00 (Side area) (VIOLATED)


[INFO ANT-0002] Found 1 net violations.
[INFO ANT-0001] Found 1 pin violations.
[ERROR ANT-0012] Net xxx not found.
Expand Down