gnucap-devel
[Top][All Lists]
Advanced

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

[Gnucap-devel] problem with clone_instance


From: Felix Salfelder
Subject: [Gnucap-devel] problem with clone_instance
Date: Sat, 16 Nov 2013 23:45:44 +0100
User-agent: Mutt/1.5.20 (2009-06-14)

Hi Al.

bmm_semi.cc defines two MODEL_CARDs with no _device_proto. this is a
problem in

verilog
res X(1,2);.

res is a model, which is found by find_proto and LANGUAGE::new__instance
unuspectingly calls clone_instance. here assert(_device_proto) fails.

there ara multple ways to fix it. my favourite is something like this.

CARD* MODEL_CARD::clone_instance() const
{
  if (_component_proto) {
    return _component_proto->clone();
  } else if( const CARD* c = device_dispatcher[dev_type()] ) {
    return c->clone();
  } else { unreachable();
    throw Exception("cannot instanciate");
  }
}

(make sure dev_type is "resistor" and "capacitor" accordingly in
bmm_semi.cc. the dispatcher wont find "r" or "c" in case sensitive
mode.)

regards
felix



reply via email to

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