rearrange netlist edit api for opendb
This commit is contained in:
parent
b5bc2f948f
commit
8ced99d0fa
|
|
@ -1103,6 +1103,8 @@ public:
|
||||||
LibertyCell *cell,
|
LibertyCell *cell,
|
||||||
Instance *parent);
|
Instance *parent);
|
||||||
virtual void deleteInstance(Instance *inst);
|
virtual void deleteInstance(Instance *inst);
|
||||||
|
void deleteLeafInstanceBefore(Instance *inst);
|
||||||
|
void deleteInstancePinsBefore(Instance *inst);
|
||||||
// replace_cell
|
// replace_cell
|
||||||
virtual void replaceCell(Instance *inst,
|
virtual void replaceCell(Instance *inst,
|
||||||
Cell *to_cell);
|
Cell *to_cell);
|
||||||
|
|
@ -1322,18 +1324,15 @@ protected:
|
||||||
int pin_level);
|
int pin_level);
|
||||||
void findRegisterPreamble();
|
void findRegisterPreamble();
|
||||||
bool crossesHierarchy(Edge *edge) const;
|
bool crossesHierarchy(Edge *edge) const;
|
||||||
void deleteLeafInstanceBefore(Instance *inst);
|
|
||||||
void readLibertyAfter(LibertyLibrary *liberty,
|
void readLibertyAfter(LibertyLibrary *liberty,
|
||||||
Corner *corner,
|
Corner *corner,
|
||||||
const MinMax *min_max);
|
const MinMax *min_max);
|
||||||
void powerPreamble();
|
void powerPreamble();
|
||||||
void disableFanoutCrprPruning(Vertex *vertex,
|
void disableFanoutCrprPruning(Vertex *vertex,
|
||||||
int &fanou);
|
int &fanou);
|
||||||
LibertyPort *findCellPort(LibertyCell *cell,
|
virtual void replaceCell(Instance *inst,
|
||||||
PortDirection *dir);
|
Cell *to_cell,
|
||||||
void replaceCell(Instance *inst,
|
LibertyCell *to_lib_cell);
|
||||||
Cell *to_cell,
|
|
||||||
LibertyCell *to_lib_cell);
|
|
||||||
void sdcChangedGraph();
|
void sdcChangedGraph();
|
||||||
void ensureGraphSdcAnnotated();
|
void ensureGraphSdcAnnotated();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3803,19 +3803,6 @@ Sta::disconnectPin(Pin *pin)
|
||||||
network->disconnectPin(pin);
|
network->disconnectPin(pin);
|
||||||
}
|
}
|
||||||
|
|
||||||
LibertyPort *
|
|
||||||
Sta::findCellPort(LibertyCell *cell,
|
|
||||||
PortDirection *dir)
|
|
||||||
{
|
|
||||||
LibertyCellPortIterator port_iter(cell);
|
|
||||||
while (port_iter.hasNext()) {
|
|
||||||
LibertyPort *port = port_iter.next();
|
|
||||||
if (port->direction() == dir)
|
|
||||||
return port;
|
|
||||||
}
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Network edit before/after methods.
|
// Network edit before/after methods.
|
||||||
|
|
@ -4176,8 +4163,10 @@ Sta::deleteNetBefore(Net *net)
|
||||||
void
|
void
|
||||||
Sta::deleteInstanceBefore(Instance *inst)
|
Sta::deleteInstanceBefore(Instance *inst)
|
||||||
{
|
{
|
||||||
if (network_->isLeaf(inst))
|
if (network_->isLeaf(inst)) {
|
||||||
|
deleteInstancePinsBefore(inst);
|
||||||
deleteLeafInstanceBefore(inst);
|
deleteLeafInstanceBefore(inst);
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
// Delete hierarchical instance children.
|
// Delete hierarchical instance children.
|
||||||
InstanceChildIterator *child_iter = network_->childIterator(inst);
|
InstanceChildIterator *child_iter = network_->childIterator(inst);
|
||||||
|
|
@ -4191,6 +4180,12 @@ Sta::deleteInstanceBefore(Instance *inst)
|
||||||
|
|
||||||
void
|
void
|
||||||
Sta::deleteLeafInstanceBefore(Instance *inst)
|
Sta::deleteLeafInstanceBefore(Instance *inst)
|
||||||
|
{
|
||||||
|
sim_->deleteInstanceBefore(inst);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Sta::deleteInstancePinsBefore(Instance *inst)
|
||||||
{
|
{
|
||||||
InstancePinIterator *pin_iter = network_->pinIterator(inst);
|
InstancePinIterator *pin_iter = network_->pinIterator(inst);
|
||||||
while (pin_iter->hasNext()) {
|
while (pin_iter->hasNext()) {
|
||||||
|
|
@ -4198,7 +4193,6 @@ Sta::deleteLeafInstanceBefore(Instance *inst)
|
||||||
deletePinBefore(pin);
|
deletePinBefore(pin);
|
||||||
}
|
}
|
||||||
delete pin_iter;
|
delete pin_iter;
|
||||||
sim_->deleteInstanceBefore(inst);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -4207,52 +4201,56 @@ Sta::deletePinBefore(Pin *pin)
|
||||||
if (graph_) {
|
if (graph_) {
|
||||||
if (network_->isLoad(pin)) {
|
if (network_->isLoad(pin)) {
|
||||||
Vertex *vertex = graph_->pinLoadVertex(pin);
|
Vertex *vertex = graph_->pinLoadVertex(pin);
|
||||||
|
if (vertex) {
|
||||||
|
levelize_->deleteVertexBefore(vertex);
|
||||||
|
graph_delay_calc_->deleteVertexBefore(vertex);
|
||||||
|
search_->deleteVertexBefore(vertex);
|
||||||
|
|
||||||
levelize_->deleteVertexBefore(vertex);
|
VertexInEdgeIterator in_edge_iter(vertex, graph_);
|
||||||
graph_delay_calc_->deleteVertexBefore(vertex);
|
while (in_edge_iter.hasNext()) {
|
||||||
search_->deleteVertexBefore(vertex);
|
Edge *edge = in_edge_iter.next();
|
||||||
|
if (edge->role()->isWire()) {
|
||||||
VertexInEdgeIterator in_edge_iter(vertex, graph_);
|
Vertex *from = edge->from(graph_);
|
||||||
while (in_edge_iter.hasNext()) {
|
// Only notify from vertex (to vertex will be deleted).
|
||||||
Edge *edge = in_edge_iter.next();
|
search_->requiredInvalid(from);
|
||||||
if (edge->role()->isWire()) {
|
}
|
||||||
Vertex *from = edge->from(graph_);
|
levelize_->deleteEdgeBefore(edge);
|
||||||
// Only notify from vertex (to vertex will be deleted).
|
}
|
||||||
search_->requiredInvalid(from);
|
graph_->deleteVertex(vertex);
|
||||||
}
|
|
||||||
levelize_->deleteEdgeBefore(edge);
|
|
||||||
}
|
}
|
||||||
graph_->deleteVertex(vertex);
|
|
||||||
}
|
}
|
||||||
if (network_->isDriver(pin)) {
|
if (network_->isDriver(pin)) {
|
||||||
Vertex *vertex = graph_->pinDrvrVertex(pin);
|
Vertex *vertex = graph_->pinDrvrVertex(pin);
|
||||||
|
if (vertex) {
|
||||||
|
levelize_->deleteVertexBefore(vertex);
|
||||||
|
graph_delay_calc_->deleteVertexBefore(vertex);
|
||||||
|
search_->deleteVertexBefore(vertex);
|
||||||
|
|
||||||
levelize_->deleteVertexBefore(vertex);
|
VertexOutEdgeIterator edge_iter(vertex, graph_);
|
||||||
graph_delay_calc_->deleteVertexBefore(vertex);
|
while (edge_iter.hasNext()) {
|
||||||
search_->deleteVertexBefore(vertex);
|
Edge *edge = edge_iter.next();
|
||||||
|
if (edge->role()->isWire()) {
|
||||||
VertexOutEdgeIterator edge_iter(vertex, graph_);
|
// Only notify to vertex (from will be deleted).
|
||||||
while (edge_iter.hasNext()) {
|
Vertex *to = edge->to(graph_);
|
||||||
Edge *edge = edge_iter.next();
|
// to->prev_paths point to vertex, so delete them.
|
||||||
if (edge->role()->isWire()) {
|
search_->arrivalInvalidDelete(to);
|
||||||
// Only notify to vertex (from will be deleted).
|
graph_delay_calc_->delayInvalid(to);
|
||||||
Vertex *to = edge->to(graph_);
|
levelize_->relevelizeFrom(to);
|
||||||
// to->prev_paths point to vertex, so delete them.
|
}
|
||||||
search_->arrivalInvalidDelete(to);
|
levelize_->deleteEdgeBefore(edge);
|
||||||
graph_delay_calc_->delayInvalid(to);
|
}
|
||||||
levelize_->relevelizeFrom(to);
|
graph_->deleteVertex(vertex);
|
||||||
}
|
|
||||||
levelize_->deleteEdgeBefore(edge);
|
|
||||||
}
|
}
|
||||||
graph_->deleteVertex(vertex);
|
|
||||||
}
|
}
|
||||||
if (network_->direction(pin) == PortDirection::internal()) {
|
if (network_->direction(pin) == PortDirection::internal()) {
|
||||||
// Internal pins are not loads or drivers.
|
// Internal pins are not loads or drivers.
|
||||||
Vertex *vertex = graph_->pinLoadVertex(pin);
|
Vertex *vertex = graph_->pinLoadVertex(pin);
|
||||||
levelize_->deleteVertexBefore(vertex);
|
if (vertex) {
|
||||||
graph_delay_calc_->deleteVertexBefore(vertex);
|
levelize_->deleteVertexBefore(vertex);
|
||||||
search_->deleteVertexBefore(vertex);
|
graph_delay_calc_->deleteVertexBefore(vertex);
|
||||||
graph_->deleteVertex(vertex);
|
search_->deleteVertexBefore(vertex);
|
||||||
|
graph_->deleteVertex(vertex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sim_->deletePinBefore(pin);
|
sim_->deletePinBefore(pin);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue