From 4d4a6932488f21c32893c8dba169f37559a56604 Mon Sep 17 00:00:00 2001 From: Stephen Williams Date: Wed, 16 Sep 2009 14:45:55 -0700 Subject: [PATCH] Improve some assert messages Replace some assert functions with ivl_assert. --- elaborate.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/elaborate.cc b/elaborate.cc index 7c51f7d43..e5635a86c 100644 --- a/elaborate.cc +++ b/elaborate.cc @@ -1092,7 +1092,7 @@ void PGModule::elaborate_mod_(Design*des, Module*rmod, NetScope*scope) const // No named bindings, just use the positional list I // already have. - assert(pin_count() == rmod->port_count()); + ivl_assert(*this, pin_count() == rmod->port_count()); pins = get_pins(); } @@ -1136,7 +1136,7 @@ void PGModule::elaborate_mod_(Design*des, Module*rmod, NetScope*scope) const perm_string pname = peek_tail_name(mport[0]->path()); NetNet*tmp = instance[0]->find_signal(pname); - assert(tmp); + ivl_assert(*this, tmp); if (tmp->port_type() == NetNet::PINPUT) { // If we have an unconnected input convert it @@ -1202,13 +1202,13 @@ void PGModule::elaborate_mod_(Design*des, Module*rmod, NetScope*scope) const for (unsigned ldx = 0 ; ldx < mport.size() ; ldx += 1) { unsigned lbase = inst * mport.size(); PEIdent*pport = mport[ldx]; - assert(pport); + ivl_assert(*this, pport); prts[lbase + ldx] = pport->elaborate_port(des, inst_scope); if (prts[lbase + ldx] == 0) continue; - assert(prts[lbase + ldx]); + ivl_assert(*this, prts[lbase + ldx]); prts_vector_width += prts[lbase + ldx]->vector_width(); } } @@ -1223,7 +1223,7 @@ void PGModule::elaborate_mod_(Design*des, Module*rmod, NetScope*scope) const // We know by design that each instance has the same // width port. Therefore, the prts_pin_count must be an // even multiple of the instance count. - assert(prts_vector_width % instance.size() == 0); + ivl_assert(*this, prts_vector_width % instance.size() == 0); unsigned desired_vector_width = prts_vector_width; if (instance.size() != 1) @@ -1340,12 +1340,12 @@ void PGModule::elaborate_mod_(Design*des, Module*rmod, NetScope*scope) const } - assert(sig); + ivl_assert(*this, sig); #ifndef NDEBUG if ((prts.size() >= 1) && (prts[0]->port_type() != NetNet::PINPUT)) { - assert(sig->type() != NetNet::REG); + ivl_assert(*this, sig->type() != NetNet::REG); } #endif