Skip to content
Merged
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
12 changes: 6 additions & 6 deletions src/pex/pex/pexTriangulationRExtractor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ TriangulationRExtractor::extract (const db::Polygon &polygon, const std::vector<
tl::SelfTimer timer (tl::verbosity () >= m_tri_param.base_verbosity + 1, "Extracting resistor network from polygon (TriangulationRExtractor)");

db::CplxTrans trans = db::CplxTrans (m_dbu) * db::ICplxTrans (db::Trans (db::Point () - polygon.box ().center ()));
db::CplxTrans dbu_trans = db::CplxTrans (m_dbu);
db::DCplxTrans v2loc_trans = dbu_trans * trans.inverted (); // vertex to node location

db::plc::Graph plc;
db::plc::Triangulation tri (&plc);
Expand All @@ -56,8 +58,6 @@ TriangulationRExtractor::extract (const db::Polygon &polygon, const std::vector<

tri.triangulate (polygon, vertex_ports, m_tri_param, trans);

plc.dump ("debug.gds");

} else {

tl::SelfTimer timer_tri (tl::verbosity () >= m_tri_param.base_verbosity + 11, "Triangulation step");
Expand Down Expand Up @@ -150,7 +150,7 @@ TriangulationRExtractor::extract (const db::Polygon &polygon, const std::vector<
} else {
n = rnetwork.create_node (pex::RNode::PolygonPort, (unsigned int) port_index, 0);
pport_nodes.insert (std::make_pair (port_index, n));
n->location = trans * polygon_ports [port_index].box ();
n->location = dbu_trans * polygon_ports [port_index].box ();
}

} else if (vertex->is_precious ()) {
Expand All @@ -159,7 +159,7 @@ TriangulationRExtractor::extract (const db::Polygon &polygon, const std::vector<
size_t port_index = size_t (*pi);
if (port_index < vertex_ports.size ()) {
RNode *nn = rnetwork.create_node (pex::RNode::VertexPort, (unsigned int) port_index, 0);
nn->location = db::DBox (*vertex, *vertex);
nn->location = v2loc_trans * db::DBox (*vertex, *vertex);
if (n) {
// in case of multiple vertexes on the same spot, short them
rnetwork.create_element (RElement::short_value (), n, nn);
Expand All @@ -173,7 +173,7 @@ TriangulationRExtractor::extract (const db::Polygon &polygon, const std::vector<
} else {

n = rnetwork.create_node (pex::RNode::Internal, (unsigned int) internal_node_id++, 0);
n->location = db::DBox (*vertex, *vertex);
n->location = v2loc_trans * db::DBox (*vertex, *vertex);

}

Expand Down Expand Up @@ -205,7 +205,7 @@ TriangulationRExtractor::extract (const db::Polygon &polygon, const std::vector<

// create a new vertex port and short it to the polygon port
auto n = rnetwork.create_node (pex::RNode::VertexPort, (unsigned int) iv, 0);
n->location = db::DBox (trans * vp, trans * vp);
n->location = dbu_trans * db::Box (vp, vp);
rnetwork.create_element (pex::RElement::short_value (), n, ip->second);

}
Expand Down
8 changes: 4 additions & 4 deletions src/pex/unit_tests/pexTriangulationRExtractorTests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ TEST(extraction)

rex.extract (poly, vertex_ports, polygon_ports, rn);

EXPECT_EQ (rn.to_string (),
"R V0 V1 10.0938"
EXPECT_EQ (rn.to_string (true),
"R V0(0,0.05;0,0.05) V1(1,0.05;1,0.05) 10.0938"
)
}

Expand Down Expand Up @@ -93,8 +93,8 @@ TEST(extraction_with_polygon_ports)

rex.extract (poly, vertex_ports, polygon_ports, rn);

EXPECT_EQ (rn.to_string (),
"R P0 P1 10"
EXPECT_EQ (rn.to_string (true),
"R P0(-0.1,0;0,0.1) P1(1,0;1.1,0.1) 10"
)
}

Expand Down
Loading