gnucap-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnucap-devel] max_nodes, net_nodes


From: Felix Salfelder
Subject: Re: [Gnucap-devel] max_nodes, net_nodes
Date: Tue, 23 Sep 2014 07:42:07 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

Hi Al.

On Mon, Sep 22, 2014 at 09:12:56PM -0400, al davis wrote:
> > const std::string COMPONENT::port_value(int i)const
> > {
> >   assert(_n);
> >   assert(i >= 0);
> >   assert(i < net_nodes()); // <- boom
> >   return _n[i].short_label();
> > }
> 
> This code is correct.
> 
> i >= net_nodes() is not valid here.

ok. and actually not required, after the DEV_SUBCKT::max_nodes() fix.

> [..]
> > - change max_nodes() in DEV_SUBCKT to
> >   {if(_parent){ return _parent->net_nodes();}else{return
> > PORTS_PER_SUBCKT;}} 
> 
> I think you are correct.  The max_nodes() of the offspring is 
> the actual net_nodes() of the parent.

thanks for the analysis

> You didn't post the test case.  My conclusion of what it was 
> ....  In Verilog syntax, a user error, entering a node by name, 
> with a name that doesn't exist.  It runs past the real end of 
> the list searching for it.

the test case is a unit test of the gnucap-geda package.
last time i had compiled gnucap with NDEBUG defined...

but you are right. the following also triggers the error.

verilog
module test(n,p);
endmodule
test t(.n(1), .p(0), .q(2));
end

cheers
felix



reply via email to

[Prev in Thread] Current Thread [Next in Thread]