← Back to team overview

kicad-developers team mailing list archive

Re: eeschema for IC design

 

Hey,

I've been trying to implement the new function, but running into issues.
I took a look at the AllPlots functions, which returns stuff like the
following:

@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]
@i1[current]
@m.xm5.msky130_fd_pr__pfet_g5v0d10v5[ib]
@m.xm5.msky130_fd_pr__pfet_g5v0d10v5[ig]
@m.xm5.msky130_fd_pr__pfet_g5v0d10v5[is]
@m.xm5.msky130_fd_pr__pfet_g5v0d10v5[id]
@m.xm1.msky130_fd_pr__nfet_g5v0d10v5[ib]
@m.xm1.msky130_fd_pr__nfet_g5v0d10v5[ig]
@m.xm1.msky130_fd_pr__nfet_g5v0d10v5[is]
@m.xm1.msky130_fd_pr__nfet_g5v0d10v5[id]
@m.xm4.msky130_fd_pr__pfet_g5v0d10v5[ib]
@m.xm4.msky130_fd_pr__pfet_g5v0d10v5[ig]
@m.xm4.msky130_fd_pr__pfet_g5v0d10v5[is]
@m.xm4.msky130_fd_pr__pfet_g5v0d10v5[id]
@r1[i]
@m.xm3.msky130_fd_pr__pfet_g5v0d10v5[ib]
@m.xm3.msky130_fd_pr__pfet_g5v0d10v5[ig]
@m.xm3.msky130_fd_pr__pfet_g5v0d10v5[is]
@m.xm3.msky130_fd_pr__pfet_g5v0d10v5[id]
@i2[current]
@include[current]
@v3[i]
@r1[i]
@v2[i]
@v1[i]
v1#branch
v2#branch
v3#branch
m.xm3.msky130_fd_pr__pfet_g5v0d10v5#sbody
m.xm3.msky130_fd_pr__pfet_g5v0d10v5#body
m.xm3.msky130_fd_pr__pfet_g5v0d10v5#dbody
m.xm4.msky130_fd_pr__pfet_g5v0d10v5#sbody
m.xm4.msky130_fd_pr__pfet_g5v0d10v5#body
m.xm4.msky130_fd_pr__pfet_g5v0d10v5#dbody
m.xm1.msky130_fd_pr__nfet_g5v0d10v5#sbody
m.xm1.msky130_fd_pr__nfet_g5v0d10v5#body
m.xm1.msky130_fd_pr__nfet_g5v0d10v5#dbody
m.xm5.msky130_fd_pr__pfet_g5v0d10v5#sbody
m.xm5.msky130_fd_pr__pfet_g5v0d10v5#body
m.xm5.msky130_fd_pr__pfet_g5v0d10v5#dbody
m.xm2.msky130_fd_pr__nfet_g5v0d10v5#sbody
m.xm2.msky130_fd_pr__nfet_g5v0d10v5#body
m.xm2.msky130_fd_pr__nfet_g5v0d10v5#dbody
/vin
/diff
/right
/left
/vgnd
/voff
/vdd

sky130_fd_pr__esd_nfet_05v0_nvt.pm3
v-sweep

Note the duplicate and empty entries, and odd entries like @include[current]
Current KiCad lists items in the format I(R1) and Id(M1) for example.
I'm not very familiar with spice syntax to tell what exactly is going on.

I have added code that transforms @r1[i] to i(r1), but this gets me an
error:
Error: no such device or model name
Error: vector @[i] not found!

So it appears that SOMETHING is case sensitive. I grepped the code for this
error with no success, so I'm not sure where it comes from.
It appears AllPlots comes directly from ngspice, which apparently
lowercases everything?
I'm guessing the error itself also comes from ngspice, if so, it's very
weird that it does not recognise its own names.

I'll keep trying, but suggestions appreciated.

Cheers,
Pepijn

On Mon, Oct 19, 2020 at 10:25 AM pepijn de vos <pepijndevos@xxxxxxxxx>
wrote:

