Skip to content

Commit

Permalink
Removed commented out old code for makeRepeater
Browse files Browse the repository at this point in the history
Signed-off-by: andyfox-rushc <[email protected]>
  • Loading branch information
andyfox-rushc committed Feb 1, 2025
1 parent 3986099 commit 3768789
Showing 1 changed file with 0 additions and 155 deletions.
155 changes: 0 additions & 155 deletions src/rsz/src/RepairDesign.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1752,161 +1752,6 @@ void RepairDesign::makeRepeater(const char* reason,

////////////////////////////////////////////////////////////////

/*
void RepairDesign::makeRepeater(const char* reason,
int x,
int y,
LibertyCell* buffer_cell,
bool resize,
int level,
// Return values.
PinSeq& load_pins,
float& repeater_cap,
float& repeater_fanout,
float& repeater_max_slew,
Net*& out_net,
Pin*& repeater_in_pin,
Pin*& repeater_out_pin)
{
LibertyPort *buffer_input_port, *buffer_output_port;
buffer_cell->bufferPorts(buffer_input_port, buffer_output_port);
string buffer_name = resizer_->makeUniqueInstName(reason);
debugPrint(logger_,
RSZ,
"repair_net",
2,
"{:{}s}{} {} {} ({} {})",
"",
level,
reason,
buffer_name.c_str(),
buffer_cell->name(),
units_->distanceUnit()->asString(dbuToMeters(x), 1),
units_->distanceUnit()->asString(dbuToMeters(y), 1));
// Inserting a buffer is complicated by the fact that verilog netlists
// use the net name for input and output ports. This means the ports
// cannot be moved to a different net.
// This cannot depend on the net in caller because the buffer may be inserted
// between the driver and the loads changing the net as the repair works its
// way from the loads to the driver.
Net *net = nullptr, *in_net;
bool preserve_outputs = false;
for (const Pin* pin : load_pins) {
if (network_->isTopLevelPort(pin)) {
net = network_->net(network_->term(pin));
if (network_->direction(pin)->isAnyOutput()) {
preserve_outputs = true;
break;
}
} else {
net = network_->net(pin);
Instance* inst = network_->instance(pin);
if (resizer_->dontTouch(inst)) {
preserve_outputs = true;
break;
}
}
}
Instance* parent = db_network_->topInstance();
// If the net is driven by an input port,
// use the net as the repeater input net so the port stays connected to it.
if (hasInputPort(net) || !preserve_outputs) {
if (hasInputPort(net))
printf("Has input port\n");
else
printf("Has no input port\n");
if (!preserve_outputs){
printf("Don't preserve outputs\n");
}
else
printf("Preserve outputs\n");
printf("Case 1, origin, input port net no preserve outputs\n");
in_net = net;
out_net = resizer_->makeUniqueNet();
// Copy signal type to new net.
dbNet* out_net_db = db_network_->staToDb(out_net);
dbNet* in_net_db = db_network_->staToDb(in_net);
out_net_db->setSigType(in_net_db->getSigType());
// Move load pins to out_net.
for (const Pin* pin : load_pins) {
Port* port = network_->port(pin);
Instance* inst = network_->instance(pin);
// do not disconnect/reconnect don't touch instances
if (resizer_->dontTouch(inst)) {
continue;
}
sta_->disconnectPin(const_cast<Pin*>(pin));
sta_->connectPin(inst, port, out_net);
}
} else {
printf("case 2: preserve outputs and not input port !\n");
// One of the loads is an output port.
// Use the net as the repeater output net so the port stays connected to it.
in_net = resizer_->makeUniqueNet();
out_net = net;
// Copy signal type to new net.
dbNet* out_net_db = db_network_->staToDb(out_net);
dbNet* in_net_db = db_network_->staToDb(in_net);
in_net_db->setSigType(out_net_db->getSigType());
// Move non-repeater load pins to in_net.
PinSet load_pins1(db_network_);
for (const Pin* pin : load_pins) {
load_pins1.insert(pin);
}
NetPinIterator* pin_iter = network_->pinIterator(out_net);
while (pin_iter->hasNext()) {
const Pin* pin = pin_iter->next();
if (!load_pins1.hasKey(pin)) {
Port* port = network_->port(pin);
Instance* inst = network_->instance(pin);
sta_->disconnectPin(const_cast<Pin*>(pin));
sta_->connectPin(inst, port, in_net);
}
}
}
Point buf_loc(x, y);
Instance* buffer
= resizer_->makeBuffer(buffer_cell, buffer_name.c_str(), parent, buf_loc);
inserted_buffer_count_++;
sta_->connectPin(buffer, buffer_input_port, in_net);
sta_->connectPin(buffer, buffer_output_port, out_net);
resizer_->parasiticsInvalid(in_net);
resizer_->parasiticsInvalid(out_net);
// Resize repeater as we back up by levels.
if (resize) {
Pin* buffer_out_pin = network_->findPin(buffer, buffer_output_port);
resizer_->resizeToTargetSlew(buffer_out_pin);
buffer_cell = network_->libertyCell(buffer);
buffer_cell->bufferPorts(buffer_input_port, buffer_output_port);
}
repeater_in_pin = network_->findPin(buffer, buffer_input_port);
repeater_out_pin = network_->findPin(buffer, buffer_output_port);
load_pins.clear();
load_pins.push_back(repeater_in_pin);
repeater_cap = resizer_->portCapacitance(buffer_input_port, corner_);
repeater_fanout = resizer_->portFanoutLoad(buffer_input_port);
repeater_max_slew = bufferInputMaxSlew(buffer_cell, corner_);
}
*/

bool RepairDesign::hasInputPort(const Net* net)
{
bool has_top_level_port = false;
Expand Down

0 comments on commit 3768789

Please sign in to comment.