|
From: Uwe B. <bo...@el...> - 2008-01-23 16:12:22
|
>>>>> "Cary" == Cary R <cy...@ya...> writes:
Cary> --- Uwe Bonnes <bo...@el...> wrote:
Cary> With all this information you should be able to figure out which
Cary> statement(s) in the Verilog source is causing the problem.
Thanks for the help so long.
I can see:
v0xa16a2a0_0 .net *"_s273", -1 0, L_0xc4250c0; 1 drivers
and later this L_0xc4250c0 is used in the offending concatenation. This also
seems to happen in the context of the file with the negative value of the
for loop.
With an
assert(npins > 0);
in netlists.cc:NetNet::NetNet(NetScope*s, perm_string n, Type t, unsigned npins)
I can find out when the offending value is written. However _s273 seems to
be an auto-generated variable, and I have no clue what causes this variable to be
generated. In the a.out file, the nets are sorted in their numeric order,
not by time they are generated in the code.
With code like
# include <execinfo.h>
# include <cxxabi.h>
void
print_trace (void)
{
/*
* http://www-128.ibm.com/developerworks/library/l-cppexcep.html?ca=dnt-68
* http://www.int0x80.gr/papers/name_mangling.pdf
*/
const int maxdepth(25);
void *func_addresses[maxdepth];
int nfuncs = backtrace(func_addresses, maxdepth);
int i;
int status=0;
//now get the function names associated with these symbols. This should work for elf
//binaries, though additional linker options may need to have been called
//(e.g. -rdynamic for GNU ld. See the glibc documentation for 'backtrace')
char **symbols = backtrace_symbols(func_addresses, nfuncs);
printf ("Obtained %zd stack frames.\n", nfuncs);
for (i = 0; i < nfuncs; i++)
{
char *begin = strchr(symbols[i], '(');
char *end = strchr(begin,'+');
char *lend = strchr(begin,')');
char funcname[1000];
strncpy(funcname,begin+1, end-begin);
funcname[end-begin-1] = 0;
char addr[10];
strncpy(addr,end+1, lend-end);
addr[lend-end-1] = 0;
char *demangled = abi::__cxa_demangle(funcname, 0, 0, &status);
if (status == 0)
fprintf(stderr, "%s + %s\n",demangled, addr);
else
fprintf(stderr, "%s\n", symbols[i]);
free(demangled);
}
free (symbols);
}
I can print out a backtrace, when the (npins !>0) situation happens:
Obtained 19 stack frames.
print_trace() + 0x1f
NetNet::NetNet(NetScope*, perm_string, NetNet::Type, unsigned int) + 0x17c
PEBinary::elaborate_net_shift_(Design*, NetScope*, unsigned int, NetExpr const*, NetExpr const*, NetExpr const*) const + 0x568
PEBinary::elaborate_net(Design*, NetScope*, unsigned int, NetExpr const*, NetExpr const*, NetExpr const*, Link::strength_t, Link::strength_t) const + 0x2f8
PETernary::elaborate_net(Design*, NetScope*, unsigned int, NetExpr const*, NetExpr const*, NetExpr const*, Link::strength_t, Link::strength_t) const + 0xa2
PETernary::elaborate_net(Design*, NetScope*, unsigned int, NetExpr const*, NetExpr const*, NetExpr const*, Link::strength_t, Link::strength_t) const + 0xf0
PETernary::elaborate_net(Design*, NetScope*, unsigned int, NetExpr const*, NetExpr const*, NetExpr const*, Link::strength_t, Link::strength_t) const + 0xa2
PGAssign::elaborate(Design*, NetScope*) const + 0x4f0
Module::elaborate(Design*, NetScope*) const + 0x5ad
PGModule::elaborate_mod_(Design*, Module*, NetScope*) const + 0x335
PGModule::elaborate(Design*, NetScope*) const + 0x56
Module::elaborate(Design*, NetScope*) const + 0x5ad
PGModule::elaborate_mod_(Design*, Module*, NetScope*) const + 0x335
PGModule::elaborate(Design*, NetScope*) const + 0x56
Module::elaborate(Design*, NetScope*) const + 0x5ad
elaborate(std::list<perm_string, std::allocator<perm_string> >) + 0x356
/usr/local/lib/ivl/ivl(main+0xc52) [0x80783c2]
/lib/libc.so.6(__libc_start_main+0xdc) [0xb7cbdf9c]
/usr/local/lib/ivl/ivl(__gxx_personality_v0+0x10d) [0x8075ed1]
However this doesn't help me too much. Has anybody an idea about that?
Maybe however the print_trace code may be usefull for iverilog developpers.
Bye
--
Uwe Bonnes bo...@el...
Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
|