Skip to content

Commit ef188a0

Browse files
committed
Merge remote-tracking branch 'origin/master' into secure-setup-qor
2 parents 9c9c6f4 + 9103e99 commit ef188a0

File tree

15 files changed

+522
-79
lines changed

15 files changed

+522
-79
lines changed

src/gui/BUILD

Lines changed: 65 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -34,50 +34,74 @@ cc_library(
3434
],
3535
)
3636

37-
qt6_library(
38-
name = "gui_qt",
39-
srcs = glob(
40-
include = [
41-
"src/*.cpp",
37+
# A Qt 'headless' build is added for environments that require GUI features
38+
# but do not have an attached display. This requires setting 'qt_gui_platform'
39+
# to `headless`, and subsituting the dependency in the top-level BUILD.
40+
QT_GUI_PLATFORMS = {
41+
"headless": "_headless",
42+
"native": "",
43+
}
44+
45+
[
46+
qt6_library(
47+
name = "gui_qt" + suffix,
48+
srcs = glob(
49+
include = [
50+
"src/*.cpp",
51+
],
52+
exclude = [
53+
"src/stub.cpp",
54+
"src/stub_heatMap.cpp",
55+
],
56+
) + [
57+
":gui_swig",
58+
":tcl",
4259
],
43-
exclude = [
44-
"src/stub.cpp",
45-
"src/stub_heatMap.cpp",
60+
hdrs = [
61+
"include/gui/MakeGui.h",
62+
"include/gui/gui.h",
63+
"include/gui/heatMap.h",
4664
],
47-
) + [
48-
":gui_swig",
49-
":tcl",
50-
],
65+
defines = [
66+
"STATIC_QPA_PLUGIN_XCB=1",
67+
],
68+
includes = [
69+
"include",
70+
"src",
71+
"ui",
72+
],
73+
moc_hdrs = glob(["src/*.h"]),
74+
qt_gui_platform = platform,
75+
uic_srcs = glob(["ui/*.ui"]) if platform == "native" else [],
76+
deps = [
77+
":qt_resources",
78+
"//:ord",
79+
"//src/dbSta",
80+
"//src/dbSta:dbNetwork",
81+
"//src/odb",
82+
"//src/sta:opensta_lib",
83+
"//src/utl",
84+
"//third-party/gif-h:gif_h",
85+
"@boost.algorithm",
86+
"@boost.geometry",
87+
"@boost.multi_array",
88+
"@boost.stacktrace",
89+
"@spdlog",
90+
"@tk_tcl//:tcl",
91+
] + ([":uic_lib"] if platform == "headless" else []),
92+
)
93+
for platform, suffix in QT_GUI_PLATFORMS.items()
94+
]
95+
96+
# This is used to work around the limitation of the `qt6_library` rule which
97+
# only supports use of one `qt6_library` rule using `uic_srcs` per package.
98+
cc_library(
99+
name = "uic_lib",
51100
hdrs = [
52-
"include/gui/MakeGui.h",
53-
"include/gui/gui.h",
54-
"include/gui/heatMap.h",
55-
],
56-
defines = [
57-
"STATIC_QPA_PLUGIN_XCB=1",
58-
],
59-
includes = [
60-
"include",
61-
"src",
62-
"ui",
63-
],
64-
moc_hdrs = glob(["src/*.h"]),
65-
uic_srcs = glob(["ui/*.ui"]),
66-
deps = [
67-
":qt_resources",
68-
"//:ord",
69-
"//src/dbSta",
70-
"//src/dbSta:dbNetwork",
71-
"//src/odb",
72-
"//src/sta:opensta_lib",
73-
"//src/utl",
74-
"//third-party/gif-h:gif_h",
75-
"@boost.algorithm",
76-
"@boost.geometry",
77-
"@boost.multi_array",
78-
"@boost.stacktrace",
79-
"@spdlog",
80-
"@tk_tcl//:tcl",
101+
":ui/ui_findDlg.h",
102+
":ui/ui_gotoDlg.h",
103+
":ui/ui_highlightGroupDlg.h",
104+
":ui/ui_selectedWidget.h",
81105
],
82106
)
83107

src/mpl/src/clusterEngine.cpp

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,46 +1027,57 @@ void ClusteringEngine::buildDataFlowConnections()
10271027
}
10281028

10291029
const int driver_id = itr->second;
1030+
Cluster* driver_cluster = tree_->maps.id_to_cluster.at(driver_id);
10301031

10311032
for (int hops = 0; hops < max_num_of_hops_; hops++) {
10321033
std::set<int> sink_clusters = computeSinks(insts[hops]);
10331034
const float conn_weight = computeConnWeight(hops);
10341035
for (auto& sink : sink_clusters) {
1035-
tree_->maps.id_to_cluster[driver_id]->addConnection(sink, conn_weight);
1036-
tree_->maps.id_to_cluster[sink]->addConnection(driver_id, conn_weight);
1036+
Cluster* sink_cluster = tree_->maps.id_to_cluster.at(sink);
1037+
connect(driver_cluster, sink_cluster, conn_weight);
10371038
}
10381039
}
10391040
}
10401041

10411042
// macros to ffs
10421043
for (const auto& [iterm, insts] : data_connections_.macro_pins_and_regs) {
10431044
const int driver_id = tree_->maps.inst_to_cluster_id.at(iterm->getInst());
1045+
Cluster* driver_cluster = tree_->maps.id_to_cluster.at(driver_id);
10441046

10451047
for (int hops = 0; hops < max_num_of_hops_; hops++) {
10461048
std::set<int> sink_clusters = computeSinks(insts[hops]);
10471049
const float conn_weight = computeConnWeight(hops);
10481050
for (auto& sink : sink_clusters) {
1049-
tree_->maps.id_to_cluster[driver_id]->addConnection(sink, conn_weight);
1050-
tree_->maps.id_to_cluster[sink]->addConnection(driver_id, conn_weight);
1051+
Cluster* sink_cluster = tree_->maps.id_to_cluster.at(sink);
1052+
connect(driver_cluster, sink_cluster, conn_weight);
10511053
}
10521054
}
10531055
}
10541056

10551057
// macros to macros
10561058
for (const auto& [iterm, insts] : data_connections_.macro_pins_and_macros) {
10571059
const int driver_id = tree_->maps.inst_to_cluster_id.at(iterm->getInst());
1060+
Cluster* driver_cluster = tree_->maps.id_to_cluster.at(driver_id);
10581061

10591062
for (int hops = 0; hops < max_num_of_hops_; hops++) {
10601063
std::set<int> sink_clusters = computeSinks(insts[hops]);
10611064
const float conn_weight = computeConnWeight(hops);
10621065
for (auto& sink : sink_clusters) {
1063-
tree_->maps.id_to_cluster[driver_id]->addConnection(sink, conn_weight);
1064-
tree_->maps.id_to_cluster[sink]->addConnection(driver_id, conn_weight);
1066+
Cluster* sink_cluster = tree_->maps.id_to_cluster.at(sink);
1067+
connect(driver_cluster, sink_cluster, conn_weight);
10651068
}
10661069
}
10671070
}
10681071
}
10691072