> Thanks!
>
> The let trick of Jonathan is very useful, combined with the textbox to add
> "hidden" signals.
>
> Also very grateful for the pointers of Sylwester. I hope with that I
> should be able to update the interface to list all the signals that are
> available.
>
> Regards,
> Pepijn
>
> On Sun, Oct 18, 2020 at 11:23 PM Sylwester Kocjan <s.kocjan@xxxxx> wrote:
>
>> Hi Pepijn,
>>
>> On 14/10/2020 20:00, pepijn de vos wrote:
>>
>> I think there are a few ways to go about it, which don't exclude each
>> other. One is to extend the logic that adds the currents for voltage
>> sources and resistors to also add transistors.
>>
>>
>> Current release version of KiCad populates simulation signal list based
>> on schematic components. Recently I added function NGSPICE::AllPlots(),
>> which will retrieve names of all vectors from current simulation run.
>> For your transistor issue I believe all you need is to rewrite
>> DIALOG_SIGNAL_LIST::TransferDataToWindow() to use this function. Your
>> NGSPICE object is under aParent->m_simulator.
>>
>> Here's a couple of links:
>>
>>    1. Function to change:
>>
>>    https://gitlab.com/kicad/code/kicad/-/blob/16d5f959814f10c64e2d5a8f14fc8357c5de6fee/eeschema/dialogs/dialog_signal_list.cpp#L49
>>    2. Function that should be used:
>>
>>    https://gitlab.com/kicad/code/kicad/-/blob/16d5f959814f10c64e2d5a8f14fc8357c5de6fee/eeschema/sim/ngspice.h#L63
>>    3. Simulator object:
>>
>>    https://gitlab.com/kicad/code/kicad/-/blob/16d5f959814f10c64e2d5a8f14fc8357c5de6fee/eeschema/sim/sim_plot_frame.h#L354
>>
>> Best regards & can't wait to see the results :)
>> Sylwester
>>
>>
>> On 15/10/2020 15:15, Tomasz Wlostowski wrote:
>>
>> On 14/10/2020 20:00, pepijn de vos wrote:
>>
>> Hey all,
>>
>> I'm a sw dev and recent IC design graduate, who made it his mission to
>> improve open source tools for IC designers.
>> To this end I've been playing with the recently released Sky130 PDK,
>> which is an open source PDK that does not require any annoying NDA's and
>> will actually allow sharing IC designs.
>>
>> I've been looking at eeschema a bit as one of the options to do
>> schematic entry and simulation. However, I found that the integration
>> with ngspice is very limited at the moment. So I'm interested in making
>> this better!
>>
>> The first problem I ran into is that it can't plot the currents of a
>> transistor no matter what you add in terms of spice directives. More
>> info:https://forum.kicad.info/t/how-can-i-plot-transistor-currents-after-a-simulation/25324/8
>> So I have several questions.
>> Would this be a good first issue to tackle?
>>
>> Hi Pepijn,
>>
>> Sure, go for it - and if you'll find it too hard as a starter, there's a
>> ton of other issues in the simulator/ngspice integration...
>> https://gitlab.com/kicad/code/kicad/-/issues?scope=all&utf8=%E2%9C%93&state=opened&label_name[]=ngspice
>>
>>
>> I think there are a few ways to go about it, which don't exclude each
>> other. One is to extend the logic that adds the currents for voltage
>> sources and resistors to also add transistors. Another is to update the
>> simulator UI to populate the signal list from the raw file, rather than
>> its own idea of which signals were saved, so that you can add custom
>> .save statements and plot them.
>>
>> I would by default tell the simulator to log all node voltages/pin
>> currents (including transistor pins). Anything else (that is internal
>> currents, etc.) should be parsed from .save directive (so I'm more in
>> favor of option 2).
>>
>>
>> For example, two other things that would be great to add is a way to
>> plot algebraic expressions of different signals,
>>
>> This looks like a nice feature in the longer term. If you're interested
>> in developing it, I could offer some (but not much) help due to my
>> current workload...
>>
>> Tom
>>
>> _______________________________________________
>> 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
>>
>>
>> _______________________________________________
>> 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
>>
>

Follow ups

References