PS.


To ng-spice@ieee.ing.uniroma1.it
From widlok <widlok@uci.agh.edu.pl>
Date Thu, 12 Oct 2000 11:22:13 +0200
Delivered-To mailing list ng-spice@ieee.ing.uniroma1.it
Mailing-List contact ng-spice-help@ieee.ing.uniroma1.it; run by ezmlm
References <003801c032ad$8419fac0$69754789@edin_alans.analog.com >
Reply-To ng-spice@ieee.ing.uniroma1.it

Hi All,

    I don't know why, but rework-12 did not want to simulate my old
cirs. Finally I found something that seems to be a bug in INPevaluate()
(or something like this) from 'inpeval.c'. After this fix it works
right, but I am not sure if this does not causes other problems. Anyway,
my test was quite good I think, so this should be OK now :-).

Alan Gillespie wrote:

> Michael's subckt fix actually hilights a serious bug in the
> subcircuit expansion of spice. I tried the following test -
>
> .subckt sub1 in out
> vint int 0 pulse 0 1 1u 1u 1u 9u 20u
> esub out 0 ext 0 1
> rin in 0 1
> .ends
>
> vin in 0 pulse 0 1 3u 1u 1u 9u 20u
> vext ext 0 pulse 1 0 6u 1u 1u 9u 20u
> xs1 ext out sub1
>
> The esub line should reference the top level ext node, but instead
> spice looks for s1:ext. The s1 should only be prepended to ext if
> the circuit node actually exists in the subcircuit.
>
> I haven't checked yet, but I think Michael's fix stops the named
> voltage source having the subcircuit prepended to its name.
> This will work as long as the required voltage source is at top
> level. If it's defined in the subckt, then spice will take the top
> level one instead.
>
> This probably applies to current controlled sources as well as
> the arbitrary sources.
>
> Does that make sense ? I'll do more tests tonight.
>

 Alan,
All subckts nodes are local - this is the idea. Spice allows to give
node names instead of numbers, but this not makes them global. Only node
0 is global. Spice parser expands subckts and change node names to make
them unique and I think that is right.

Thanks, Michael

Inpeval.c


Partial thread listing: