mirror of https://github.com/KLayout/klayout.git
Better information in LVS report - at least for skipped circuits for now.
This commit is contained in:
parent
bb9ae20c32
commit
4549da561b
|
|
@ -88,19 +88,19 @@ namespace db
|
|||
*
|
||||
* [xref-def]:
|
||||
*
|
||||
* circuit([non] [non] [status]? [circuit-xrefs])
|
||||
* circuit([non] [non] [status]? [message]? [circuit-xrefs])
|
||||
* - circuit pair [short key: X]
|
||||
*
|
||||
* [circuit-xrefs]:
|
||||
*
|
||||
* xref([pair]*)
|
||||
* xref([pair]*) - circuit cross-reference part [short key: Z]
|
||||
*
|
||||
* [pair]
|
||||
*
|
||||
* pin([ion] [ion] [status]?) - a pin pair [short key: P]
|
||||
* device([ion] [ion] [status]?) - a device pair [short key: D]
|
||||
* circuit([ion] [ion] [status]?) - a subcircuit pair [short key: X]
|
||||
* net([ion] [ion] [status]?) - a net pair [short key: N]
|
||||
* pin([ion] [ion] [status]? [message]?) - a pin pair [short key: P]
|
||||
* device([ion] [ion] [status]? [message]?) - a device pair [short key: D]
|
||||
* circuit([ion] [ion] [status]? [message]?) - a subcircuit pair [short key: X]
|
||||
* net([ion] [ion] [status]? [message]?) - a net pair [short key: N]
|
||||
*
|
||||
* [non]
|
||||
*
|
||||
|
|
@ -110,6 +110,10 @@ namespace db
|
|||
*
|
||||
* <id> | ()
|
||||
*
|
||||
* [message]
|
||||
*
|
||||
* description(<name>) - error description [short key: B]
|
||||
*
|
||||
* [status]
|
||||
*
|
||||
* mismatch | - [short key: 0]
|
||||
|
|
|
|||
|
|
@ -112,6 +112,18 @@ void LayoutVsSchematicStandardReader::read_netlist (db::LayoutVsSchematic *lvs)
|
|||
}
|
||||
}
|
||||
|
||||
bool LayoutVsSchematicStandardReader::read_message (std::string &msg)
|
||||
{
|
||||
if (test (skeys::description_key) || test (lkeys::description_key)) {
|
||||
Brace br (this);
|
||||
read_word_or_quoted (msg);
|
||||
br.done ();
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool LayoutVsSchematicStandardReader::read_status (db::NetlistCrossReference::Status &status)
|
||||
{
|
||||
if (test (skeys::match_key) || test (lkeys::match_key)) {
|
||||
|
|
@ -189,11 +201,14 @@ void LayoutVsSchematicStandardReader::read_xref (db::NetlistCrossReference *xref
|
|||
xref->gen_begin_circuit (circuit_a, circuit_b);
|
||||
|
||||
db::NetlistCrossReference::Status status = db::NetlistCrossReference::None;
|
||||
std::string msg;
|
||||
|
||||
while (br) {
|
||||
|
||||
if (read_status (status)) {
|
||||
// continue
|
||||
} else if (read_message (msg)) {
|
||||
// continue
|
||||
} else if (test (skeys::xref_key) || test (lkeys::xref_key)) {
|
||||
read_xrefs_for_circuits (xref, circuit_a, circuit_b);
|
||||
} else if (at_end ()) {
|
||||
|
|
@ -204,7 +219,7 @@ void LayoutVsSchematicStandardReader::read_xref (db::NetlistCrossReference *xref
|
|||
|
||||
}
|
||||
|
||||
xref->gen_end_circuit (circuit_a, circuit_b, status);
|
||||
xref->gen_end_circuit (circuit_a, circuit_b, status, msg);
|
||||
|
||||
br.done ();
|
||||
|
||||
|
|
@ -325,11 +340,13 @@ void LayoutVsSchematicStandardReader::read_net_pair (db::NetlistCrossReference *
|
|||
ion_b = read_ion ();
|
||||
|
||||
db::NetlistCrossReference::Status status = db::NetlistCrossReference::None;
|
||||
std::string msg;
|
||||
read_status (status);
|
||||
read_message (msg);
|
||||
|
||||
br.done ();
|
||||
|
||||
xref->gen_nets (net_by_numerical_id (circuit_a, ion_a, m_map_per_circuit_a), net_by_numerical_id (circuit_b, ion_b, m_map_per_circuit_b), status);
|
||||
xref->gen_nets (net_by_numerical_id (circuit_a, ion_a, m_map_per_circuit_a), net_by_numerical_id (circuit_b, ion_b, m_map_per_circuit_b), status, msg);
|
||||
}
|
||||
|
||||
void LayoutVsSchematicStandardReader::read_pin_pair (db::NetlistCrossReference *xref, const db::Circuit *circuit_a, const db::Circuit *circuit_b)
|
||||
|
|
@ -341,11 +358,13 @@ void LayoutVsSchematicStandardReader::read_pin_pair (db::NetlistCrossReference *
|
|||
ion_b = read_ion ();
|
||||
|
||||
db::NetlistCrossReference::Status status = db::NetlistCrossReference::None;
|
||||
std::string msg;
|
||||
read_status (status);
|
||||
read_message (msg);
|
||||
|
||||
br.done ();
|
||||
|
||||
xref->gen_pins (pin_by_numerical_id (circuit_a, ion_a), pin_by_numerical_id (circuit_b, ion_b), status);
|
||||
xref->gen_pins (pin_by_numerical_id (circuit_a, ion_a), pin_by_numerical_id (circuit_b, ion_b), status, msg);
|
||||
}
|
||||
|
||||
void LayoutVsSchematicStandardReader::read_device_pair (db::NetlistCrossReference *xref, const db::Circuit *circuit_a, const db::Circuit *circuit_b)
|
||||
|
|
@ -357,11 +376,13 @@ void LayoutVsSchematicStandardReader::read_device_pair (db::NetlistCrossReferenc
|
|||
ion_b = read_ion ();
|
||||
|
||||
db::NetlistCrossReference::Status status = db::NetlistCrossReference::None;
|
||||
std::string msg;
|
||||
read_status (status);
|
||||
read_message (msg);
|
||||
|
||||
br.done ();
|
||||
|
||||
xref->gen_devices (device_by_numerical_id (circuit_a, ion_a, m_map_per_circuit_a), device_by_numerical_id (circuit_b, ion_b, m_map_per_circuit_b), status);
|
||||
xref->gen_devices (device_by_numerical_id (circuit_a, ion_a, m_map_per_circuit_a), device_by_numerical_id (circuit_b, ion_b, m_map_per_circuit_b), status, msg);
|
||||
}
|
||||
|
||||
void LayoutVsSchematicStandardReader::read_subcircuit_pair (db::NetlistCrossReference *xref, const db::Circuit *circuit_a, const db::Circuit *circuit_b)
|
||||
|
|
@ -373,11 +394,13 @@ void LayoutVsSchematicStandardReader::read_subcircuit_pair (db::NetlistCrossRefe
|
|||
ion_b = read_ion ();
|
||||
|
||||
db::NetlistCrossReference::Status status = db::NetlistCrossReference::None;
|
||||
std::string msg;
|
||||
read_status (status);
|
||||
read_message (msg);
|
||||
|
||||
br.done ();
|
||||
|
||||
xref->gen_subcircuits (subcircuit_by_numerical_id (circuit_a, ion_a, m_map_per_circuit_a), subcircuit_by_numerical_id (circuit_b, ion_b, m_map_per_circuit_b), status);
|
||||
xref->gen_subcircuits (subcircuit_by_numerical_id (circuit_a, ion_a, m_map_per_circuit_a), subcircuit_by_numerical_id (circuit_b, ion_b, m_map_per_circuit_b), status, msg);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,6 +78,7 @@ private:
|
|||
void read_netlist (db::LayoutVsSchematic *lvs);
|
||||
|
||||
bool read_status (db::NetlistCrossReference::Status &status);
|
||||
bool read_message (std::string &msg);
|
||||
void read_xref (db::NetlistCrossReference *xref);
|
||||
void read_xrefs_for_circuits (db::NetlistCrossReference *xref, const db::Circuit *circuit_a, const db::Circuit *circuit_b);
|
||||
void read_net_pair (db::NetlistCrossReference *xref, const db::Circuit *circuit_a, const db::Circuit *circuit_b);
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@ private:
|
|||
}
|
||||
|
||||
std::string status_to_s (const db::NetlistCrossReference::Status status);
|
||||
std::string message_to_s (const std::string &msg);
|
||||
void write (const db::NetlistCrossReference *xref);
|
||||
|
||||
std::map<const db::Circuit *, std::map<const db::Net *, unsigned int> > m_net2id_per_circuit_a, m_net2id_per_circuit_b;
|
||||
|
|
@ -156,6 +157,16 @@ std::string net_id_to_s (const db::Net *net, const std::map<const db::Net *, uns
|
|||
}
|
||||
}
|
||||
|
||||
template <class Keys>
|
||||
std::string std_writer_impl<Keys>::message_to_s (const std::string &msg)
|
||||
{
|
||||
if (msg.empty ()) {
|
||||
return std::string ();
|
||||
} else {
|
||||
return " " + Keys::description_key + "(" + tl::to_word_or_quoted_string (msg) + ")";
|
||||
}
|
||||
}
|
||||
|
||||
template <class Keys>
|
||||
std::string std_writer_impl<Keys>::status_to_s (const db::NetlistCrossReference::Status status)
|
||||
{
|
||||
|
|
@ -182,23 +193,23 @@ void std_writer_impl<Keys>::write (const db::NetlistCrossReference *xref)
|
|||
const db::NetlistCrossReference::PerCircuitData *pcd = xref->per_circuit_data_for (*c);
|
||||
tl_assert (pcd != 0);
|
||||
|
||||
stream () << indent1 << Keys::circuit_key << "(" << name_to_s (c->first) << " " << name_to_s (c->second) << status_to_s (pcd->status) << endl;
|
||||
stream () << indent1 << Keys::circuit_key << "(" << name_to_s (c->first) << " " << name_to_s (c->second) << status_to_s (pcd->status) << message_to_s (pcd->msg) << endl;
|
||||
stream () << indent2 << Keys::xref_key << "(" << endl;
|
||||
|
||||
for (db::NetlistCrossReference::PerCircuitData::net_pairs_const_iterator n = pcd->nets.begin (); n != pcd->nets.end (); ++n) {
|
||||
stream () << indent1 << indent2 << Keys::net_key << "(" << net_id_to_s (n->pair.first, m_net2id_per_circuit_a [c->first]) << " " << net_id_to_s (n->pair.second, m_net2id_per_circuit_b [c->second]) << status_to_s (n->status) << ")" << endl;
|
||||
stream () << indent1 << indent2 << Keys::net_key << "(" << net_id_to_s (n->pair.first, m_net2id_per_circuit_a [c->first]) << " " << net_id_to_s (n->pair.second, m_net2id_per_circuit_b [c->second]) << status_to_s (n->status) << message_to_s (n->msg) << ")" << endl;
|
||||
}
|
||||
|
||||
for (db::NetlistCrossReference::PerCircuitData::pin_pairs_const_iterator n = pcd->pins.begin (); n != pcd->pins.end (); ++n) {
|
||||
stream () << indent1 << indent2 << Keys::pin_key << "(" << ion_to_s (n->pair.first) << " " << ion_to_s (n->pair.second) << status_to_s (n->status) << ")" << endl;
|
||||
stream () << indent1 << indent2 << Keys::pin_key << "(" << ion_to_s (n->pair.first) << " " << ion_to_s (n->pair.second) << status_to_s (n->status) << message_to_s (n->msg) << ")" << endl;
|
||||
}
|
||||
|
||||
for (db::NetlistCrossReference::PerCircuitData::device_pairs_const_iterator n = pcd->devices.begin (); n != pcd->devices.end (); ++n) {
|
||||
stream () << indent1 << indent2 << Keys::device_key << "(" << ion_to_s (n->pair.first) << " " << ion_to_s (n->pair.second) << status_to_s (n->status) << ")" << endl;
|
||||
stream () << indent1 << indent2 << Keys::device_key << "(" << ion_to_s (n->pair.first) << " " << ion_to_s (n->pair.second) << status_to_s (n->status) << message_to_s (n->msg) << ")" << endl;
|
||||
}
|
||||
|
||||
for (db::NetlistCrossReference::PerCircuitData::subcircuit_pairs_const_iterator n = pcd->subcircuits.begin (); n != pcd->subcircuits.end (); ++n) {
|
||||
stream () << indent1 << indent2 << Keys::circuit_key << "(" << ion_to_s (n->pair.first) << " " << ion_to_s (n->pair.second) << status_to_s (n->status) << ")" << endl;
|
||||
stream () << indent1 << indent2 << Keys::circuit_key << "(" << ion_to_s (n->pair.first) << " " << ion_to_s (n->pair.second) << status_to_s (n->status) << message_to_s (n->msg) << ")" << endl;
|
||||
}
|
||||
|
||||
stream () << indent2 << ")" << endl;
|
||||
|
|
|
|||
|
|
@ -397,7 +397,7 @@ public:
|
|||
* @brief A generic categorizer
|
||||
*
|
||||
* The objective of this class is to supply a category ID for a given object.
|
||||
* The category ID also identities equivalent objects from netlist A and B.
|
||||
* The category ID also identifies equivalent objects from netlist A and B.
|
||||
*/
|
||||
template <class Obj>
|
||||
class generic_categorizer
|
||||
|
|
@ -3083,7 +3083,7 @@ NetlistComparer::compare (const db::Netlist *a, const db::Netlist *b) const
|
|||
} else {
|
||||
|
||||
if (mp_logger) {
|
||||
mp_logger->circuit_skipped (ca, cb);
|
||||
mp_logger->circuit_skipped (ca, cb, generate_subcircuits_not_verified_warning (ca, verified_circuits_a, cb, verified_circuits_b));
|
||||
good = false;
|
||||
}
|
||||
|
||||
|
|
@ -3130,24 +3130,61 @@ NetlistComparer::derive_pin_equivalence (const db::Circuit *ca, const db::Circui
|
|||
circuit_pin_mapper->map_pins (cb, pb);
|
||||
}
|
||||
|
||||
static bool is_valid_circuit (const db::Circuit *c)
|
||||
{
|
||||
// typical via subcircuits attach through one pin. We can safely ignore such subcircuits because they don't
|
||||
// contribute graph edges.
|
||||
return c->pin_count () > 1;
|
||||
}
|
||||
|
||||
bool
|
||||
NetlistComparer::all_subcircuits_verified (const db::Circuit *c, const std::set<const db::Circuit *> &verified_circuits) const
|
||||
{
|
||||
for (db::Circuit::const_subcircuit_iterator sc = c->begin_subcircuits (); sc != c->end_subcircuits (); ++sc) {
|
||||
|
||||
const db::Circuit *cr = sc->circuit_ref ();
|
||||
|
||||
// typical via subcircuits attach through one pin. We can safely ignore such subcircuits because they don't
|
||||
// contribute graph edges.
|
||||
if (cr->pin_count () > 1 && verified_circuits.find (cr) == verified_circuits.end ()) {
|
||||
if (is_valid_circuit (cr) && verified_circuits.find (cr) == verified_circuits.end ()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static std::vector<std::string> unverified_names (const db::Circuit *c, const std::set<const db::Circuit *> &verified_circuits)
|
||||
{
|
||||
std::vector<std::string> names;
|
||||
|
||||
std::set<const db::Circuit *> seen;
|
||||
for (db::Circuit::const_subcircuit_iterator sc = c->begin_subcircuits (); sc != c->end_subcircuits (); ++sc) {
|
||||
const db::Circuit *cr = sc->circuit_ref ();
|
||||
if (is_valid_circuit (cr) && seen.find (cr) == seen.end () && verified_circuits.find (cr) == verified_circuits.end ()) {
|
||||
seen.insert (cr);
|
||||
names.push_back (cr->name ());
|
||||
}
|
||||
}
|
||||
|
||||
std::sort (names.begin (), names.end ());
|
||||
return names;
|
||||
}
|
||||
|
||||
std::string
|
||||
NetlistComparer::generate_subcircuits_not_verified_warning (const db::Circuit *ca, const std::set<const db::Circuit *> &verified_circuits_a, const db::Circuit *cb, const std::set<const db::Circuit *> &verified_circuits_b) const
|
||||
{
|
||||
std::string msg = tl::sprintf (tl::to_string (tr ("Circuits %s and %s could not be compared because the following subcircuits failed to compare:")), ca->name (), cb->name ());
|
||||
|
||||
std::vector<std::string> names_a = unverified_names (ca, verified_circuits_a);
|
||||
if (! names_a.empty ()) {
|
||||
msg += "\n A: " + tl::join (names_a, ",");
|
||||
}
|
||||
|
||||
std::vector<std::string> names_b = unverified_names (cb, verified_circuits_b);
|
||||
if (! names_b.empty ()) {
|
||||
msg += "\n B: " + tl::join (names_b, ",");
|
||||
}
|
||||
|
||||
return msg;
|
||||
}
|
||||
|
||||
static std::vector<std::pair<size_t, size_t> >
|
||||
compute_device_key (const db::Device &device, const db::NetGraph &g, bool strict)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ public:
|
|||
* @brief There is a device class mismatch
|
||||
* "a" is null if there is no match for b and vice versa.
|
||||
*/
|
||||
virtual void device_class_mismatch (const db::DeviceClass * /*a*/, const db::DeviceClass * /*b*/) { }
|
||||
virtual void device_class_mismatch (const db::DeviceClass * /*a*/, const db::DeviceClass * /*b*/, const std::string & /*msg*/ = std::string ()) { }
|
||||
|
||||
/**
|
||||
* @brief Begin logging for circuit a and b
|
||||
|
|
@ -74,19 +74,19 @@ public:
|
|||
/**
|
||||
* @brief End logging for circuit a and b
|
||||
*/
|
||||
virtual void end_circuit (const db::Circuit * /*a*/, const db::Circuit * /*b*/, bool /*matching*/) { }
|
||||
virtual void end_circuit (const db::Circuit * /*a*/, const db::Circuit * /*b*/, bool /*matching*/, const std::string & /*msg*/ = std::string ()) { }
|
||||
|
||||
/**
|
||||
* @brief Circuits are skipped
|
||||
* Circuits are skipped if their subcircuits could not be matched.
|
||||
*/
|
||||
virtual void circuit_skipped (const db::Circuit * /*a*/, const db::Circuit * /*b*/) { }
|
||||
virtual void circuit_skipped (const db::Circuit * /*a*/, const db::Circuit * /*b*/, const std::string & /*msg*/ = std::string ()) { }
|
||||
|
||||
/**
|
||||
* @brief There is a circuit mismatch
|
||||
* "a" is null if there is no match for b and vice versa.
|
||||
*/
|
||||
virtual void circuit_mismatch (const db::Circuit * /*a*/, const db::Circuit * /*b*/) { }
|
||||
virtual void circuit_mismatch (const db::Circuit * /*a*/, const db::Circuit * /*b*/, const std::string & /*msg*/ = std::string ()) { }
|
||||
|
||||
/**
|
||||
* @brief Nets a and b match exactly
|
||||
|
|
@ -98,7 +98,7 @@ public:
|
|||
* Other nets might also match with a and also with b. Matching this a and b is
|
||||
* an arbitrary decision.
|
||||
*/
|
||||
virtual void match_ambiguous_nets (const db::Net * /*a*/, const db::Net * /*b*/) { }
|
||||
virtual void match_ambiguous_nets (const db::Net * /*a*/, const db::Net * /*b*/, const std::string & /*msg*/ = std::string ()) { }
|
||||
|
||||
/**
|
||||
* @brief Net a or b doesn't match
|
||||
|
|
@ -107,7 +107,7 @@ public:
|
|||
* nets are known not to match. Still the compare algorithm will proceed as
|
||||
* if these nets were equivalent to derive further matches.
|
||||
*/
|
||||
virtual void net_mismatch (const db::Net * /*a*/, const db::Net * /*b*/) { }
|
||||
virtual void net_mismatch (const db::Net * /*a*/, const db::Net * /*b*/, const std::string & /*msg*/ = std::string ()) { }
|
||||
|
||||
/**
|
||||
* @brief Devices a and b match exactly
|
||||
|
|
@ -128,7 +128,7 @@ public:
|
|||
* @brief Device a or b doesn't match
|
||||
* "a" is null if there is no match for b and vice versa.
|
||||
*/
|
||||
virtual void device_mismatch (const db::Device * /*a*/, const db::Device * /*b*/) { }
|
||||
virtual void device_mismatch (const db::Device * /*a*/, const db::Device * /*b*/, const std::string & /*msg*/ = std::string ()) { }
|
||||
|
||||
/**
|
||||
* @brief Pins a and b of the current circuit are matched
|
||||
|
|
@ -139,7 +139,7 @@ public:
|
|||
* @brief Pin a or b doesn't match
|
||||
* "a" is null if there is no match for b and vice versa.
|
||||
*/
|
||||
virtual void pin_mismatch (const db::Pin * /*a*/, const db::Pin * /*b*/) { }
|
||||
virtual void pin_mismatch (const db::Pin * /*a*/, const db::Pin * /*b*/, const std::string & /*msg*/ = std::string ()) { }
|
||||
|
||||
/**
|
||||
* @brief Subcircuits a and b match exactly
|
||||
|
|
@ -150,7 +150,7 @@ public:
|
|||
* @brief SubCircuit a or b doesn't match
|
||||
* "a" is null if there is no match for b and vice versa.
|
||||
*/
|
||||
virtual void subcircuit_mismatch (const db::SubCircuit * /*a*/, const db::SubCircuit * /*b*/) { }
|
||||
virtual void subcircuit_mismatch (const db::SubCircuit * /*a*/, const db::SubCircuit * /*b*/, const std::string & /*msg*/ = std::string ()) { }
|
||||
|
||||
private:
|
||||
// No copying
|
||||
|
|
@ -346,6 +346,7 @@ private:
|
|||
protected:
|
||||
bool compare_circuits (const db::Circuit *c1, const db::Circuit *c2, db::DeviceCategorizer &device_categorizer, db::CircuitCategorizer &circuit_categorizer, db::CircuitPinMapper &circuit_pin_mapper, const std::vector<std::pair<const Net *, const Net *> > &net_identity, bool &pin_mismatch, std::map<const db::Circuit *, CircuitMapper> &c12_circuit_and_pin_mapping, std::map<const db::Circuit *, CircuitMapper> &c22_circuit_and_pin_mapping) const;
|
||||
bool all_subcircuits_verified (const db::Circuit *c, const std::set<const db::Circuit *> &verified_circuits) const;
|
||||
std::string generate_subcircuits_not_verified_warning (const db::Circuit *ca, const std::set<const db::Circuit *> &verified_circuits_a, const db::Circuit *cb, const std::set<const db::Circuit *> &verified_circuits_b) const;
|
||||
static void derive_pin_equivalence (const db::Circuit *ca, const db::Circuit *cb, CircuitPinMapper *circuit_pin_mapper);
|
||||
void do_pin_assignment (const db::Circuit *c1, const db::NetGraph &g1, const db::Circuit *c2, const db::NetGraph &g2, std::map<const db::Circuit *, CircuitMapper> &c12_circuit_and_pin_mapping, std::map<const db::Circuit *, CircuitMapper> &c22_circuit_and_pin_mapping, bool &pin_mismatch, bool &good) const;
|
||||
void do_device_assignment (const db::Circuit *c1, const db::NetGraph &g1, const db::Circuit *c2, const db::NetGraph &g2, const db::DeviceFilter &device_filter, DeviceCategorizer &device_categorizer, db::DeviceEquivalenceTracker &device_eq, bool &good) const;
|
||||
|
|
|
|||
|
|
@ -338,9 +338,9 @@ NetlistCrossReference::establish_pair (const db::Circuit *a, const db::Circuit *
|
|||
}
|
||||
|
||||
void
|
||||
NetlistCrossReference::establish_pair (const db::Net *a, const db::Net *b, Status status)
|
||||
NetlistCrossReference::establish_pair (const db::Net *a, const db::Net *b, Status status, const std::string &msg)
|
||||
{
|
||||
mp_per_circuit_data->nets.push_back (NetPairData (a, b, status));
|
||||
mp_per_circuit_data->nets.push_back (NetPairData (a, b, status, msg));
|
||||
if (a) {
|
||||
m_other_net [a] = b;
|
||||
}
|
||||
|
|
@ -350,9 +350,9 @@ NetlistCrossReference::establish_pair (const db::Net *a, const db::Net *b, Statu
|
|||
}
|
||||
|
||||
void
|
||||
NetlistCrossReference::establish_pair (const db::Device *a, const db::Device *b, Status status)
|
||||
NetlistCrossReference::establish_pair (const db::Device *a, const db::Device *b, Status status, const std::string &msg)
|
||||
{
|
||||
mp_per_circuit_data->devices.push_back (DevicePairData (a, b, status));
|
||||
mp_per_circuit_data->devices.push_back (DevicePairData (a, b, status, msg));
|
||||
if (a) {
|
||||
m_other_device [a] = b;
|
||||
}
|
||||
|
|
@ -362,9 +362,9 @@ NetlistCrossReference::establish_pair (const db::Device *a, const db::Device *b,
|
|||
}
|
||||
|
||||
void
|
||||
NetlistCrossReference::establish_pair (const db::Pin *a, const db::Pin *b, Status status)
|
||||
NetlistCrossReference::establish_pair (const db::Pin *a, const db::Pin *b, Status status, const std::string &msg)
|
||||
{
|
||||
mp_per_circuit_data->pins.push_back (PinPairData (a, b, status));
|
||||
mp_per_circuit_data->pins.push_back (PinPairData (a, b, status, msg));
|
||||
if (a) {
|
||||
m_other_pin [a] = b;
|
||||
}
|
||||
|
|
@ -374,9 +374,9 @@ NetlistCrossReference::establish_pair (const db::Pin *a, const db::Pin *b, Statu
|
|||
}
|
||||
|
||||
void
|
||||
NetlistCrossReference::establish_pair (const db::SubCircuit *a, const db::SubCircuit *b, Status status)
|
||||
NetlistCrossReference::establish_pair (const db::SubCircuit *a, const db::SubCircuit *b, Status status, const std::string &msg)
|
||||
{
|
||||
mp_per_circuit_data->subcircuits.push_back (SubCircuitPairData (a, b, status));
|
||||
mp_per_circuit_data->subcircuits.push_back (SubCircuitPairData (a, b, status, msg));
|
||||
if (a) {
|
||||
m_other_subcircuit [a] = b;
|
||||
}
|
||||
|
|
@ -403,36 +403,37 @@ NetlistCrossReference::sort_circuit ()
|
|||
}
|
||||
|
||||
void
|
||||
NetlistCrossReference::gen_end_circuit (const db::Circuit *, const db::Circuit *, Status status)
|
||||
NetlistCrossReference::gen_end_circuit (const db::Circuit *, const db::Circuit *, Status status, const std::string &msg)
|
||||
{
|
||||
mp_per_circuit_data->status = status;
|
||||
mp_per_circuit_data->msg = msg;
|
||||
|
||||
m_current_circuits = std::make_pair((const db::Circuit *)0, (const db::Circuit *)0);
|
||||
mp_per_circuit_data = 0;
|
||||
}
|
||||
|
||||
void
|
||||
NetlistCrossReference::gen_nets (const db::Net *a, const db::Net *b, Status status)
|
||||
NetlistCrossReference::gen_nets (const db::Net *a, const db::Net *b, Status status, const std::string &msg)
|
||||
{
|
||||
establish_pair (a, b, status);
|
||||
establish_pair (a, b, status, msg);
|
||||
}
|
||||
|
||||
void
|
||||
NetlistCrossReference::gen_devices (const db::Device *a, const db::Device *b, Status status)
|
||||
NetlistCrossReference::gen_devices (const db::Device *a, const db::Device *b, Status status, const std::string &msg)
|
||||
{
|
||||
establish_pair (a, b, status);
|
||||
establish_pair (a, b, status, msg);
|
||||
}
|
||||
|
||||
void
|
||||
NetlistCrossReference::gen_pins (const db::Pin *a, const db::Pin *b, Status status)
|
||||
NetlistCrossReference::gen_pins (const db::Pin *a, const db::Pin *b, Status status, const std::string &msg)
|
||||
{
|
||||
establish_pair (a, b, status);
|
||||
establish_pair (a, b, status, msg);
|
||||
}
|
||||
|
||||
void
|
||||
NetlistCrossReference::gen_subcircuits (const db::SubCircuit *a, const db::SubCircuit *b, Status status)
|
||||
NetlistCrossReference::gen_subcircuits (const db::SubCircuit *a, const db::SubCircuit *b, Status status, const std::string &msg)
|
||||
{
|
||||
establish_pair (a, b, status);
|
||||
establish_pair (a, b, status, msg);
|
||||
}
|
||||
|
||||
static void init_data_from_single (const db::Net *net, NetlistCrossReference::PerNetData &data, bool first)
|
||||
|
|
|
|||
|
|
@ -61,44 +61,48 @@ public:
|
|||
{
|
||||
typedef db::Net object_type;
|
||||
|
||||
NetPairData (const db::Net *a, const db::Net *b, Status s) : pair (a, b), status (s) { }
|
||||
NetPairData (const db::Net *a, const db::Net *b, Status s, const std::string &m) : pair (a, b), status (s), msg (m) { }
|
||||
NetPairData () : pair ((const db::Net *)0, (const db::Net *)0), status (None) { }
|
||||
|
||||
std::pair<const db::Net *, const db::Net *> pair;
|
||||
Status status;
|
||||
std::string msg;
|
||||
};
|
||||
|
||||
struct DevicePairData
|
||||
{
|
||||
typedef db::Device object_type;
|
||||
|
||||
DevicePairData (const db::Device *a, const db::Device *b, Status s) : pair (a, b), status (s) { }
|
||||
DevicePairData (const db::Device *a, const db::Device *b, Status s, const std::string &m) : pair (a, b), status (s), msg (m) { }
|
||||
DevicePairData () : pair ((const db::Device *)0, (const db::Device *)0), status (None) { }
|
||||
|
||||
std::pair<const db::Device *, const db::Device *> pair;
|
||||
Status status;
|
||||
std::string msg;
|
||||
};
|
||||
|
||||
struct PinPairData
|
||||
{
|
||||
typedef db::Pin object_type;
|
||||
|
||||
PinPairData (const db::Pin *a, const db::Pin *b, Status s) : pair (a, b), status (s) { }
|
||||
PinPairData (const db::Pin *a, const db::Pin *b, Status s, const std::string &m) : pair (a, b), status (s), msg (m) { }
|
||||
PinPairData () : pair ((const db::Pin *)0, (const db::Pin *)0), status (None) { }
|
||||
|
||||
std::pair<const db::Pin *, const db::Pin *> pair;
|
||||
Status status;
|
||||
std::string msg;
|
||||
};
|
||||
|
||||
struct SubCircuitPairData
|
||||
{
|
||||
typedef db::SubCircuit object_type;
|
||||
|
||||
SubCircuitPairData (const db::SubCircuit *a, const db::SubCircuit *b, Status s) : pair (a, b), status (s) { }
|
||||
SubCircuitPairData (const db::SubCircuit *a, const db::SubCircuit *b, Status s, const std::string &m) : pair (a, b), status (s), msg (m) { }
|
||||
SubCircuitPairData () : pair ((const db::SubCircuit *)0, (const db::SubCircuit *)0), status (None) { }
|
||||
|
||||
std::pair<const db::SubCircuit *, const db::SubCircuit *> pair;
|
||||
Status status;
|
||||
std::string msg;
|
||||
};
|
||||
|
||||
struct PerCircuitData
|
||||
|
|
@ -115,6 +119,7 @@ public:
|
|||
typedef subcircuit_pairs_type::const_iterator subcircuit_pairs_const_iterator;
|
||||
|
||||
Status status;
|
||||
std::string msg;
|
||||
net_pairs_type nets;
|
||||
device_pairs_type devices;
|
||||
pin_pairs_type pins;
|
||||
|
|
@ -139,11 +144,11 @@ public:
|
|||
void gen_begin_netlist (const db::Netlist *a, const db::Netlist *b);
|
||||
void gen_end_netlist (const db::Netlist *a, const db::Netlist *b);
|
||||
void gen_begin_circuit (const db::Circuit *a, const db::Circuit *b);
|
||||
void gen_end_circuit (const db::Circuit *a, const db::Circuit *b, Status status);
|
||||
void gen_nets (const db::Net *a, const db::Net *b, Status status);
|
||||
void gen_devices (const db::Device *a, const db::Device *b, Status status);
|
||||
void gen_pins (const db::Pin *a, const db::Pin *b, Status status);
|
||||
void gen_subcircuits (const db::SubCircuit *a, const db::SubCircuit *b, Status status);
|
||||
void gen_end_circuit (const db::Circuit *a, const db::Circuit *b, Status status, const std::string &msg);
|
||||
void gen_nets (const db::Net *a, const db::Net *b, Status status, const std::string &msg);
|
||||
void gen_devices (const db::Device *a, const db::Device *b, Status status, const std::string &msg);
|
||||
void gen_pins (const db::Pin *a, const db::Pin *b, Status status, const std::string &msg);
|
||||
void gen_subcircuits (const db::SubCircuit *a, const db::SubCircuit *b, Status status, const std::string &msg);
|
||||
|
||||
// db::NetlistCompareLogger interface
|
||||
virtual void begin_netlist (const db::Netlist *a, const db::Netlist *b)
|
||||
|
|
@ -162,77 +167,77 @@ public:
|
|||
gen_begin_circuit (a, b);
|
||||
}
|
||||
|
||||
virtual void end_circuit (const db::Circuit *a, const db::Circuit *b, bool matching)
|
||||
virtual void end_circuit (const db::Circuit *a, const db::Circuit *b, bool matching, const std::string &msg)
|
||||
{
|
||||
sort_circuit ();
|
||||
gen_end_circuit (a, b, matching ? Match : NoMatch);
|
||||
gen_end_circuit (a, b, matching ? Match : NoMatch, msg);
|
||||
}
|
||||
|
||||
virtual void circuit_skipped (const db::Circuit *a, const db::Circuit *b)
|
||||
virtual void circuit_skipped (const db::Circuit *a, const db::Circuit *b, const std::string &msg)
|
||||
{
|
||||
gen_begin_circuit (a, b);
|
||||
gen_end_circuit (a, b, Skipped);
|
||||
gen_end_circuit (a, b, Skipped, msg);
|
||||
}
|
||||
|
||||
virtual void circuit_mismatch (const db::Circuit *a, const db::Circuit *b)
|
||||
virtual void circuit_mismatch (const db::Circuit *a, const db::Circuit *b, const std::string &msg)
|
||||
{
|
||||
gen_begin_circuit (a, b);
|
||||
gen_end_circuit (a, b, Mismatch);
|
||||
gen_end_circuit (a, b, Mismatch, msg);
|
||||
}
|
||||
|
||||
virtual void match_nets (const db::Net *a, const db::Net *b)
|
||||
{
|
||||
gen_nets (a, b, Match);
|
||||
gen_nets (a, b, Match, std::string ());
|
||||
}
|
||||
|
||||
virtual void match_ambiguous_nets (const db::Net *a, const db::Net *b)
|
||||
virtual void match_ambiguous_nets (const db::Net *a, const db::Net *b, const std::string &msg)
|
||||
{
|
||||
gen_nets (a, b, MatchWithWarning);
|
||||
gen_nets (a, b, MatchWithWarning, msg);
|
||||
}
|
||||
|
||||
virtual void net_mismatch (const db::Net *a, const db::Net *b)
|
||||
virtual void net_mismatch (const db::Net *a, const db::Net *b, const std::string &msg)
|
||||
{
|
||||
gen_nets (a, b, Mismatch);
|
||||
gen_nets (a, b, Mismatch, msg);
|
||||
}
|
||||
|
||||
virtual void match_devices (const db::Device *a, const db::Device *b)
|
||||
{
|
||||
gen_devices (a, b, Match);
|
||||
gen_devices (a, b, Match, std::string ());
|
||||
}
|
||||
|
||||
virtual void match_devices_with_different_parameters (const db::Device *a, const db::Device *b)
|
||||
{
|
||||
gen_devices (a, b, MatchWithWarning);
|
||||
gen_devices (a, b, MatchWithWarning, std::string ());
|
||||
}
|
||||
|
||||
virtual void match_devices_with_different_device_classes (const db::Device *a, const db::Device *b)
|
||||
{
|
||||
gen_devices (a, b, MatchWithWarning);
|
||||
gen_devices (a, b, MatchWithWarning, std::string ());
|
||||
}
|
||||
|
||||
virtual void device_mismatch (const db::Device *a, const db::Device *b)
|
||||
virtual void device_mismatch (const db::Device *a, const db::Device *b, const std::string &msg)
|
||||
{
|
||||
gen_devices (a, b, Mismatch);
|
||||
gen_devices (a, b, Mismatch, msg);
|
||||
}
|
||||
|
||||
virtual void match_pins (const db::Pin *a, const db::Pin *b)
|
||||
{
|
||||
gen_pins (a, b, Match);
|
||||
gen_pins (a, b, Match, std::string ());
|
||||
}
|
||||
|
||||
virtual void pin_mismatch (const db::Pin *a, const db::Pin *b)
|
||||
virtual void pin_mismatch (const db::Pin *a, const db::Pin *b, const std::string &msg)
|
||||
{
|
||||
gen_pins (a, b, Mismatch);
|
||||
gen_pins (a, b, Mismatch, msg);
|
||||
}
|
||||
|
||||
virtual void match_subcircuits (const db::SubCircuit *a, const db::SubCircuit *b)
|
||||
{
|
||||
gen_subcircuits (a, b, Match);
|
||||
gen_subcircuits (a, b, Match, std::string ());
|
||||
}
|
||||
|
||||
virtual void subcircuit_mismatch (const db::SubCircuit *a, const db::SubCircuit *b)
|
||||
virtual void subcircuit_mismatch (const db::SubCircuit *a, const db::SubCircuit *b, const std::string &msg)
|
||||
{
|
||||
gen_subcircuits (a, b, Mismatch);
|
||||
gen_subcircuits (a, b, Mismatch, msg);
|
||||
}
|
||||
|
||||
void clear ();
|
||||
|
|
@ -292,10 +297,10 @@ private:
|
|||
PerCircuitData *mp_per_circuit_data;
|
||||
|
||||
void establish_pair (const db::Circuit *a, const db::Circuit *b);
|
||||
void establish_pair (const db::Net *a, const db::Net *b, Status status);
|
||||
void establish_pair (const db::Device *a, const db::Device *b, Status status);
|
||||
void establish_pair (const db::Pin *a, const db::Pin *b, Status status);
|
||||
void establish_pair (const db::SubCircuit *a, const db::SubCircuit *b, Status status);
|
||||
void establish_pair (const db::Net *a, const db::Net *b, Status status, const std::string &msg);
|
||||
void establish_pair (const db::Device *a, const db::Device *b, Status status, const std::string &msg);
|
||||
void establish_pair (const db::Pin *a, const db::Pin *b, Status status, const std::string &msg);
|
||||
void establish_pair (const db::SubCircuit *a, const db::SubCircuit *b, Status status, const std::string &msg);
|
||||
void sort_circuit ();
|
||||
void sort_netlist ();
|
||||
|
||||
|
|
|
|||
|
|
@ -190,17 +190,17 @@ public:
|
|||
m_circuit = circuit2str (a) + " vs. " + circuit2str (b);
|
||||
}
|
||||
|
||||
virtual void device_class_mismatch (const db::DeviceClass *a, const db::DeviceClass *b)
|
||||
virtual void device_class_mismatch (const db::DeviceClass *a, const db::DeviceClass *b, const std::string & /*msg*/)
|
||||
{
|
||||
out ("device_class_mismatch " + device_class2str (a) + " " + device_class2str (b));
|
||||
}
|
||||
|
||||
virtual void circuit_skipped (const db::Circuit *a, const db::Circuit *b)
|
||||
virtual void circuit_skipped (const db::Circuit *a, const db::Circuit *b, const std::string & /*msg*/)
|
||||
{
|
||||
out ("circuit_skipped " + circuit2str (a) + " " + circuit2str (b));
|
||||
}
|
||||
|
||||
virtual void circuit_mismatch (const db::Circuit *a, const db::Circuit *b)
|
||||
virtual void circuit_mismatch (const db::Circuit *a, const db::Circuit *b, const std::string & /*msg*/)
|
||||
{
|
||||
out ("circuit_mismatch " + circuit2str (a) + " " + circuit2str (b));
|
||||
}
|
||||
|
|
@ -210,12 +210,12 @@ public:
|
|||
out ("match_nets " + net2str (a) + " " + net2str (b));
|
||||
}
|
||||
|
||||
virtual void match_ambiguous_nets (const db::Net *a, const db::Net *b)
|
||||
virtual void match_ambiguous_nets (const db::Net *a, const db::Net *b, const std::string & /*msg*/)
|
||||
{
|
||||
out ("match_ambiguous_nets " + net2str (a) + " " + net2str (b));
|
||||
}
|
||||
|
||||
virtual void net_mismatch (const db::Net *a, const db::Net *b)
|
||||
virtual void net_mismatch (const db::Net *a, const db::Net *b, const std::string & /*msg*/)
|
||||
{
|
||||
out ("net_mismatch " + net2str (a) + " " + net2str (b));
|
||||
}
|
||||
|
|
@ -225,7 +225,7 @@ public:
|
|||
out ("match_devices " + device2str (a) + " " + device2str (b));
|
||||
}
|
||||
|
||||
virtual void device_mismatch (const db::Device *a, const db::Device *b)
|
||||
virtual void device_mismatch (const db::Device *a, const db::Device *b, const std::string & /*msg*/)
|
||||
{
|
||||
out ("device_mismatch " + device2str (a) + " " + device2str (b));
|
||||
}
|
||||
|
|
@ -245,7 +245,7 @@ public:
|
|||
out ("match_pins " + pin2str (a) + " " + pin2str (b));
|
||||
}
|
||||
|
||||
virtual void pin_mismatch (const db::Pin *a, const db::Pin *b)
|
||||
virtual void pin_mismatch (const db::Pin *a, const db::Pin *b, const std::string & /*msg*/)
|
||||
{
|
||||
out ("pin_mismatch " + pin2str (a) + " " + pin2str (b));
|
||||
}
|
||||
|
|
@ -255,7 +255,7 @@ public:
|
|||
out ("match_subcircuits " + subcircuit2str (a) + " " + subcircuit2str (b));
|
||||
}
|
||||
|
||||
virtual void subcircuit_mismatch (const db::SubCircuit *a, const db::SubCircuit *b)
|
||||
virtual void subcircuit_mismatch (const db::SubCircuit *a, const db::SubCircuit *b, const std::string & /*msg*/)
|
||||
{
|
||||
out ("subcircuit_mismatch " + subcircuit2str (a) + " " + subcircuit2str (b));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -66,18 +66,18 @@ public:
|
|||
db::NetlistCompareLogger::end_netlist (a, b);
|
||||
}
|
||||
|
||||
virtual void device_class_mismatch (const db::DeviceClass *a, const db::DeviceClass *b)
|
||||
virtual void device_class_mismatch (const db::DeviceClass *a, const db::DeviceClass *b, const std::string &msg)
|
||||
{
|
||||
if (cb_device_class_mismatch.can_issue ()) {
|
||||
cb_device_class_mismatch.issue<GenericNetlistCompareLogger> (&GenericNetlistCompareLogger::device_class_mismatch_fb, a, b);
|
||||
cb_device_class_mismatch.issue<GenericNetlistCompareLogger, const db::DeviceClass *, const db::DeviceClass *, const std::string &> (&GenericNetlistCompareLogger::device_class_mismatch_fb, a, b, msg);
|
||||
} else {
|
||||
db::NetlistCompareLogger::device_class_mismatch (a, b);
|
||||
}
|
||||
}
|
||||
|
||||
void device_class_mismatch_fb (const db::DeviceClass *a, const db::DeviceClass *b)
|
||||
void device_class_mismatch_fb (const db::DeviceClass *a, const db::DeviceClass *b, const std::string &msg)
|
||||
{
|
||||
db::NetlistCompareLogger::device_class_mismatch (a, b);
|
||||
db::NetlistCompareLogger::device_class_mismatch (a, b, msg);
|
||||
}
|
||||
|
||||
virtual void begin_circuit (const db::Circuit *a, const db::Circuit *b)
|
||||
|
|
@ -94,46 +94,46 @@ public:
|
|||
db::NetlistCompareLogger::begin_circuit (a, b);
|
||||
}
|
||||
|
||||
virtual void end_circuit (const db::Circuit *a, const db::Circuit *b, bool matching)
|
||||
virtual void end_circuit (const db::Circuit *a, const db::Circuit *b, bool matching, const std::string &msg)
|
||||
{
|
||||
if (cb_end_circuit.can_issue ()) {
|
||||
cb_end_circuit.issue<GenericNetlistCompareLogger> (&GenericNetlistCompareLogger::end_circuit_fb, a, b, matching);
|
||||
cb_end_circuit.issue<GenericNetlistCompareLogger, const db::Circuit *, const db::Circuit *, bool, const std::string &> (&GenericNetlistCompareLogger::end_circuit_fb, a, b, matching, msg);
|
||||
} else {
|
||||
db::NetlistCompareLogger::end_circuit (a, b, matching);
|
||||
}
|
||||
}
|
||||
|
||||
void end_circuit_fb (const db::Circuit *a, const db::Circuit *b, bool matching)
|
||||
void end_circuit_fb (const db::Circuit *a, const db::Circuit *b, bool matching, const std::string &msg)
|
||||
{
|
||||
db::NetlistCompareLogger::end_circuit (a, b, matching);
|
||||
db::NetlistCompareLogger::end_circuit (a, b, matching, msg);
|
||||
}
|
||||
|
||||
virtual void circuit_skipped (const db::Circuit *a, const db::Circuit *b)
|
||||
virtual void circuit_skipped (const db::Circuit *a, const db::Circuit *b, const std::string &msg)
|
||||
{
|
||||
if (cb_circuit_skipped.can_issue ()) {
|
||||
cb_circuit_skipped.issue<GenericNetlistCompareLogger> (&GenericNetlistCompareLogger::circuit_skipped_fb, a, b);
|
||||
cb_circuit_skipped.issue<GenericNetlistCompareLogger, const db::Circuit *, const db::Circuit *, const std::string &> (&GenericNetlistCompareLogger::circuit_skipped_fb, a, b, msg);
|
||||
} else {
|
||||
db::NetlistCompareLogger::circuit_skipped (a, b);
|
||||
}
|
||||
}
|
||||
|
||||
void circuit_skipped_fb (const db::Circuit *a, const db::Circuit *b)
|
||||
void circuit_skipped_fb (const db::Circuit *a, const db::Circuit *b, const std::string &msg)
|
||||
{
|
||||
db::NetlistCompareLogger::circuit_skipped (a, b);
|
||||
db::NetlistCompareLogger::circuit_skipped (a, b, msg);
|
||||
}
|
||||
|
||||
virtual void circuit_mismatch (const db::Circuit *a, const db::Circuit *b)
|
||||
virtual void circuit_mismatch (const db::Circuit *a, const db::Circuit *b, const std::string &msg)
|
||||
{
|
||||
if (cb_circuit_mismatch.can_issue ()) {
|
||||
cb_circuit_mismatch.issue<GenericNetlistCompareLogger> (&GenericNetlistCompareLogger::circuit_mismatch_fb, a, b);
|
||||
cb_circuit_mismatch.issue<GenericNetlistCompareLogger, const db::Circuit *, const db::Circuit *, const std::string &> (&GenericNetlistCompareLogger::circuit_mismatch_fb, a, b, msg);
|
||||
} else {
|
||||
db::NetlistCompareLogger::circuit_mismatch (a, b);
|
||||
}
|
||||
}
|
||||
|
||||
void circuit_mismatch_fb (const db::Circuit *a, const db::Circuit *b)
|
||||
void circuit_mismatch_fb (const db::Circuit *a, const db::Circuit *b, const std::string &msg)
|
||||
{
|
||||
db::NetlistCompareLogger::circuit_mismatch (a, b);
|
||||
db::NetlistCompareLogger::circuit_mismatch (a, b, msg);
|
||||
}
|
||||
|
||||
virtual void match_nets (const db::Net *a, const db::Net *b)
|
||||
|
|
@ -150,32 +150,32 @@ public:
|
|||
db::NetlistCompareLogger::match_nets (a, b);
|
||||
}
|
||||
|
||||
virtual void match_ambiguous_nets (const db::Net *a, const db::Net *b)
|
||||
virtual void match_ambiguous_nets (const db::Net *a, const db::Net *b, const std::string &msg)
|
||||
{
|
||||
if (cb_match_ambiguous_nets.can_issue ()) {
|
||||
cb_match_ambiguous_nets.issue<GenericNetlistCompareLogger> (&GenericNetlistCompareLogger::match_ambiguous_nets_fb, a, b);
|
||||
cb_match_ambiguous_nets.issue<GenericNetlistCompareLogger, const db::Net *, const db::Net *, const std::string &> (&GenericNetlistCompareLogger::match_ambiguous_nets_fb, a, b, msg);
|
||||
} else {
|
||||
db::NetlistCompareLogger::match_ambiguous_nets (a, b);
|
||||
}
|
||||
}
|
||||
|
||||
void match_ambiguous_nets_fb (const db::Net *a, const db::Net *b)
|
||||
void match_ambiguous_nets_fb (const db::Net *a, const db::Net *b, const std::string &msg)
|
||||
{
|
||||
db::NetlistCompareLogger::match_ambiguous_nets (a, b);
|
||||
db::NetlistCompareLogger::match_ambiguous_nets (a, b, msg);
|
||||
}
|
||||
|
||||
virtual void net_mismatch (const db::Net *a, const db::Net *b)
|
||||
virtual void net_mismatch (const db::Net *a, const db::Net *b, const std::string &msg)
|
||||
{
|
||||
if (cb_net_mismatch.can_issue ()) {
|
||||
cb_net_mismatch.issue<GenericNetlistCompareLogger> (&GenericNetlistCompareLogger::net_mismatch_fb, a, b);
|
||||
cb_net_mismatch.issue<GenericNetlistCompareLogger, const db::Net *, const db::Net *, const std::string &> (&GenericNetlistCompareLogger::net_mismatch_fb, a, b, msg);
|
||||
} else {
|
||||
db::NetlistCompareLogger::net_mismatch (a, b);
|
||||
}
|
||||
}
|
||||
|
||||
void net_mismatch_fb (const db::Net *a, const db::Net *b)
|
||||
void net_mismatch_fb (const db::Net *a, const db::Net *b, const std::string &msg)
|
||||
{
|
||||
db::NetlistCompareLogger::net_mismatch (a, b);
|
||||
db::NetlistCompareLogger::net_mismatch (a, b, msg);
|
||||
}
|
||||
|
||||
virtual void match_devices (const db::Device *a, const db::Device *b)
|
||||
|
|
@ -220,18 +220,18 @@ public:
|
|||
db::NetlistCompareLogger::match_devices_with_different_device_classes (a, b);
|
||||
}
|
||||
|
||||
virtual void device_mismatch (const db::Device *a, const db::Device *b)
|
||||
virtual void device_mismatch (const db::Device *a, const db::Device *b, const std::string &msg)
|
||||
{
|
||||
if (cb_device_mismatch.can_issue ()) {
|
||||
cb_device_mismatch.issue<GenericNetlistCompareLogger> (&GenericNetlistCompareLogger::device_mismatch_fb, a, b);
|
||||
cb_device_mismatch.issue<GenericNetlistCompareLogger, const db::Device *, const db::Device *, const std::string &> (&GenericNetlistCompareLogger::device_mismatch_fb, a, b, msg);
|
||||
} else {
|
||||
db::NetlistCompareLogger::device_mismatch (a, b);
|
||||
}
|
||||
}
|
||||
|
||||
void device_mismatch_fb (const db::Device *a, const db::Device *b)
|
||||
void device_mismatch_fb (const db::Device *a, const db::Device *b, const std::string &msg)
|
||||
{
|
||||
db::NetlistCompareLogger::device_mismatch (a, b);
|
||||
db::NetlistCompareLogger::device_mismatch (a, b, msg);
|
||||
}
|
||||
|
||||
virtual void match_pins (const db::Pin *a, const db::Pin *b)
|
||||
|
|
@ -248,18 +248,18 @@ public:
|
|||
db::NetlistCompareLogger::match_pins (a, b);
|
||||
}
|
||||
|
||||
virtual void pin_mismatch (const db::Pin *a, const db::Pin *b)
|
||||
virtual void pin_mismatch (const db::Pin *a, const db::Pin *b, const std::string &msg)
|
||||
{
|
||||
if (cb_pin_mismatch.can_issue ()) {
|
||||
cb_pin_mismatch.issue<GenericNetlistCompareLogger> (&GenericNetlistCompareLogger::pin_mismatch_fb, a, b);
|
||||
cb_pin_mismatch.issue<GenericNetlistCompareLogger, const db::Pin *, const db::Pin *, const std::string &> (&GenericNetlistCompareLogger::pin_mismatch_fb, a, b, msg);
|
||||
} else {
|
||||
db::NetlistCompareLogger::pin_mismatch (a, b);
|
||||
}
|
||||
}
|
||||
|
||||
void pin_mismatch_fb (const db::Pin *a, const db::Pin *b)
|
||||
void pin_mismatch_fb (const db::Pin *a, const db::Pin *b, const std::string &msg)
|
||||
{
|
||||
db::NetlistCompareLogger::pin_mismatch (a, b);
|
||||
db::NetlistCompareLogger::pin_mismatch (a, b, msg);
|
||||
}
|
||||
|
||||
virtual void match_subcircuits (const db::SubCircuit *a, const db::SubCircuit *b)
|
||||
|
|
@ -276,18 +276,18 @@ public:
|
|||
db::NetlistCompareLogger::match_subcircuits (a, b);
|
||||
}
|
||||
|
||||
virtual void subcircuit_mismatch (const db::SubCircuit *a, const db::SubCircuit *b)
|
||||
virtual void subcircuit_mismatch (const db::SubCircuit *a, const db::SubCircuit *b, const std::string &msg)
|
||||
{
|
||||
if (cb_subcircuit_mismatch.can_issue ()) {
|
||||
cb_subcircuit_mismatch.issue<GenericNetlistCompareLogger> (&GenericNetlistCompareLogger::subcircuit_mismatch_fb, a, b);
|
||||
cb_subcircuit_mismatch.issue<GenericNetlistCompareLogger, const db::SubCircuit *, const db::SubCircuit *, const std::string &> (&GenericNetlistCompareLogger::subcircuit_mismatch_fb, a, b, msg);
|
||||
} else {
|
||||
db::NetlistCompareLogger::subcircuit_mismatch (a, b);
|
||||
}
|
||||
}
|
||||
|
||||
void subcircuit_mismatch_fb (const db::SubCircuit *a, const db::SubCircuit *b)
|
||||
void subcircuit_mismatch_fb (const db::SubCircuit *a, const db::SubCircuit *b, const std::string &msg)
|
||||
{
|
||||
db::NetlistCompareLogger::subcircuit_mismatch (a, b);
|
||||
db::NetlistCompareLogger::subcircuit_mismatch (a, b, msg);
|
||||
}
|
||||
|
||||
gsi::Callback cb_begin_netlist;
|
||||
|
|
@ -339,7 +339,7 @@ Class<GenericNetlistCompareLogger> decl_GenericNetlistCompareLogger (decl_dbNetl
|
|||
"@brief This function is called at the end of the compare process.\n"
|
||||
"This method is called once when the compare run ended.\n"
|
||||
) +
|
||||
gsi::callback ("device_class_mismatch", &GenericNetlistCompareLogger::device_class_mismatch, &GenericNetlistCompareLogger::cb_device_class_mismatch, gsi::arg ("a"), gsi::arg ("b"),
|
||||
gsi::callback ("device_class_mismatch", &GenericNetlistCompareLogger::device_class_mismatch, &GenericNetlistCompareLogger::cb_device_class_mismatch, gsi::arg ("a"), gsi::arg ("b"), gsi::arg ("msg"),
|
||||
"@brief This function is called when device classes can't be compared.\n"
|
||||
"This method is called when a device class can't be mapped to a partner in the other netlist. In this case, "
|
||||
"this method is called with the one device class and nil for the other class.\n"
|
||||
|
|
@ -354,19 +354,19 @@ Class<GenericNetlistCompareLogger> decl_GenericNetlistCompareLogger (decl_dbNetl
|
|||
"some or all subcircuits the pin assignment can't be derived. In this case, \\circuit_skipped will be called once "
|
||||
"instead of \\begin_circuit and \\end_circuit.\n"
|
||||
) +
|
||||
gsi::callback ("end_circuit", &GenericNetlistCompareLogger::end_circuit, &GenericNetlistCompareLogger::cb_end_circuit, gsi::arg ("a"), gsi::arg ("b"), gsi::arg ("matching"),
|
||||
gsi::callback ("end_circuit", &GenericNetlistCompareLogger::end_circuit, &GenericNetlistCompareLogger::cb_end_circuit, gsi::arg ("a"), gsi::arg ("b"), gsi::arg ("matching"), gsi::arg ("msg"),
|
||||
"@brief This function is called at the end of the compare process.\n"
|
||||
"The 'matching' argument indicates whether the circuits have been identified as identical.\n"
|
||||
"See \\begin_circuit for details."
|
||||
) +
|
||||
gsi::callback ("circuit_skipped", &GenericNetlistCompareLogger::circuit_skipped, &GenericNetlistCompareLogger::cb_circuit_skipped, gsi::arg ("a"), gsi::arg ("b"),
|
||||
gsi::callback ("circuit_skipped", &GenericNetlistCompareLogger::circuit_skipped, &GenericNetlistCompareLogger::cb_circuit_skipped, gsi::arg ("a"), gsi::arg ("b"), gsi::arg ("msg"),
|
||||
"@brief This function is called when circuits can't be compared.\n"
|
||||
"If there is a known circuit pair, but the circuits can be compared - for example because subcircuits can't be identified - this method will be called with "
|
||||
"both circuits.\n"
|
||||
"\n"
|
||||
"This method is called instead of \\begin_circuit and \\end_circuit."
|
||||
) +
|
||||
gsi::callback ("circuit_mismatch", &GenericNetlistCompareLogger::circuit_mismatch, &GenericNetlistCompareLogger::cb_circuit_mismatch, gsi::arg ("a"), gsi::arg ("b"),
|
||||
gsi::callback ("circuit_mismatch", &GenericNetlistCompareLogger::circuit_mismatch, &GenericNetlistCompareLogger::cb_circuit_mismatch, gsi::arg ("a"), gsi::arg ("b"), gsi::arg ("msg"),
|
||||
"@brief This function is called when circuits can't be compared.\n"
|
||||
"This method is called when a circuit can't be mapped to a partner in the other netlist. In this case, "
|
||||
"this method is called with the one circuit and nil for the other circuit.\n"
|
||||
|
|
@ -379,13 +379,13 @@ Class<GenericNetlistCompareLogger> decl_GenericNetlistCompareLogger (decl_dbNetl
|
|||
"If the nets can be paired, but this match is ambiguous, \\match_ambiguous_nets will be called instead.\n"
|
||||
"If nets can't be matched to a partner, \\net_mismatch will be called.\n"
|
||||
) +
|
||||
gsi::callback ("match_ambiguous_nets", &GenericNetlistCompareLogger::match_ambiguous_nets, &GenericNetlistCompareLogger::cb_match_ambiguous_nets, gsi::arg ("a"), gsi::arg ("b"),
|
||||
gsi::callback ("match_ambiguous_nets", &GenericNetlistCompareLogger::match_ambiguous_nets, &GenericNetlistCompareLogger::cb_match_ambiguous_nets, gsi::arg ("a"), gsi::arg ("b"), gsi::arg ("msg"),
|
||||
"@brief This function is called when two nets are identified, but this choice is ambiguous.\n"
|
||||
"This choice is a last-resort fallback to allow continuation of the compare procedure. It is likely that this "
|
||||
"compare will fail later. Looking for ambiguous nets allows deduction of the origin of this faulty decision. "
|
||||
"See \\match_nets for more details."
|
||||
) +
|
||||
gsi::callback ("net_mismatch", &GenericNetlistCompareLogger::net_mismatch, &GenericNetlistCompareLogger::cb_net_mismatch, gsi::arg ("a"), gsi::arg ("b"),
|
||||
gsi::callback ("net_mismatch", &GenericNetlistCompareLogger::net_mismatch, &GenericNetlistCompareLogger::cb_net_mismatch, gsi::arg ("a"), gsi::arg ("b"), gsi::arg ("msg"),
|
||||
"@brief This function is called when a net can't be paired.\n"
|
||||
"This method will be called, if a net cannot be identified as identical with another net. The corresponding argument "
|
||||
"will identify the net and source netlist. The other argument will be nil.\n"
|
||||
|
|
@ -409,7 +409,7 @@ Class<GenericNetlistCompareLogger> decl_GenericNetlistCompareLogger (decl_dbNetl
|
|||
"@brief This function is called when two devices are identified but have different device classes.\n"
|
||||
"See \\match_devices for details.\n"
|
||||
) +
|
||||
gsi::callback ("device_mismatch", &GenericNetlistCompareLogger::device_mismatch, &GenericNetlistCompareLogger::cb_device_mismatch, gsi::arg ("a"), gsi::arg ("b"),
|
||||
gsi::callback ("device_mismatch", &GenericNetlistCompareLogger::device_mismatch, &GenericNetlistCompareLogger::cb_device_mismatch, gsi::arg ("a"), gsi::arg ("b"), gsi::arg ("msg"),
|
||||
"@brief This function is called when two devices can't be paired.\n"
|
||||
"This will report the device considered in a or b. The other argument is nil. "
|
||||
"See \\match_devices for details.\n"
|
||||
|
|
@ -419,7 +419,7 @@ Class<GenericNetlistCompareLogger> decl_GenericNetlistCompareLogger (decl_dbNetl
|
|||
"If two pins are identified as a corresponding pair, this method will be called with both pins.\n"
|
||||
"If pins can't be matched, \\pin_mismatch will be called with the one pin considered and the other pin being nil."
|
||||
) +
|
||||
gsi::callback ("pin_mismatch", &GenericNetlistCompareLogger::pin_mismatch, &GenericNetlistCompareLogger::cb_pin_mismatch, gsi::arg ("a"), gsi::arg ("b"),
|
||||
gsi::callback ("pin_mismatch", &GenericNetlistCompareLogger::pin_mismatch, &GenericNetlistCompareLogger::cb_pin_mismatch, gsi::arg ("a"), gsi::arg ("b"), gsi::arg ("msg"),
|
||||
"@brief This function is called when two pins can't be paired.\n"
|
||||
"This will report the pin considered in a or b. The other argument is nil. "
|
||||
"See \\match_pins for details.\n"
|
||||
|
|
@ -429,7 +429,7 @@ Class<GenericNetlistCompareLogger> decl_GenericNetlistCompareLogger (decl_dbNetl
|
|||
"If two subcircuits are identified as a corresponding pair, this method will be called with both subcircuits.\n"
|
||||
"If subcircuits can't be matched, \\subcircuit_mismatch will be called with the one subcircuit considered and the other subcircuit being nil."
|
||||
) +
|
||||
gsi::callback ("subcircuit_mismatch", &GenericNetlistCompareLogger::subcircuit_mismatch, &GenericNetlistCompareLogger::cb_subcircuit_mismatch, gsi::arg ("a"), gsi::arg ("b"),
|
||||
gsi::callback ("subcircuit_mismatch", &GenericNetlistCompareLogger::subcircuit_mismatch, &GenericNetlistCompareLogger::cb_subcircuit_mismatch, gsi::arg ("a"), gsi::arg ("b"), gsi::arg ("msg"),
|
||||
"@brief This function is called when two subcircuits can't be paired.\n"
|
||||
"This will report the subcircuit considered in a or b. The other argument is nil. "
|
||||
"See \\match_subcircuits for details.\n"
|
||||
|
|
|
|||
|
|
@ -44,22 +44,22 @@ public:
|
|||
out ("begin_circuit " + circuit2str (a) + " " + circuit2str (b));
|
||||
}
|
||||
|
||||
virtual void end_circuit (const db::Circuit *a, const db::Circuit *b, bool matching)
|
||||
virtual void end_circuit (const db::Circuit *a, const db::Circuit *b, bool matching, const std::string & /*msg*/)
|
||||
{
|
||||
out ("end_circuit " + circuit2str (a) + " " + circuit2str (b) + " " + (matching ? "MATCH" : "NOMATCH"));
|
||||
}
|
||||
|
||||
virtual void circuit_skipped (const db::Circuit *a, const db::Circuit *b)
|
||||
virtual void circuit_skipped (const db::Circuit *a, const db::Circuit *b, const std::string & /*msg*/)
|
||||
{
|
||||
out ("circuit_skipped " + circuit2str (a) + " " + circuit2str (b));
|
||||
}
|
||||
|
||||
virtual void circuit_mismatch (const db::Circuit *a, const db::Circuit *b)
|
||||
virtual void circuit_mismatch (const db::Circuit *a, const db::Circuit *b, const std::string & /*msg*/)
|
||||
{
|
||||
out ("circuit_mismatch " + circuit2str (a) + " " + circuit2str (b));
|
||||
}
|
||||
|
||||
virtual void device_class_mismatch (const db::DeviceClass *a, const db::DeviceClass *b)
|
||||
virtual void device_class_mismatch (const db::DeviceClass *a, const db::DeviceClass *b, const std::string & /*msg*/)
|
||||
{
|
||||
out ("device_class_mismatch " + dc2str (a) + " " + dc2str (b));
|
||||
}
|
||||
|
|
@ -69,12 +69,12 @@ public:
|
|||
out ("match_nets " + net2str (a) + " " + net2str (b));
|
||||
}
|
||||
|
||||
virtual void match_ambiguous_nets (const db::Net *a, const db::Net *b)
|
||||
virtual void match_ambiguous_nets (const db::Net *a, const db::Net *b, const std::string & /*msg*/)
|
||||
{
|
||||
out ("match_ambiguous_nets " + net2str (a) + " " + net2str (b));
|
||||
}
|
||||
|
||||
virtual void net_mismatch (const db::Net *a, const db::Net *b)
|
||||
virtual void net_mismatch (const db::Net *a, const db::Net *b, const std::string & /*msg*/)
|
||||
{
|
||||
out ("net_mismatch " + net2str (a) + " " + net2str (b));
|
||||
}
|
||||
|
|
@ -84,7 +84,7 @@ public:
|
|||
out ("match_devices " + device2str (a) + " " + device2str (b));
|
||||
}
|
||||
|
||||
virtual void device_mismatch (const db::Device *a, const db::Device *b)
|
||||
virtual void device_mismatch (const db::Device *a, const db::Device *b, const std::string & /*msg*/)
|
||||
{
|
||||
out ("device_mismatch " + device2str (a) + " " + device2str (b));
|
||||
}
|
||||
|
|
@ -104,7 +104,7 @@ public:
|
|||
out ("match_pins " + pin2str (a) + " " + pin2str (b));
|
||||
}
|
||||
|
||||
virtual void pin_mismatch (const db::Pin *a, const db::Pin *b)
|
||||
virtual void pin_mismatch (const db::Pin *a, const db::Pin *b, const std::string & /*msg*/)
|
||||
{
|
||||
out ("pin_mismatch " + pin2str (a) + " " + pin2str (b));
|
||||
}
|
||||
|
|
@ -114,7 +114,7 @@ public:
|
|||
out ("match_subcircuits " + subcircuit2str (a) + " " + subcircuit2str (b));
|
||||
}
|
||||
|
||||
virtual void subcircuit_mismatch (const db::SubCircuit *a, const db::SubCircuit *b)
|
||||
virtual void subcircuit_mismatch (const db::SubCircuit *a, const db::SubCircuit *b, const std::string & /*msg*/)
|
||||
{
|
||||
out ("subcircuit_mismatch " + subcircuit2str (a) + " " + subcircuit2str (b));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue