mirror of https://github.com/KLayout/klayout.git
Add-on: netlist browser and net navigation with different context cells in layout view enhanced.
This commit is contained in:
parent
585baa4637
commit
7f26c580e0
|
|
@ -656,6 +656,16 @@ CellView::context_trans () const
|
||||||
return trans;
|
return trans;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
db::DCplxTrans
|
||||||
|
CellView::context_dtrans () const
|
||||||
|
{
|
||||||
|
tl_assert (m_layout_href.get () != 0);
|
||||||
|
|
||||||
|
db::CplxTrans dbu_trans (m_layout_href->layout ().dbu ());
|
||||||
|
return dbu_trans * context_trans () * dbu_trans.inverted ();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------
|
// -------------------------------------------------------------
|
||||||
// CellView implementation
|
// CellView implementation
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -522,6 +522,11 @@ public:
|
||||||
*/
|
*/
|
||||||
db::ICplxTrans context_trans () const;
|
db::ICplxTrans context_trans () const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Retrive the accumulated transformation induced by the context part of the path as a micron-unit transformation
|
||||||
|
*/
|
||||||
|
db::DCplxTrans context_dtrans () const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Deep copy of the cellview
|
* @brief Deep copy of the cellview
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -69,10 +69,11 @@ inline const db::Circuit *deref_circuit (const db::Circuit *obj)
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class Obj>
|
template <class Obj>
|
||||||
static db::DCplxTrans
|
static std::pair<bool, db::DCplxTrans>
|
||||||
trans_for (const Obj *objs, const db::Layout &ly, const db::Cell &cell, db::ContextCache &cc, const db::DCplxTrans &initial = db::DCplxTrans ())
|
trans_for (const Obj *objs, const db::Layout &ly, const db::Cell &cell, db::ContextCache &cc, const db::DCplxTrans &initial = db::DCplxTrans ())
|
||||||
{
|
{
|
||||||
db::DCplxTrans t = initial;
|
db::DCplxTrans t = initial;
|
||||||
|
bool good = true;
|
||||||
|
|
||||||
const db::Circuit *circuit = deref_circuit (objs);
|
const db::Circuit *circuit = deref_circuit (objs);
|
||||||
while (circuit) {
|
while (circuit) {
|
||||||
|
|
@ -98,10 +99,12 @@ trans_for (const Obj *objs, const db::Layout &ly, const db::Cell &cell, db::Cont
|
||||||
std::pair<bool, db::ICplxTrans> tc = cc.find_layout_context (circuit->cell_index (), cell.cell_index ());
|
std::pair<bool, db::ICplxTrans> tc = cc.find_layout_context (circuit->cell_index (), cell.cell_index ());
|
||||||
if (tc.first) {
|
if (tc.first) {
|
||||||
t = dbu_trans * tc.second * dbu_trans.inverted () * t;
|
t = dbu_trans * tc.second * dbu_trans.inverted () * t;
|
||||||
|
} else {
|
||||||
|
good = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return t;
|
return std::make_pair (good, t);
|
||||||
}
|
}
|
||||||
|
|
||||||
NetlistBrowserPage::NetlistBrowserPage (QWidget * /*parent*/)
|
NetlistBrowserPage::NetlistBrowserPage (QWidget * /*parent*/)
|
||||||
|
|
@ -978,11 +981,14 @@ NetlistBrowserPage::adjust_view ()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const db::Layout &original_layout = mp_view->cellview (m_cv_index)->layout ();
|
const db::Layout &original_layout = cv->layout ();
|
||||||
const db::Circuit *top_circuit = mp_database->netlist ()->circuit_by_name (original_layout.cell_name (mp_view->cellview (m_cv_index).cell_index ()));
|
const db::Circuit *top_circuit = mp_database->netlist ()->circuit_by_name (original_layout.cell_name (cv.cell_index ()));
|
||||||
|
if (! top_circuit) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const db::Layout *layout = mp_database->internal_layout ();
|
const db::Layout *layout = mp_database->internal_layout ();
|
||||||
const db::Cell *cell = (top_circuit && layout->is_valid_cell_index (top_circuit->cell_index ()) ? &layout->cell (top_circuit->cell_index ()) : mp_database->internal_top_cell ());
|
const db::Cell *cell = layout->is_valid_cell_index (top_circuit->cell_index ()) ? &layout->cell (top_circuit->cell_index ()) : mp_database->internal_top_cell ();
|
||||||
if (! layout || ! cell) {
|
if (! layout || ! cell) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -996,9 +1002,12 @@ NetlistBrowserPage::adjust_view ()
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
db::DCplxTrans trans;
|
std::pair<bool, db::DCplxTrans> tr = trans_for (circuit, *layout, *cell, m_cell_context_cache, cv.context_dtrans ());
|
||||||
|
if (! tr.first) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
trans = trans_for (circuit, *layout, *cell, m_cell_context_cache, db::DCplxTrans ());
|
db::DCplxTrans trans = tr.second;
|
||||||
|
|
||||||
for (std::list<std::pair<const db::SubCircuit *, const db::SubCircuit *> >::const_iterator p = path->path.begin (); p != path->path.end () && circuit; ++p) {
|
for (std::list<std::pair<const db::SubCircuit *, const db::SubCircuit *> >::const_iterator p = path->path.begin (); p != path->path.end () && circuit; ++p) {
|
||||||
if (p->first) {
|
if (p->first) {
|
||||||
|
|
@ -1273,11 +1282,19 @@ NetlistBrowserPage::update_highlights ()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const db::Layout &original_layout = mp_view->cellview (m_cv_index)->layout ();
|
const lay::CellView &cv = mp_view->cellview (m_cv_index);
|
||||||
const db::Circuit *top_circuit = mp_database->netlist ()->circuit_by_name (original_layout.cell_name (mp_view->cellview (m_cv_index).cell_index ()));
|
if (! cv.is_valid ()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const db::Layout &original_layout = cv->layout ();
|
||||||
|
const db::Circuit *top_circuit = mp_database->netlist ()->circuit_by_name (original_layout.cell_name (cv.cell_index ()));
|
||||||
|
if (! top_circuit) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const db::Layout *layout = mp_database->internal_layout ();
|
const db::Layout *layout = mp_database->internal_layout ();
|
||||||
const db::Cell *cell = (top_circuit && layout->is_valid_cell_index (top_circuit->cell_index ()) ? &layout->cell (top_circuit->cell_index ()) : mp_database->internal_top_cell ());
|
const db::Cell *cell = layout->is_valid_cell_index (top_circuit->cell_index ()) ? &layout->cell (top_circuit->cell_index ()) : mp_database->internal_top_cell ();
|
||||||
if (! layout || ! cell) {
|
if (! layout || ! cell) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -1301,7 +1318,12 @@ NetlistBrowserPage::update_highlights ()
|
||||||
|
|
||||||
// computes the transformation supplied by the path
|
// computes the transformation supplied by the path
|
||||||
|
|
||||||
db::DCplxTrans trans = trans_for (circuit, *layout, *cell, m_cell_context_cache, db::DCplxTrans ());
|
std::pair<bool, db::DCplxTrans> tr = trans_for (circuit, *layout, *cell, m_cell_context_cache, cv.context_dtrans ());
|
||||||
|
if (! tr.first) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
db::DCplxTrans trans = tr.second;
|
||||||
|
|
||||||
for (std::list<std::pair<const db::SubCircuit *, const db::SubCircuit *> >::const_iterator p = path->path.begin (); p != path->path.end () && circuit; ++p) {
|
for (std::list<std::pair<const db::SubCircuit *, const db::SubCircuit *> >::const_iterator p = path->path.begin (); p != path->path.end () && circuit; ++p) {
|
||||||
if (p->first) {
|
if (p->first) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue