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
6 changes: 6 additions & 0 deletions src/rsz/include/rsz/Resizer.hh
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,9 @@ class Resizer : public sta::dbStaState, public sta::dbNetworkObserver
sta::VertexSeq orderedLoadPinVertices();

void setDontUse(sta::LibertyCell* cell, bool dont_use);
void setInverterPairEnabled(bool enable);
bool isInverterPairEnabled() const { return inverter_pair_enabled_; }
const sta::LibertyCellSeq& inverterCells() const { return inverter_cells_; }
void resetDontUse();
bool dontUse(const sta::LibertyCell* cell);
bool isLinkCell(sta::LibertyCell* cell) const;
Expand Down Expand Up @@ -592,6 +595,7 @@ class Resizer : public sta::dbStaState, public sta::dbNetworkObserver
void findBuffers();
void findBuffersNoPruning();
void findFastBuffers();
void findInverters();
static MoveType moveTypeFromString(const std::string& str);
sta::LibertyCell* selectBufferCell(sta::LibertyCell* buffer_cell = nullptr);
void findTargetLoads();
Expand Down Expand Up @@ -933,6 +937,8 @@ class Resizer : public sta::dbStaState, public sta::dbNetworkObserver
sta::LibertyCellSeq buffer_cells_;
sta::LibertyCell* buffer_lowest_drive_ = nullptr;
std::unordered_set<sta::LibertyCell*> buffer_fast_sizes_;
sta::LibertyCellSeq inverter_cells_;
bool inverter_pair_enabled_ = false;
// Buffer list created by CTS kept here so that we use the
// exact same buffers when reparing clock nets.
sta::LibertyCellSeq clk_buffers_;
Expand Down
11 changes: 10 additions & 1 deletion src/rsz/src/BufferedNet.cc
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ BufferedNet::BufferedNet(const BufferedNetType type,
max_load_slew_ = min(ref->maxLoadSlew(), ref2->maxLoadSlew());

area_ = ref->area() + ref2->area();

parity_ = ref->parity();
}

// wire
Expand Down Expand Up @@ -181,6 +183,8 @@ BufferedNet::BufferedNet(const BufferedNetType type,
max_load_slew_ = ref->maxLoadSlew();

area_ = ref->area();

parity_ = ref->parity();
}

// via
Expand Down Expand Up @@ -208,6 +212,8 @@ BufferedNet::BufferedNet(const BufferedNetType type,
max_load_slew_ = ref->maxLoadSlew();

area_ = ref->area();

parity_ = ref->parity();
}

// buffer
Expand Down Expand Up @@ -237,6 +243,8 @@ BufferedNet::BufferedNet(const BufferedNetType type,
max_load_slew_ = resizer->maxInputSlew(input, corner);

area_ = ref->area() + buffer_cell_->area();

parity_ = buffer_cell->isInverter() ? (ref->parity() ^ 1) : ref->parity();
}

void BufferedNet::reportTree(const Resizer* resizer) const
Expand Down Expand Up @@ -1178,7 +1186,8 @@ bool BufferedNet::fitsEnvelope(Metrics target)
return maxLoadWireLength() <= target.max_load_wl && slack() >= target.slack
&& sta::fuzzyLessEqual(cap(), target.cap)
&& sta::fuzzyGreaterEqual(maxLoadSlew(), target.max_load_slew)
&& sta::fuzzyLessEqual(fanout(), target.fanout);
&& sta::fuzzyLessEqual(fanout(), target.fanout)
&& parity() == target.parity;
}

} // namespace rsz
9 changes: 8 additions & 1 deletion src/rsz/src/BufferedNet.hh
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,9 @@ class BufferedNet
// repairNet
int maxLoadWireLength() const;

// Inverter count to loads, mod 2 (0 = polarity preserved).
int parity() const { return parity_; }

// Rebuffer
const sta::RiseFallBoth* slackTransition() const
{
Expand Down Expand Up @@ -222,6 +225,7 @@ class BufferedNet
float cap;
float max_load_slew;
float fanout;
int parity = 0;

Metrics withMaxLoadWl(int max_load_wl)
{
Expand Down Expand Up @@ -251,7 +255,8 @@ class BufferedNet
.slack = slack(),
.cap = cap(),
.max_load_slew = maxLoadSlew(),
.fanout = fanout()};
.fanout = fanout(),
.parity = parity()};
}

bool fitsEnvelope(Metrics target);
Expand Down Expand Up @@ -295,6 +300,8 @@ class BufferedNet
// Delay from driver pin to here
FixedDelay arrival_delay_ = FixedDelay::ZERO;

int8_t parity_ = 0;

const sta::Scene* corner_ = nullptr;
};

Expand Down
Loading
Loading