1073+
void ClusteringEngine::connect(Cluster* a,
1074+
Cluster* b,
1075+
const float connection_weight) const
1076+
{
1077+
a->addConnection(b, connection_weight);
1078+
b->addConnection(a, connection_weight);
1079+
}
1080+
10701081
float ClusteringEngine::computeConnWeight(const int hops)
10711082
{
10721083
const float base_remoteness_factor = 2.0;
@@ -1863,7 +1874,7 @@ bool ClusteringEngine::attemptMerge(Cluster* receiver, Cluster* incomer)
18631874
for (const auto& [cluster_id, connection_weight] : incomer_connections) {
18641875
Cluster* cluster = tree_->maps.id_to_cluster.at(cluster_id);
18651876
cluster->removeConnection(incomer_id);
1866-
cluster->addConnection(receiver->getId(), connection_weight);
1877+
cluster->addConnection(receiver, connection_weight);
18671878
}
18681879
}
18691880

@@ -1928,13 +1939,12 @@ void ClusteringEngine::buildNetListConnections()
19281939
if (driver_cluster_id != -1 && !load_clusters_ids.empty()
19291940
&& load_clusters_ids.size() < tree_->large_net_threshold) {
19301941
const float weight = net_has_io_pin ? tree_->virtual_weight : 1.0;
1942+
Cluster* driver_cluster = tree_->maps.id_to_cluster.at(driver_cluster_id);
19311943

19321944
for (const int load_cluster_id : load_clusters_ids) {
1933-
if (load_cluster_id != driver_cluster_id) { /* undirected connection */
1934-
tree_->maps.id_to_cluster[driver_cluster_id]->addConnection(
1935-
load_cluster_id, weight);
1936-
tree_->maps.id_to_cluster[load_cluster_id]->addConnection(
1937-
driver_cluster_id, weight);
1945+
if (load_cluster_id != driver_cluster_id) {
1946+
Cluster* load_cluster = tree_->maps.id_to_cluster.at(load_cluster_id);
1947+
connect(driver_cluster, load_cluster, weight);
19381948
}
19391949
}
19401950
}

src/mpl/src/clusterEngine.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ class ClusteringEngine
241241
void clearConnections();
242242
void buildNetListConnections();
243243
void buildDataFlowConnections();
244+
void connect(Cluster* a, Cluster* b, float connection_weight) const;
244245

245246
// Methods for data flow
246247
void createDataFlow();

src/mpl/src/object.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -568,13 +568,9 @@ void Cluster::initConnection()
568568
connections_map_.clear();
569569
}
570570

571-
void Cluster::addConnection(int cluster_id, float weight)
571+
void Cluster::addConnection(Cluster* cluster, const float connection_weight)
572572
{
573-
if (connections_map_.find(cluster_id) == connections_map_.end()) {
574-
connections_map_[cluster_id] = weight;
575-
} else {
576-
connections_map_[cluster_id] += weight;
577-
}
573+
connections_map_[cluster->getId()] += connection_weight;
578574
}
579575

580576
void Cluster::removeConnection(int cluster_id)

src/mpl/src/object.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ class Cluster
209209

210210
// Connection signature support
211211
void initConnection();
212-
void addConnection(int cluster_id, float weight);
212+
void addConnection(Cluster* cluster, float connection_weight);
213213
void removeConnection(int cluster_id);
214214
const ConnectionsMap& getConnectionsMap() const;
215215
bool isSameConnSignature(const Cluster& cluster, float net_threshold);

src/odb/src/db/dbModInst.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,8 @@ dbModInst* dbModInst::swapMaster(dbModule* new_module)
664664
// Remove any dangling nets
665665
std::vector<dbNet*> nets_to_delete;
666666
for (dbNet* net : parent->getOwner()->getNets()) {
667-
if (net->getITerms().empty()) {
667+
if (net->getITerms().empty() && net->getBTerms().empty()
668+
&& !net->isSpecial()) {
668669
nets_to_delete.emplace_back(net);
669670
}
670671
}

src/rsz/README.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
1-
# Gate Resizer
1+
#Gate Resizer
22

3-
Gate Resizer commands are described below. The `resizer` commands stop when
4-
the design area is `-max_utilization util` percent of the core area. `util`
5-
is between 0 and 100. The `resizer` stops and reports an error if the max
6-
utilization is exceeded.
3+
Gate Resizer commands are described below.The `resizer` commands stop when the
4+
design area is `
5+
- max_utilization util` percent of the core area. `util` is between 0
6+
and 100. The `resizer` stops and reports an error if the max utilization is
7+
exceeded.
78

8-
## Commands
9+
##Commands
910

10-
```{note}
11+
```
12+
{
13+
note
14+
}
1115
- Parameters in square brackets `[-param param]` are optional.
1216
- Parameters without square brackets `-param2 param2` are required.
1317
```
@@ -247,7 +251,7 @@ repair_timing
247251
| `-setup_margin` | Add additional setup slack margin. |
248252
| `-hold_margin` | Add additional hold slack margin. |
249253
| `-allow_setup_violations` | While repairing hold violations, buffers are not inserted that will cause setup violations unless `-allow_setup_violations` is specified. |
250-
| `-sequence` | Specify a particular order of setup timing optimizations. The default is "unbuffer,sizeup,swap,buffer,clone,split". Obeys skip flags also. |
254+
| `-sequence` | Specify a particular order of setup timing optimizations. The default is "unbuffer,vt_swap,sizeup,swap,buffer,clone,split". Obeys skip flags also. |
251255
| `-skip_pin_swap` | Flag to skip pin swap. The default is to perform pin swap transform during setup fixing. |
252256
| `-skip_gate_cloning` | Flag to skip gate cloning. The default is to perform gate cloning transform during setup fixing. |
253257
| `-skip_size_down` | Flag to skip gate down sizing. The default is to perform non-critical fanout gate down sizing transform during setup fixing. |
@@ -603,7 +607,7 @@ buffer_ports
603607
repair_design -max_wire_length 100
604608
repair_tie_fanout LOGIC0_X1/Z
605609
repair_tie_fanout LOGIC1_X1/Z
606-
# clock tree synthesis...
610+
#clock tree synthesis...
607611
repair_timing
608612
```
609613

src/rsz/src/RepairSetup.cc

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,14 @@ bool RepairSetup::repairSetup(const float setup_slack_margin,
460460

461461
if (!skip_last_gasp) {
462462
// do some last gasp setup fixing before we give up
463-
OptoParams params(setup_slack_margin, verbose);
463+
OptoParams params(setup_slack_margin,
464+
verbose,
465+
skip_pin_swap,
466+
skip_gate_cloning,
467+
skip_size_down,
468+
skip_buffering,
469+
skip_buffer_removal,
470+
skip_vt_swap);
464471
params.iteration = opto_iteration;
465472
params.initial_tns = initial_tns;
466473
repairSetupLastGasp(params, num_viols);
@@ -850,10 +857,14 @@ bool RepairSetup::terminateProgress(const int iteration,
850857
void RepairSetup::repairSetupLastGasp(const OptoParams& params, int& num_viols)
851858
{
852859
move_sequence.clear();
853-
move_sequence = {resizer_->vt_swap_speed_move_.get(),
854-
resizer_->size_up_match_move_.get(),
855-
resizer_->size_up_move_.get(),
856-
resizer_->swap_pins_move_.get()};
860+
if (!params.skip_vt_swap) {
861+
move_sequence.push_back(resizer_->vt_swap_speed_move_.get());
862+
}
863+
move_sequence.push_back(resizer_->size_up_match_move_.get());
864+
move_sequence.push_back(resizer_->size_up_move_.get());
865+
if (!params.skip_pin_swap) {
866+
move_sequence.push_back(resizer_->swap_pins_move_.get());
867+
}
857868

858869
// Sort remaining failing endpoints
859870
const VertexSet* endpoints = sta_->endpoints();

src/rsz/src/RepairSetup.hh

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,29 @@ struct OptoParams
5858
float initial_tns;
5959
const float setup_slack_margin;
6060
const bool verbose;
61-
62-
OptoParams(const float margin, const bool verbose)
63-
: setup_slack_margin(margin), verbose(verbose)
61+
const bool skip_pin_swap;
62+
const bool skip_gate_cloning;
63+
const bool skip_size_down;
64+
const bool skip_buffering;
65+
const bool skip_buffer_removal;
66+
const bool skip_vt_swap;
67+
68+
OptoParams(const float margin,
69+
const bool verbose,
70+
const bool skip_pin_swap,
71+
const bool skip_gate_cloning,
72+
const bool skip_size_down,
73+
const bool skip_buffering,
74+
const bool skip_buffer_removal,
75+
const bool skip_vt_swap)
76+
: setup_slack_margin(margin),
77+
verbose(verbose),
78+
skip_pin_swap(skip_pin_swap),
79+
skip_gate_cloning(skip_gate_cloning),
80+
skip_size_down(skip_size_down),
81+
skip_buffering(skip_buffering),
82+
skip_buffer_removal(skip_buffer_removal),
83+
skip_vt_swap(skip_vt_swap)
6484
{
6585
iteration = 0;
6686
initial_tns = 0.0;

src/rsz/test/BUILD

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ TESTS = [
6363
"repair_fanout6_multi",
6464
"repair_fanout7",
6565
"repair_fanout7_multi",
66+
"repair_fanout7_skip_pin_swap",
6667
"repair_fanout8",
6768
"repair_fanout8_multi",
6869
"repair_hold1",
@@ -203,6 +204,7 @@ filegroup(
203204
extra_deps = {
204205
"repair_fanout6_multi": ["repair_fanout6.tcl"],
205206
"repair_fanout7_multi": ["repair_fanout7.tcl"],
207+
"repair_fanout7_skip_pin_swap": ["repair_fanout7.tcl"],
206208
"repair_fanout8_multi": ["repair_fanout8.tcl"],
207209
"repair_setup1_multi": ["repair_setup1.tcl"],
208210
"repair_setup2_multi": ["repair_setup2.tcl"],

0 commit comments

Comments
 (0)