Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhishengZeng committed Oct 22, 2024
1 parent 64621f7 commit 7da0fde
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 12 deletions.
40 changes: 37 additions & 3 deletions src/operation/iRT/interface/RTInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,9 @@ void RTInterface::wrapObstacleList()
std::vector<Obstacle>& routing_obstacle_list = RTDM.getDatabase().get_routing_obstacle_list();
std::vector<Obstacle>& cut_obstacle_list = RTDM.getDatabase().get_cut_obstacle_list();
std::vector<idb::IdbInstance*>& instance_list = dmInst->get_idb_def_service()->get_design()->get_instance_list()->get_instance_list();
idb::IdbSpecialNetList* idb_special_net_list = dmInst->get_idb_def_service()->get_design()->get_special_net_list();
std::vector<idb::IdbSpecialNet*>& idb_special_net_list
= dmInst->get_idb_def_service()->get_design()->get_special_net_list()->get_net_list();
std::vector<idb::IdbPin*>& idb_io_pin_list = dmInst->get_idb_def_service()->get_design()->get_io_pin_list()->get_pin_list();

int32_t total_routing_obstacle_num = 0;
int32_t total_cut_obstacle_num = 0;
Expand Down Expand Up @@ -523,7 +525,7 @@ void RTInterface::wrapObstacleList()
}
}
// special net
for (idb::IdbSpecialNet* idb_net : idb_special_net_list->get_net_list()) {
for (idb::IdbSpecialNet* idb_net : idb_special_net_list) {
for (idb::IdbSpecialWire* idb_wire : idb_net->get_wire_list()->get_wire_list()) {
for (idb::IdbSpecialWireSegment* idb_segment : idb_wire->get_segment_list()) {
if (idb_segment->is_via()) {
Expand All @@ -536,6 +538,19 @@ void RTInterface::wrapObstacleList()
}
}
}
// io pin
for (idb::IdbPin* idb_io_pin : idb_io_pin_list) {
if (idb_io_pin->get_net() != nullptr) {
continue;
}
for (idb::IdbLayerShape* port_box : idb_io_pin->get_port_box_list()) {
if (port_box->get_layer()->is_routing()) {
total_routing_obstacle_num += port_box->get_rect_list().size();
} else if (port_box->get_layer()->is_cut()) {
total_cut_obstacle_num += port_box->get_rect_list().size();
}
}
}
}
routing_obstacle_list.reserve(total_routing_obstacle_num);
cut_obstacle_list.reserve(total_cut_obstacle_num);
Expand Down Expand Up @@ -577,7 +592,7 @@ void RTInterface::wrapObstacleList()
}
}
// special net
for (idb::IdbSpecialNet* idb_net : idb_special_net_list->get_net_list()) {
for (idb::IdbSpecialNet* idb_net : idb_special_net_list) {
for (idb::IdbSpecialWire* idb_wire : idb_net->get_wire_list()->get_wire_list()) {
for (idb::IdbSpecialWireSegment* idb_segment : idb_wire->get_segment_list()) {
if (idb_segment->is_via()) {
Expand Down Expand Up @@ -611,6 +626,25 @@ void RTInterface::wrapObstacleList()
}
}
}
// io pin
for (idb::IdbPin* idb_io_pin : idb_io_pin_list) {
if (idb_io_pin->get_net() != nullptr) {
continue;
}
for (idb::IdbLayerShape* port_box : idb_io_pin->get_port_box_list()) {
for (idb::IdbRect* rect : port_box->get_rect_list()) {
Obstacle obstacle;
obstacle.set_real_ll(rect->get_low_x(), rect->get_low_y());
obstacle.set_real_ur(rect->get_high_x(), rect->get_high_y());
obstacle.set_layer_idx(port_box->get_layer()->get_id());
if (port_box->get_layer()->is_routing()) {
routing_obstacle_list.push_back(std::move(obstacle));
} else if (port_box->get_layer()->is_cut()) {
cut_obstacle_list.push_back(std::move(obstacle));
}
}
}
}
}
RTLOG.info(Loc::current(), "Completed", monitor.getStatsInfo());
}
Expand Down
18 changes: 9 additions & 9 deletions src/operation/iRT/source/module/drc_engine/DRCEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,15 +190,15 @@ void DRCEngine::writeTask(DETask& de_task)
flag = " NEW";
}
} else {
if (RTUTIL.isHorizontal(first_coord, second_coord)) {
std::string layer_name = routing_layer_list[first_layer_idx].get_layer_name();
RTUTIL.pushStream(def_file, flag, " ", layer_name, " ( ", first_coord.get_x(), " ", first_coord.get_y(), " ) ( ",
second_coord.get_x(), " * )", "\n");
flag = " NEW";
} else if (RTUTIL.isVertical(first_coord, second_coord)) {
std::string layer_name = routing_layer_list[first_layer_idx].get_layer_name();
RTUTIL.pushStream(def_file, flag, " ", layer_name, " ( ", first_coord.get_x(), " ", first_coord.get_y(), " ) ( * ",
second_coord.get_y(), " )", "\n");
for (NetShape& net_shape : RTDM.getNetShapeList(net_idx, *segment)) {
if (!net_shape.get_is_routing()) {
RTLOG.error(Loc::current(), "The net_shape is not routing!");
}
std::string layer_name = routing_layer_list[net_shape.get_layer_idx()].get_layer_name();
PlanarCoord mid_point = net_shape.getMidPoint();
RTUTIL.pushStream(def_file, flag, " ", layer_name, " ( ", mid_point.get_x(), " ", mid_point.get_y(), " ) RECT ( ",
net_shape.get_ll_x() - mid_point.get_x(), " ", net_shape.get_ll_y() - mid_point.get_y(), " ",
net_shape.get_ur_x() - mid_point.get_x(), " ", net_shape.get_ur_y() - mid_point.get_y(), " )", "\n");
flag = " NEW";
}
}
Expand Down

0 comments on commit 7da0fde

Please sign in to comment.