Better information in LVS report - at least for skipped circuits for now.

This commit is contained in:
Matthias Koefferlein
2021-03-14 18:21:32 +01:00
parent bb9ae20c32
commit 4549da561b
18 changed files with 431 additions and 290 deletions
+14 -21
View File
@@ -305,32 +305,28 @@ SingleIndexedNetlistModel::parent_of (const subcircuit_pair &subcircuits) const
return std::make_pair (subcircuits.first ? subcircuits.first->circuit () : 0, (const db::Circuit *) 0);
}
std::pair<IndexedNetlistModel::circuit_pair, IndexedNetlistModel::Status>
SingleIndexedNetlistModel::top_circuit_from_index (size_t index) const
std::pair<IndexedNetlistModel::circuit_pair, std::pair<IndexedNetlistModel::Status, std::string> > SingleIndexedNetlistModel::top_circuit_from_index(size_t index) const
{
db::Netlist::const_top_down_circuit_iterator none;
return std::make_pair (attr_by_object_and_index (std::make_pair ((const db::Circuit *) 0, (const db::Circuit *) 0), index, mp_netlist->begin_top_down (), mp_netlist->begin_top_down () + mp_netlist->top_circuit_count (), none, none, m_child_circuit_by_circuit_and_index, sort_by_name<db::Circuit> ()), db::NetlistCrossReference::None);
return std::make_pair (attr_by_object_and_index (std::make_pair ((const db::Circuit *) 0, (const db::Circuit *) 0), index, mp_netlist->begin_top_down (), mp_netlist->begin_top_down () + mp_netlist->top_circuit_count (), none, none, m_child_circuit_by_circuit_and_index, sort_by_name<db::Circuit> ()), std::make_pair (db::NetlistCrossReference::None, std::string ()));
}
std::pair<IndexedNetlistModel::circuit_pair, IndexedNetlistModel::Status>
SingleIndexedNetlistModel::child_circuit_from_index (const circuit_pair &circuits, size_t index) const
std::pair<IndexedNetlistModel::circuit_pair, std::pair<IndexedNetlistModel::Status, std::string> > SingleIndexedNetlistModel::child_circuit_from_index(const circuit_pair &circuits, size_t index) const
{
db::Circuit::const_child_circuit_iterator none;
return std::make_pair (attr_by_object_and_index (circuits, index, circuits.first->begin_children (), circuits.first->end_children (), none, none, m_child_circuit_by_circuit_and_index, sort_by_name<db::Circuit> ()), db::NetlistCrossReference::None);
return std::make_pair (attr_by_object_and_index (circuits, index, circuits.first->begin_children (), circuits.first->end_children (), none, none, m_child_circuit_by_circuit_and_index, sort_by_name<db::Circuit> ()), std::make_pair (db::NetlistCrossReference::None, std::string ()));
}
std::pair<IndexedNetlistModel::circuit_pair, IndexedNetlistModel::Status>
SingleIndexedNetlistModel::circuit_from_index (size_t index) const
std::pair<IndexedNetlistModel::circuit_pair, std::pair<IndexedNetlistModel::Status, std::string> > SingleIndexedNetlistModel::circuit_from_index(size_t index) const
{
db::Netlist::const_circuit_iterator none;
return std::make_pair (attr_by_object_and_index (std::make_pair (mp_netlist, (const db::Netlist *) 0), index, mp_netlist->begin_circuits (), mp_netlist->end_circuits (), none, none, m_circuit_by_index, sort_by_name<db::Circuit> ()), db::NetlistCrossReference::None);
return std::make_pair (attr_by_object_and_index (std::make_pair (mp_netlist, (const db::Netlist *) 0), index, mp_netlist->begin_circuits (), mp_netlist->end_circuits (), none, none, m_circuit_by_index, sort_by_name<db::Circuit> ()), std::make_pair (db::NetlistCrossReference::None, std::string ()));
}
std::pair<IndexedNetlistModel::net_pair, IndexedNetlistModel::Status>
SingleIndexedNetlistModel::net_from_index (const circuit_pair &circuits, size_t index) const
std::pair<IndexedNetlistModel::net_pair, std::pair<IndexedNetlistModel::Status, std::string> > SingleIndexedNetlistModel::net_from_index(const circuit_pair &circuits, size_t index) const
{
db::Circuit::const_net_iterator none;
return std::make_pair (attr_by_object_and_index (circuits, index, circuits.first->begin_nets (), circuits.first->end_nets (), none, none, m_net_by_circuit_and_index, sort_by_expanded_name<db::Net> ()), db::NetlistCrossReference::None);
return std::make_pair (attr_by_object_and_index (circuits, index, circuits.first->begin_nets (), circuits.first->end_nets (), none, none, m_net_by_circuit_and_index, sort_by_expanded_name<db::Net> ()), std::make_pair (db::NetlistCrossReference::None, std::string ()));
}
const db::Net *
@@ -394,25 +390,22 @@ SingleIndexedNetlistModel::net_pinref_from_index (const net_pair &nets, size_t i
return attr_by_object_and_index (nets, index, nets.first->begin_pins (), nets.first->end_pins (), none, none, m_pinref_by_net_and_index, sort_by_pin_name<db::NetPinRef> ());
}
std::pair<IndexedNetlistModel::device_pair, IndexedNetlistModel::Status>
SingleIndexedNetlistModel::device_from_index (const circuit_pair &circuits, size_t index) const
std::pair<IndexedNetlistModel::device_pair, std::pair<IndexedNetlistModel::Status, std::string> > SingleIndexedNetlistModel::device_from_index(const circuit_pair &circuits, size_t index) const
{
db::Circuit::const_device_iterator none;
return std::make_pair (attr_by_object_and_index (circuits, index, circuits.first->begin_devices (), circuits.first->end_devices (), none, none, m_device_by_circuit_and_index, sort_by_expanded_name<db::Device> ()), db::NetlistCrossReference::None);
return std::make_pair (attr_by_object_and_index (circuits, index, circuits.first->begin_devices (), circuits.first->end_devices (), none, none, m_device_by_circuit_and_index, sort_by_expanded_name<db::Device> ()), std::make_pair (db::NetlistCrossReference::None, std::string ()));
}
std::pair<IndexedNetlistModel::pin_pair, IndexedNetlistModel::Status>
SingleIndexedNetlistModel::pin_from_index (const circuit_pair &circuits, size_t index) const
std::pair<IndexedNetlistModel::pin_pair, std::pair<IndexedNetlistModel::Status, std::string> > SingleIndexedNetlistModel::pin_from_index(const circuit_pair &circuits, size_t index) const
{
db::Circuit::const_pin_iterator none;
return std::make_pair (attr_by_object_and_index (circuits, index, circuits.first->begin_pins (), circuits.first->end_pins (), none, none, m_pin_by_circuit_and_index, Unsorted ()), db::NetlistCrossReference::None);
return std::make_pair (attr_by_object_and_index (circuits, index, circuits.first->begin_pins (), circuits.first->end_pins (), none, none, m_pin_by_circuit_and_index, Unsorted ()), std::make_pair (db::NetlistCrossReference::None, std::string ()));
}
std::pair<IndexedNetlistModel::subcircuit_pair, IndexedNetlistModel::Status>
SingleIndexedNetlistModel::subcircuit_from_index (const circuit_pair &circuits, size_t index) const
std::pair<IndexedNetlistModel::subcircuit_pair, std::pair<IndexedNetlistModel::Status, std::string> > SingleIndexedNetlistModel::subcircuit_from_index(const circuit_pair &circuits, size_t index) const
{
db::Circuit::const_subcircuit_iterator none;
return std::make_pair (attr_by_object_and_index (circuits, index, circuits.first->begin_subcircuits (), circuits.first->end_subcircuits (), none, none, m_subcircuit_by_circuit_and_index, sort_by_expanded_name<db::SubCircuit> ()), db::NetlistCrossReference::None);
return std::make_pair (attr_by_object_and_index (circuits, index, circuits.first->begin_subcircuits (), circuits.first->end_subcircuits (), none, none, m_subcircuit_by_circuit_and_index, sort_by_expanded_name<db::SubCircuit> ()), std::make_pair (db::NetlistCrossReference::None, std::string ()));
}
size_t
+15 -15
View File
@@ -89,24 +89,24 @@ public:
virtual circuit_pair parent_of (const device_pair &device_pair) const = 0;
virtual circuit_pair parent_of (const subcircuit_pair &subcircuit_pair) const = 0;
virtual std::pair<circuit_pair, Status> top_circuit_from_index (size_t index) const = 0;
virtual std::pair<circuit_pair, Status> child_circuit_from_index (const circuit_pair &circuits, size_t index) const = 0;
virtual std::pair<circuit_pair, Status> circuit_from_index (size_t index) const = 0;
virtual std::pair<net_pair, Status> net_from_index (const circuit_pair &circuits, size_t index) const = 0;
virtual std::pair<circuit_pair, std::pair<Status, std::string> > top_circuit_from_index (size_t index) const = 0;
virtual std::pair<circuit_pair, std::pair<Status, std::string> > child_circuit_from_index (const circuit_pair &circuits, size_t index) const = 0;
virtual std::pair<circuit_pair, std::pair<Status, std::string> > circuit_from_index (size_t index) const = 0;
virtual std::pair<net_pair, std::pair<Status, std::string> > net_from_index (const circuit_pair &circuits, size_t index) const = 0;
virtual const db::Net *second_net_for (const db::Net *first) const = 0;
virtual const db::Circuit *second_circuit_for (const db::Circuit *first) const = 0;
virtual net_subcircuit_pin_pair net_subcircuit_pinref_from_index (const net_pair &nets, size_t index) const = 0;
virtual net_subcircuit_pin_pair subcircuit_pinref_from_index (const subcircuit_pair &subcircuits, size_t index) const = 0;
virtual net_terminal_pair net_terminalref_from_index (const net_pair &nets, size_t index) const = 0;
virtual net_pin_pair net_pinref_from_index (const net_pair &nets, size_t index) const = 0;
virtual std::pair<device_pair, Status> device_from_index (const circuit_pair &circuits, size_t index) const = 0;
virtual std::pair<pin_pair, Status> pin_from_index (const circuit_pair &circuits, size_t index) const = 0;
virtual std::pair<subcircuit_pair, Status> subcircuit_from_index (const circuit_pair &circuits, size_t index) const = 0;
virtual std::pair<device_pair, std::pair<Status, std::string> > device_from_index (const circuit_pair &circuits, size_t index) const = 0;
virtual std::pair<pin_pair, std::pair<Status, std::string> > pin_from_index (const circuit_pair &circuits, size_t index) const = 0;
virtual std::pair<subcircuit_pair, std::pair<Status, std::string> > subcircuit_from_index (const circuit_pair &circuits, size_t index) const = 0;
virtual std::string top_circuit_status_hint (size_t /*index*/) const { return std::string (); }
virtual std::string circuit_status_hint (size_t /*index*/) const { return std::string (); }
virtual std::string child_circuit_status_hint (const circuit_pair &/*circuits*/, size_t /*index*/) const { return std::string (); }
virtual std::string circuit_pair_status_hint (const std::pair<circuit_pair, Status> & /*cp*/) const { return std::string (); }
virtual std::string circuit_pair_status_hint (const std::pair<circuit_pair, std::pair<Status, std::string> > & /*cp*/) const { return std::string (); }
virtual std::string net_status_hint (const circuit_pair &/*circuits*/, size_t /*index*/) const { return std::string (); }
virtual std::string device_status_hint (const circuit_pair &/*circuits*/, size_t /*index*/) const { return std::string (); }
virtual std::string pin_status_hint (const circuit_pair &/*circuits*/, size_t /*index*/) const { return std::string (); }
@@ -159,19 +159,19 @@ public:
virtual circuit_pair parent_of (const device_pair &devices) const;
virtual circuit_pair parent_of (const subcircuit_pair &subcircuits) const;
virtual std::pair<circuit_pair, Status> top_circuit_from_index (size_t index) const;
virtual std::pair<circuit_pair, Status> circuit_from_index (size_t index) const;
virtual std::pair<circuit_pair, Status> child_circuit_from_index (const circuit_pair &circuits, size_t index) const;
virtual std::pair<net_pair, Status> net_from_index (const circuit_pair &circuits, size_t index) const;
virtual std::pair<circuit_pair, std::pair<Status, std::string> > top_circuit_from_index (size_t index) const;
virtual std::pair<circuit_pair, std::pair<Status, std::string> > circuit_from_index (size_t index) const;
virtual std::pair<circuit_pair, std::pair<Status, std::string> > child_circuit_from_index (const circuit_pair &circuits, size_t index) const;
virtual std::pair<net_pair, std::pair<Status, std::string> > net_from_index (const circuit_pair &circuits, size_t index) const;
virtual const db::Net *second_net_for (const db::Net *first) const;
virtual const db::Circuit *second_circuit_for (const db::Circuit *first) const;
virtual net_subcircuit_pin_pair net_subcircuit_pinref_from_index (const net_pair &nets, size_t index) const;
virtual net_subcircuit_pin_pair subcircuit_pinref_from_index (const subcircuit_pair &subcircuits, size_t index) const;
virtual net_terminal_pair net_terminalref_from_index (const net_pair &nets, size_t index) const;
virtual net_pin_pair net_pinref_from_index (const net_pair &nets, size_t index) const;
virtual std::pair<device_pair, Status> device_from_index (const circuit_pair &circuits, size_t index) const;
virtual std::pair<pin_pair, Status> pin_from_index (const circuit_pair &circuits, size_t index) const;
virtual std::pair<subcircuit_pair, Status> subcircuit_from_index (const circuit_pair &circuits, size_t index) const;
virtual std::pair<device_pair, std::pair<Status, std::string> > device_from_index (const circuit_pair &circuits, size_t index) const;
virtual std::pair<pin_pair, std::pair<Status, std::string> > pin_from_index (const circuit_pair &circuits, size_t index) const;
virtual std::pair<subcircuit_pair, std::pair<Status, std::string> > subcircuit_from_index (const circuit_pair &circuits, size_t index) const;
virtual size_t circuit_index (const circuit_pair &circuits) const;
virtual size_t net_index (const net_pair &nets) const;
@@ -1598,7 +1598,7 @@ db::NetlistCrossReference::Status
CircuitItemData::status (NetlistBrowserModel *model)
{
size_t index = model->indexer ()->circuit_index (m_cp);
return model->indexer ()->circuit_from_index (index).second;
return model->indexer ()->circuit_from_index (index).second.first;
}
CircuitNetItemData *
@@ -1938,7 +1938,7 @@ CircuitNetItemData::status (NetlistBrowserModel *model)
{
if (m_np.first || m_np.second) {
size_t index = model->indexer ()->net_index (m_np);
return model->indexer ()->net_from_index (circuits (), index).second;
return model->indexer ()->net_from_index (circuits (), index).second.first;
} else {
return db::NetlistCrossReference::None;
}
@@ -2016,7 +2016,7 @@ CircuitNetDeviceTerminalItemData::tooltip (NetlistBrowserModel *model)
db::NetlistCrossReference::Status
CircuitNetDeviceTerminalItemData::status (NetlistBrowserModel *model)
{
return model->indexer ()->device_from_index (circuits (), model->indexer ()->device_index (dp ())).second;
return model->indexer ()->device_from_index (circuits (), model->indexer ()->device_index (dp ())).second.first;
}
// ----------------------------------------------------------------------------------
@@ -2113,7 +2113,7 @@ CircuitNetSubCircuitPinItemData::tooltip (NetlistBrowserModel *model)
db::NetlistCrossReference::Status
CircuitNetSubCircuitPinItemData::status (NetlistBrowserModel *model)
{
return model->indexer ()->subcircuit_from_index (parent ()->circuits (), model->indexer ()->subcircuit_index (subcircuits ())).second;
return model->indexer ()->subcircuit_from_index (parent ()->circuits (), model->indexer ()->subcircuit_index (subcircuits ())).second.first;
}
// ----------------------------------------------------------------------------------
@@ -2272,7 +2272,7 @@ db::NetlistCrossReference::Status
CircuitSubCircuitItemData::status (NetlistBrowserModel *model)
{
size_t index = model->indexer ()->subcircuit_index (sp ());
return model->indexer ()->subcircuit_from_index (circuits (), index).second;
return model->indexer ()->subcircuit_from_index (circuits (), index).second.first;
}
// ----------------------------------------------------------------------------------
@@ -2371,7 +2371,7 @@ db::NetlistCrossReference::Status
CircuitDeviceItemData::status (NetlistBrowserModel *model)
{
size_t index = model->indexer ()->device_index (m_dp);
return model->indexer ()->device_from_index (circuits (), index).second;
return model->indexer ()->device_from_index (circuits (), index).second.first;
}
// ----------------------------------------------------------------------------------
@@ -204,10 +204,10 @@ NetlistBrowserTreeModel::search_text (const QModelIndex &index) const
return tl::to_qstring (search_string_from_names (circuits));
}
std::pair<std::pair<const db::Circuit *, const db::Circuit *>, db::NetlistCrossReference::Status>
std::pair<std::pair<const db::Circuit *, const db::Circuit *>, std::pair<db::NetlistCrossReference::Status, std::string> >
NetlistBrowserTreeModel::cp_status_from_index (const QModelIndex &index, size_t &nprod, size_t &nlast, size_t &nnlast) const
{
typedef std::pair<std::pair<const db::Circuit *, const db::Circuit *>, db::NetlistCrossReference::Status> cp_status;
typedef std::pair<std::pair<const db::Circuit *, const db::Circuit *>, std::pair<db::NetlistCrossReference::Status, std::string> > cp_status;
void *id = index.internalPointer ();
tl_assert (id != 0);
@@ -251,7 +251,7 @@ NetlistBrowserTreeModel::build_circuits_to_index (size_t nprod, const std::pair<
size_t child_nprod = nprod * (count + 1);
for (size_t n = count; n > 0; ) {
std::pair<std::pair<const db::Circuit *, const db::Circuit *>, IndexedNetlistModel::Status> cp = mp_indexer->child_circuit_from_index (circuits, n - 1);
std::pair<std::pair<const db::Circuit *, const db::Circuit *>, std::pair<db::NetlistCrossReference::Status, std::string> > cp = mp_indexer->child_circuit_from_index (circuits, n - 1);
QModelIndex child_index = createIndex (int (n - 1), 0, reinterpret_cast<void *> (size_t (index.internalPointer ()) + nprod * n));
build_circuits_to_index (child_nprod, cp.first, model, child_index, map);
--n;
@@ -304,7 +304,7 @@ NetlistBrowserTreeModel::index_from_circuits (const std::pair<const db::Circuit
size_t count = mp_indexer->top_circuit_count ();
for (size_t n = count; n > 0; ) {
std::pair<std::pair<const db::Circuit *, const db::Circuit *>, IndexedNetlistModel::Status> cp = mp_indexer->top_circuit_from_index (n - 1);
std::pair<std::pair<const db::Circuit *, const db::Circuit *>, std::pair<db::NetlistCrossReference::Status, std::string> > cp = mp_indexer->top_circuit_from_index (n - 1);
build_circuits_to_index (count + 1, cp.first, mp_indexer.get (), createIndex (int (n - 1), 0, reinterpret_cast<void *> (n)), m_circuits_to_index);
--n;
}
@@ -324,13 +324,13 @@ db::NetlistCrossReference::Status
NetlistBrowserTreeModel::status (const QModelIndex &index) const
{
size_t nprod = 0, nlast = 0, nnlast = 0;
return cp_status_from_index (index, nprod, nlast, nnlast).second;
return cp_status_from_index (index, nprod, nlast, nnlast).second.first;
}
QVariant
NetlistBrowserTreeModel::tooltip (const QModelIndex &index) const
{
typedef std::pair<std::pair<const db::Circuit *, const db::Circuit *>, db::NetlistCrossReference::Status> cp_status;
typedef std::pair<std::pair<const db::Circuit *, const db::Circuit *>, std::pair<db::NetlistCrossReference::Status, std::string> > cp_status;
size_t nlast = 0;
std::string hint;
@@ -88,7 +88,7 @@ private:
QVariant tooltip (const QModelIndex &index) const;
QString search_text (const QModelIndex &index) const;
db::NetlistCrossReference::Status status (const QModelIndex &index) const;
std::pair<std::pair<const db::Circuit *, const db::Circuit *>, db::NetlistCrossReference::Status> cp_status_from_index (const QModelIndex &index, size_t &nprod, size_t &nlast, size_t &nnlast) const;
std::pair<std::pair<const db::Circuit *, const db::Circuit *>, std::pair<db::NetlistCrossReference::Status, std::string> > cp_status_from_index(const QModelIndex &index, size_t &nprod, size_t &nlast, size_t &nnlast) const;
void build_circuits_to_index (size_t nprod, const std::pair<const db::Circuit *, const db::Circuit *> &circuits, IndexedNetlistModel *model, const QModelIndex &index, std::map<std::pair<const db::Circuit *, const db::Circuit *>, QModelIndex> &map) const;
db::LayoutToNetlist *mp_l2ndb;
@@ -263,39 +263,39 @@ IndexedNetlistModel::circuit_pair NetlistCrossReferenceModel::parent_of (const I
return get_parent_of (subcircuit_pair, mp_cross_ref.get (), m_parents_of_subcircuits);
}
std::pair<IndexedNetlistModel::circuit_pair, NetlistCrossReferenceModel::Status> NetlistCrossReferenceModel::top_circuit_from_index (size_t index) const
std::pair<IndexedNetlistModel::circuit_pair, std::pair<NetlistCrossReferenceModel::Status, std::string> > NetlistCrossReferenceModel::top_circuit_from_index (size_t index) const
{
build_top_circuit_list (mp_cross_ref.get (), m_top_level_circuits);
IndexedNetlistModel::circuit_pair cp = m_top_level_circuits [index];
const db::NetlistCrossReference::PerCircuitData *data = mp_cross_ref->per_circuit_data_for (cp);
tl_assert (data != 0);
return std::make_pair (cp, data->status);
return std::make_pair (cp, std::make_pair (data->status, data->msg));
}
std::pair<IndexedNetlistModel::circuit_pair, NetlistCrossReferenceModel::Status> NetlistCrossReferenceModel::child_circuit_from_index (const circuit_pair &circuits, size_t index) const
std::pair<IndexedNetlistModel::circuit_pair, std::pair<NetlistCrossReferenceModel::Status, std::string> > NetlistCrossReferenceModel::child_circuit_from_index (const circuit_pair &circuits, size_t index) const
{
build_child_circuit_map (mp_cross_ref.get (), m_child_circuits);
IndexedNetlistModel::circuit_pair cp = m_child_circuits [circuits][index];
const db::NetlistCrossReference::PerCircuitData *data = mp_cross_ref->per_circuit_data_for (cp);
tl_assert (data != 0);
return std::make_pair (cp, data->status);
return std::make_pair (cp, std::make_pair (data->status, data->msg));
}
std::pair<IndexedNetlistModel::circuit_pair, NetlistCrossReferenceModel::Status> NetlistCrossReferenceModel::circuit_from_index (size_t index) const
std::pair<IndexedNetlistModel::circuit_pair, std::pair<NetlistCrossReferenceModel::Status, std::string> > NetlistCrossReferenceModel::circuit_from_index (size_t index) const
{
IndexedNetlistModel::circuit_pair cp = mp_cross_ref->begin_circuits () [index];
const db::NetlistCrossReference::PerCircuitData *data = mp_cross_ref->per_circuit_data_for (cp);
tl_assert (data != 0);
return std::make_pair (cp, data->status);
return std::make_pair (cp, std::make_pair (data->status, data->msg));
}
std::pair<IndexedNetlistModel::net_pair, NetlistCrossReferenceModel::Status> NetlistCrossReferenceModel::net_from_index (const circuit_pair &circuits, size_t index) const
std::pair<IndexedNetlistModel::net_pair, std::pair<NetlistCrossReferenceModel::Status, std::string> > NetlistCrossReferenceModel::net_from_index (const circuit_pair &circuits, size_t index) const
{
const db::NetlistCrossReference::PerCircuitData *data = mp_cross_ref->per_circuit_data_for (circuits);
tl_assert (data != 0);
return std::make_pair (data->nets [index].pair, data->nets [index].status);
return std::make_pair (data->nets [index].pair, std::make_pair (data->nets [index].status, data->nets [index].msg));
}
const db::Net *NetlistCrossReferenceModel::second_net_for (const db::Net *first) const
@@ -484,25 +484,25 @@ IndexedNetlistModel::net_pin_pair NetlistCrossReferenceModel::net_pinref_from_in
return data->pins [index];
}
std::pair<IndexedNetlistModel::device_pair, NetlistCrossReferenceModel::Status> NetlistCrossReferenceModel::device_from_index (const circuit_pair &circuits, size_t index) const
std::pair<IndexedNetlistModel::device_pair, std::pair<NetlistCrossReferenceModel::Status, std::string> > NetlistCrossReferenceModel::device_from_index (const circuit_pair &circuits, size_t index) const
{
const db::NetlistCrossReference::PerCircuitData *data = mp_cross_ref->per_circuit_data_for (circuits);
tl_assert (data != 0);
return std::make_pair (data->devices [index].pair, data->devices [index].status);
return std::make_pair (data->devices [index].pair, std::make_pair (data->devices [index].status, data->devices [index].msg));
}
std::pair<IndexedNetlistModel::pin_pair, NetlistCrossReferenceModel::Status> NetlistCrossReferenceModel::pin_from_index (const circuit_pair &circuits, size_t index) const
std::pair<IndexedNetlistModel::pin_pair, std::pair<NetlistCrossReferenceModel::Status, std::string> > NetlistCrossReferenceModel::pin_from_index (const circuit_pair &circuits, size_t index) const
{
const db::NetlistCrossReference::PerCircuitData *data = mp_cross_ref->per_circuit_data_for (circuits);
tl_assert (data != 0);
return std::make_pair (data->pins [index].pair, data->pins [index].status);
return std::make_pair (data->pins [index].pair, std::make_pair (data->pins [index].status, data->pins [index].msg));
}
std::pair<IndexedNetlistModel::subcircuit_pair, NetlistCrossReferenceModel::Status> NetlistCrossReferenceModel::subcircuit_from_index (const circuit_pair &circuits, size_t index) const
std::pair<IndexedNetlistModel::subcircuit_pair, std::pair<NetlistCrossReferenceModel::Status, std::string> > NetlistCrossReferenceModel::subcircuit_from_index (const circuit_pair &circuits, size_t index) const
{
const db::NetlistCrossReference::PerCircuitData *data = mp_cross_ref->per_circuit_data_for (circuits);
tl_assert (data != 0);
return std::make_pair (data->subcircuits [index].pair, data->subcircuits [index].status);
return std::make_pair (data->subcircuits [index].pair, std::make_pair (data->subcircuits [index].status, data->pins [index].msg));
}
template <class Pair, class Iter>
@@ -609,27 +609,37 @@ size_t NetlistCrossReferenceModel::subcircuit_index (const subcircuit_pair &subc
return get_index_of (subcircuits, org_data->subcircuits.begin (), org_data->subcircuits.end (), data->index_of_subcircuits);
}
std::string NetlistCrossReferenceModel::circuit_pair_status_hint (const std::pair<IndexedNetlistModel::circuit_pair, NetlistCrossReferenceModel::Status> &cps) const
std::string NetlistCrossReferenceModel::circuit_pair_status_hint (const std::pair<IndexedNetlistModel::circuit_pair, std::pair<NetlistCrossReferenceModel::Status, std::string> > &cps) const
{
if (cps.second == db::NetlistCrossReference::Mismatch || cps.second == db::NetlistCrossReference::NoMatch) {
std::string msg;
if (cps.second.first == db::NetlistCrossReference::Mismatch || cps.second.first == db::NetlistCrossReference::NoMatch) {
if (! cps.first.first || ! cps.first.second) {
return tl::to_string (tr ("No matching circuit found in the other netlist.\n"
"By default, circuits are identified by their name.\n"
"A missing circuit probably means there is no circuit in the other netlist with this name.\n"
"If circuits with different names need to be associated, use 'same_circuits' in the\n"
"LVS script to establish such an association."));
msg = tl::to_string (tr ("No matching circuit found in the other netlist.\n"
"By default, circuits are identified by their name.\n"
"A missing circuit probably means there is no circuit in the other netlist with this name.\n"
"If circuits with different names need to be associated, use 'same_circuits' in the\n"
"LVS script to establish such an association."));
} else {
return tl::to_string (tr ("Circuits could be paired, but there is a mismatch inside.\n"
"Browse the circuit's component list to identify the mismatching elements."));
msg = tl::to_string (tr ("Circuits could be paired, but there is a mismatch inside.\n"
"Browse the circuit's component list to identify the mismatching elements."));
}
} else if (cps.second == db::NetlistCrossReference::Skipped) {
return tl::to_string (tr ("Circuits can only be matched if their child circuits have a known counterpart and a\n"
"pin-to-pin correspondence could be established for each child circuit.\n"
"This is not the case here. Browse the child circuits to identify the blockers.\n"
"Potential blockers are subcircuits without a corresponding other circuit or circuits\n"
"where some pins could not be mapped to pins from the corresponding other circuit."));
} else if (cps.second.first == db::NetlistCrossReference::Skipped) {
msg = tl::to_string (tr ("Circuits can only be matched if their child circuits have a known counterpart and a\n"
"pin-to-pin correspondence could be established for each child circuit.\n"
"This is not the case here. Browse the child circuits to identify the blockers.\n"
"Potential blockers are subcircuits without a corresponding other circuit or circuits\n"
"where some pins could not be mapped to pins from the corresponding other circuit."));
}
return std::string ();
if (! cps.second.second.empty ()) {
if (! msg.empty ()) {
msg += "\n\n";
}
msg += cps.second.second;
}
return msg;
}
std::string NetlistCrossReferenceModel::top_circuit_status_hint (size_t index) const
@@ -644,94 +654,149 @@ std::string NetlistCrossReferenceModel::circuit_status_hint (size_t index) const
std::string NetlistCrossReferenceModel::child_circuit_status_hint (const circuit_pair &circuits, size_t index) const
{
std::pair<IndexedNetlistModel::circuit_pair, NetlistCrossReferenceModel::Status> cps = child_circuit_from_index (circuits, index);
if (cps.second == db::NetlistCrossReference::Mismatch || cps.second == db::NetlistCrossReference::NoMatch) {
std::string msg;
std::pair<IndexedNetlistModel::circuit_pair, std::pair<NetlistCrossReferenceModel::Status, std::string> > cps = child_circuit_from_index (circuits, index);
if (cps.second.first == db::NetlistCrossReference::Mismatch || cps.second.first == db::NetlistCrossReference::NoMatch) {
if (!cps.first.first || !cps.first.second) {
return tl::to_string (tr ("No matching subcircuit was found in the other netlist - this is likely because pin\n"
"assignment could not be derived from the nets connected to the pins.\n"
"Check, if the pins are attached properly. If pins need to be swappable, consider using\n"
"'equivalent_pins' in the LVS script."));
msg = tl::to_string (tr ("No matching subcircuit was found in the other netlist - this is likely because pin\n"
"assignment could not be derived from the nets connected to the pins.\n"
"Check, if the pins are attached properly. If pins need to be swappable, consider using\n"
"'equivalent_pins' in the LVS script."));
} else {
return tl::to_string (tr ("Two different subcircuits fit here in the same way, but they are not\n"
"originating from equivalent circuits.\n"
"If the circuits behind the subcircuits are identical, using 'same_circuits'\n"
"in the LVS script will associate them."));
msg = tl::to_string (tr ("Two different subcircuits fit here in the same way, but they are not\n"
"originating from equivalent circuits.\n"
"If the circuits behind the subcircuits are identical, using 'same_circuits'\n"
"in the LVS script will associate them."));
}
}
return std::string ();
if (! cps.second.second.empty ()) {
if (! msg.empty ()) {
msg += "\n\n";
}
msg += cps.second.second;
}
return msg;
}
std::string NetlistCrossReferenceModel::net_status_hint (const circuit_pair &circuits, size_t index) const
{
std::pair<IndexedNetlistModel::net_pair, NetlistCrossReferenceModel::Status> cps = net_from_index (circuits, index);
if (cps.second == db::NetlistCrossReference::Mismatch || cps.second == db::NetlistCrossReference::NoMatch) {
return tl::to_string (tr ("Nets don't match. Nets match, if connected subcircuit pins and device terminals match to a\n"
"counterpart in the other netlist (component-wise and pin/terminal-wise).\n"
"If there already is a net candidate from the other netlist, scan the net members for\n"
"mismatching items (with errors or warnings) and fix these issues.\n"
"Otherwise, look for the corresponding other net.\n"
"Net items not found in the reference netlist indicate additional connections.\n"
"Net items only found in the reference netlist indicate missing connections."));
} else if (cps.second == db::NetlistCrossReference::MatchWithWarning) {
return tl::to_string (tr ("Nets match, but the choice was ambiguous. This may lead to mismatching nets in other places.\n"));
std::string msg;
std::pair<IndexedNetlistModel::net_pair, std::pair<NetlistCrossReferenceModel::Status, std::string> > cps = net_from_index (circuits, index);
if (cps.second.first == db::NetlistCrossReference::Mismatch || cps.second.first == db::NetlistCrossReference::NoMatch) {
msg = tl::to_string (tr ("Nets don't match. Nets match, if connected subcircuit pins and device terminals match to a\n"
"counterpart in the other netlist (component-wise and pin/terminal-wise).\n"
"If there already is a net candidate from the other netlist, scan the net members for\n"
"mismatching items (with errors or warnings) and fix these issues.\n"
"Otherwise, look for the corresponding other net.\n"
"Net items not found in the reference netlist indicate additional connections.\n"
"Net items only found in the reference netlist indicate missing connections."));
} else if (cps.second.first == db::NetlistCrossReference::MatchWithWarning) {
msg = tl::to_string (tr ("Nets match, but the choice was ambiguous. This may lead to mismatching nets in other places.\n"));
}
return std::string ();
if (! cps.second.second.empty ()) {
if (! msg.empty ()) {
msg += "\n\n";
}
msg += cps.second.second;
}
return msg;
}
std::string NetlistCrossReferenceModel::device_status_hint (const circuit_pair &circuits, size_t index) const
{
std::pair<IndexedNetlistModel::device_pair, NetlistCrossReferenceModel::Status> cps = device_from_index (circuits, index);
if (cps.second == db::NetlistCrossReference::Mismatch || cps.second == db::NetlistCrossReference::NoMatch) {
std::string msg;
std::pair<IndexedNetlistModel::device_pair, std::pair<NetlistCrossReferenceModel::Status, std::string> > cps = device_from_index (circuits, index);
if (cps.second.first == db::NetlistCrossReference::Mismatch || cps.second.first == db::NetlistCrossReference::NoMatch) {
if (!cps.first.first || !cps.first.second) {
return tl::to_string (tr ("No matching device was found in the other netlist.\n"
"Devices are identified by the nets they are attached to. Unmatched devices mean that\n"
"at least one terminal net isn't matched with a corresponding net from the other netlist.\n"
"Make all terminal nets match and the devices will match too."));
msg = tl::to_string (tr ("No matching device was found in the other netlist.\n"
"Devices are identified by the nets they are attached to. Unmatched devices mean that\n"
"at least one terminal net isn't matched with a corresponding net from the other netlist.\n"
"Make all terminal nets match and the devices will match too."));
} else {
return tl::to_string (tr ("Devices don't match topologically.\n"
"Check the terminal connections to identify the terminals not being connected to\n"
"corresponding nets. Either the devices are not connected correctly or the nets\n"
"need to be fixed before the devices will match too."));
msg = tl::to_string (tr ("Devices don't match topologically.\n"
"Check the terminal connections to identify the terminals not being connected to\n"
"corresponding nets. Either the devices are not connected correctly or the nets\n"
"need to be fixed before the devices will match too."));
}
} else if (cps.second == db::NetlistCrossReference::MatchWithWarning) {
return tl::to_string (tr ("Topologically matching devices are found here but either the parameters or the\n"
"device classes don't match.\n"
"If the device class is different but should be considered the same, using\n"
"'same_device_classed' in the LVS script will solve this issue."));
} else if (cps.second.first == db::NetlistCrossReference::MatchWithWarning) {
msg = tl::to_string (tr ("Topologically matching devices are found here but either the parameters or the\n"
"device classes don't match.\n"
"If the device class is different but should be considered the same, using\n"
"'same_device_classed' in the LVS script will solve this issue."));
}
return std::string ();
if (! cps.second.second.empty ()) {
if (! msg.empty ()) {
msg += "\n\n";
}
msg += cps.second.second;
}
return msg;
}
std::string NetlistCrossReferenceModel::pin_status_hint (const circuit_pair &circuits, size_t index) const
{
std::pair<IndexedNetlistModel::pin_pair, NetlistCrossReferenceModel::Status> cps = pin_from_index (circuits, index);
if (cps.second == db::NetlistCrossReference::Mismatch || cps.second == db::NetlistCrossReference::NoMatch) {
std::string msg;
std::pair<IndexedNetlistModel::pin_pair, std::pair<NetlistCrossReferenceModel::Status, std::string> > cps = pin_from_index (circuits, index);
if (cps.second.first == db::NetlistCrossReference::Mismatch || cps.second.first == db::NetlistCrossReference::NoMatch) {
if (!cps.first.first || !cps.first.second) {
return tl::to_string (tr ("No matching pin was found in the other netlist.\n"
"Pins are identified by the nets they are attached to - pins on equivalent nets are also\n"
"equivalent. Making the nets match will make the pins match too."));
msg = tl::to_string (tr ("No matching pin was found in the other netlist.\n"
"Pins are identified by the nets they are attached to - pins on equivalent nets are also\n"
"equivalent. Making the nets match will make the pins match too."));
}
}
return std::string ();
if (! cps.second.second.empty ()) {
if (! msg.empty ()) {
msg += "\n\n";
}
msg += cps.second.second;
}
return msg;
}
std::string NetlistCrossReferenceModel::subcircuit_status_hint (const circuit_pair &circuits, size_t index) const
{
std::pair<IndexedNetlistModel::subcircuit_pair, NetlistCrossReferenceModel::Status> cps = subcircuit_from_index (circuits, index);
if (cps.second == db::NetlistCrossReference::Mismatch || cps.second == db::NetlistCrossReference::NoMatch) {
std::string msg;
std::pair<IndexedNetlistModel::subcircuit_pair, std::pair<NetlistCrossReferenceModel::Status, std::string> > cps = subcircuit_from_index (circuits, index);
if (cps.second.first == db::NetlistCrossReference::Mismatch || cps.second.first == db::NetlistCrossReference::NoMatch) {
if (!cps.first.first || !cps.first.second) {
return tl::to_string (tr ("No matching subcircuit was found in the other netlist - this is likely because pin assignment\n"
"could not be derived from the nets connected to the pins.\n"
"Check, if the pins are attached properly. If pins need to be swappable, consider using\n"
"'equivalent_pins' in the LVS script."));
msg = tl::to_string (tr ("No matching subcircuit was found in the other netlist - this is likely because pin assignment\n"
"could not be derived from the nets connected to the pins.\n"
"Check, if the pins are attached properly. If pins need to be swappable, consider using\n"
"'equivalent_pins' in the LVS script."));
} else {
return tl::to_string (tr ("Two different subcircuits fit here in the same way, but they are not originating from\n"
"equivalent circuits.\n"
"If the circuits behind the subcircuits are identical, using 'same_circuits' in the LVS script\n"
"will associate them."));
msg = tl::to_string (tr ("Two different subcircuits fit here in the same way, but they are not originating from\n"
"equivalent circuits.\n"
"If the circuits behind the subcircuits are identical, using 'same_circuits' in the LVS script\n"
"will associate them."));
}
}
return std::string ();
if (! cps.second.second.empty ()) {
if (! msg.empty ()) {
msg += "\n\n";
}
msg += cps.second.second;
}
return msg;
}
}
@@ -59,24 +59,24 @@ public:
virtual circuit_pair parent_of (const device_pair &device_pair) const;
virtual circuit_pair parent_of (const subcircuit_pair &subcircuit_pair) const;
virtual std::pair<circuit_pair, Status> top_circuit_from_index (size_t index) const;
virtual std::pair<circuit_pair, Status> circuit_from_index (size_t index) const;
virtual std::pair<circuit_pair, Status> child_circuit_from_index (const circuit_pair &circuits, size_t index) const;
virtual std::pair<net_pair, Status> net_from_index (const circuit_pair &circuits, size_t index) const;
virtual std::pair<circuit_pair, std::pair<Status, std::string> > top_circuit_from_index(size_t index) const;
virtual std::pair<circuit_pair, std::pair<Status, std::string> > circuit_from_index (size_t index) const;
virtual std::pair<circuit_pair, std::pair<Status, std::string> > child_circuit_from_index(const circuit_pair &circuits, size_t index) const;
virtual std::pair<net_pair, std::pair<Status, std::string> > net_from_index (const circuit_pair &circuits, size_t index) const;
virtual const db::Net *second_net_for (const db::Net *first) const;
virtual const db::Circuit *second_circuit_for (const db::Circuit *first) const;
virtual net_subcircuit_pin_pair net_subcircuit_pinref_from_index (const net_pair &nets, size_t index) const;
virtual net_subcircuit_pin_pair subcircuit_pinref_from_index (const subcircuit_pair &nets, size_t index) const;
virtual net_terminal_pair net_terminalref_from_index (const net_pair &nets, size_t index) const;
virtual net_pin_pair net_pinref_from_index (const net_pair &nets, size_t index) const;
virtual std::pair<device_pair, Status> device_from_index (const circuit_pair &circuits, size_t index) const;
virtual std::pair<pin_pair, Status> pin_from_index (const circuit_pair &circuits, size_t index) const;
virtual std::pair<subcircuit_pair, Status> subcircuit_from_index (const circuit_pair &circuits, size_t index) const;
virtual std::pair<device_pair, std::pair<Status, std::string> > device_from_index (const circuit_pair &circuits, size_t index) const;
virtual std::pair<pin_pair, std::pair<Status, std::string> > pin_from_index (const circuit_pair &circuits, size_t index) const;
virtual std::pair<subcircuit_pair, std::pair<Status, std::string> > subcircuit_from_index (const circuit_pair &circuits, size_t index) const;
virtual std::string top_circuit_status_hint (size_t index) const;
virtual std::string circuit_status_hint (size_t index) const;
virtual std::string child_circuit_status_hint (const circuit_pair &circuits, size_t index) const;
virtual std::string circuit_pair_status_hint (const std::pair<circuit_pair, Status> &cp) const;
virtual std::string circuit_pair_status_hint (const std::pair<circuit_pair, std::pair<Status, std::string> > &cp) const;
virtual std::string net_status_hint (const circuit_pair &circuits, size_t index) const;
virtual std::string device_status_hint (const circuit_pair &circuits, size_t index) const;
virtual std::string pin_status_hint (const circuit_pair &circuits, size_t index) const;