← Back to team overview

kicad-developers team mailing list archive

Re: eeschema for IC design

 

Alright, I found the problem.

The way KiCad converts i(r1) back to the ngspice format is with
NETLIST_EXPORTER_PSPICE_SIM::ComponentToVector
This in turn calls NETLIST_EXPORTER_PSPICE::GetSpiceDevice
Which in turn calls GetSpiceItems which only contains the devices that
KiCad knows about, not all the other signals.

What would be the proper way to fix ComponentToVector?
Basically with this patch, we're directly using the ngspice values, so the
step of GetSpiceDevice seems unnecessary?
By just using aName directly, my patch works. Is that a reasonable approach?

Maybe I should just make a PR, and we can discuss the changes from there?

Regards,
Pepijn

On Sun, Oct 25, 2020 at 4:04 PM pepijn de vos <pepijndevos@xxxxxxxxx> wrote:

> Hey Holger,
>
> Thanks for the info. To clarify:
> If I open eeschema (latest git master) and type i(r1) in the signal text
> field it gives an error while if I type i(R1) (uppercase) it works.
> This has nothing to do with my patch or the PDK, it's something weird
> going on with case sensitivity.
> This is a very puzzling error, because as you say ngspice appears to
> lowercase the names, but then generates an error when given the lowercase
> name.
> (the error seems to come from src/frontend/spiceif.c?)
>
> On the eeschema side R1 is uppercase, maybe it's doing some lookup on the
> eeschema side, and then sending wrong data to ngspice?
> I'm at a loss.
>
> Regards,
> Pepijn
>
> On Sun, Oct 25, 2020 at 3:48 PM Holger Vogt <holger.vogt@xxxxxxxxxx>
> wrote:
>
>> Seems to be a nice mixture of bug sources.
>>
>> @include[current] is probably a pdk bug. Who is naming a current source
>> (first letter has to be i) 'include'?
>>
>> @r1[i] is the ngspice vector name for current through r1.
>> There is no function i(r1) in ngsppice. So you have to read
>> @r1[i] from ngspice and translate its name to i(r1) in
>> eeschema, if you wish to do so.
>>
>> ngspice lower-cases all netlist entries.
>>
>>  > @m.xm2.msky130_fd_pr__nfet_g5v0d10v5[ib]
>>  > @m.xm2.msky130_fd_pr__nfet_g5v0d10v5[ig]
>>  > @m.xm2.msky130_fd_pr__nfet_g5v0d10v5[is]
>>  > @m.xm2.msky130_fd_pr__nfet_g5v0d10v5[id]
>>
>> [ib] [ig] [is] are not supported for the BSIM4 MOS model,
>> because these are no intrinsic model parameters. Therefore these
>> vectors have length zero (except for [id]). They have been defined
>> for the vernerable MOS1 - 9 models. I am considering adding these
>> also for BSIM3/4.
>>
>>
>> _______________________________________________
>> Mailing list: https://launchpad.net/~kicad-developers
>> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~kicad-developers
>> More help   : https://help.launchpad.net/ListHelp
>>
>

References