Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
15 changes: 14 additions & 1 deletion src/drt/src/dr/FlexDR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -955,7 +955,20 @@ struct Wavefront
int expansion_south;
bool operator<(const Wavefront& rhs) const
{
return expansions_done > rhs.expansions_done;
// Total order so that priority_queue pop order does not depend on the

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we order the field in the struct the way we are interested in them (exapansion_done, id, ..east, ...) we could also just have the compiler take care of implementing the whole spaceship operator to deal with all situations, since we're on c++20:

auto operator <=>(const Wavefront& rhs) const = default;

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds like followup to this PR? I'm not a domain expert here, I'm just running Claude and this surfaced as an instability in testing.

// standard library's heap implementation.
if (expansions_done != rhs.expansions_done) {
return expansions_done > rhs.expansions_done;
}
if (id != rhs.id) {
return id > rhs.id;
}
return std::tie(
expansion_east, expansion_west, expansion_north, expansion_south)
> std::tie(rhs.expansion_east,
rhs.expansion_west,
rhs.expansion_north,
rhs.expansion_south);
}
};

Expand Down
10 changes: 8 additions & 2 deletions src/drt/src/dr/FlexDR_conn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -364,10 +364,16 @@ bool FlexDRConnectivityChecker::astar(
int cost;
bool operator<(const wf& b) const
{
if (cost == b.cost) {
// Total order so that priority_queue pop order (and therefore the
// chosen predecessor on cost ties) does not depend on the standard
// library's heap implementation.
if (cost != b.cost) {
return cost > b.cost;
}
if (nodeIdx != b.nodeIdx) {
return nodeIdx > b.nodeIdx;
}
return cost > b.cost;
return prevIdx > b.prevIdx;
}
};
for (int findNode = nNetRouteObjs; findNode < nNetObjs - 1; findNode++) {
Expand Down
10 changes: 8 additions & 2 deletions src/drt/src/io/GuideProcessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -339,10 +339,16 @@ class GuidePathFinder
int cost;
bool operator<(const Wavefront& b) const
{
if (cost == b.cost) {
// Total order so that priority_queue pop order (and therefore the
// chosen predecessor on cost ties) does not depend on the standard
// library's heap implementation.
if (cost != b.cost) {
return cost > b.cost;
}
if (node_idx != b.node_idx) {
return node_idx > b.node_idx;
}
return cost > b.cost;
return prev_idx > b.prev_idx;
}
};
/**
Expand Down
404 changes: 192 additions & 212 deletions test/aes_sky130hd.metrics

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions test/aes_sky130hd.metrics_limits
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
{
"IFP::instance_count" : "20652.0"
,"DPL::design_area" : "241789.19999999998"
,"DPL::design_area" : "243057.59999999998"
,"DPL::utilization" : "8.04"
,"RSZ::repair_design_buffer_count" : "693"
,"RSZ::repair_design_buffer_count" : "706"
,"RSZ::max_slew_slack" : "0"
,"RSZ::max_capacitance_slack" : "0"
,"RSZ::max_fanout_slack" : "0"
,"RSZ::worst_slack_min" : "-0.3723263387430433"
,"RSZ::worst_slack_max" : "-1.326974615082891"
,"RSZ::tns_max" : "-748.1016605879365"
,"RSZ::hold_buffer_count" : "424"
,"RSZ::worst_slack_min" : "-0.3735384802756107"
,"RSZ::worst_slack_max" : "-1.283988998799738"
,"RSZ::tns_max" : "-734.9413784624944"
,"RSZ::hold_buffer_count" : "417"
,"GRT::ANT::errors" : "0"
,"DRT::drv" : "0"
,"DRT::worst_slack_min" : "-0.4733114507628843"
,"DRT::worst_slack_max" : "-1.9136417909718662"
,"DRT::tns_max" : "-836.9442390632205"
,"DRT::clock_skew" : "0.7405977374320253"
,"DRT::max_slew_slack" : "-15.618910789489746"
,"DRT::max_capacitance_slack" : "-16.15476931306629"
,"DRT::worst_slack_min" : "-0.4402497853106166"
,"DRT::worst_slack_max" : "-1.6663618097035495"
,"DRT::tns_max" : "-823.2593845374129"
,"DRT::clock_skew" : "0.4280845132876491"
,"DRT::max_slew_slack" : "-26.159040927886963"
,"DRT::max_capacitance_slack" : "-3.5806363388753915"
,"DRT::max_fanout_slack" : "0"
,"DRT::clock_period" : "3.74"
,"DRT::ANT::errors" : "0"
Expand Down
Loading
Loading