Re: [Kicad-developers] eeschema for IC design

2020-10-15 Thread Jonatan Liljedahl
On Wed, Oct 14, 2020 at 8:00 PM pepijn de vos  wrote:
...
> For example, two other things that would be great to add is a way to plot 
> algebraic expressions of different signals, to plot things such as impedance 
> and transconductance, and a way to annotate operating points in the 
> schematic. But these are probably a lot more work, and also require some more 
> in-depth design discussion.

Actually you can plot algebraic expressions. Here's an example from my
experiments with checking phase margin of op-amp circuits etc:

.ac dec 20 10 10Meg
.control
  set controlswait
* calculate loop gain, noise gain, open loop gain
  let AB=V("/m2")/V("/m1")
  let B1=V(out)/V("/m2")
  let Aol=V(out)/V("/m1")
* print out cross-over frequency and phase margin
  let dbAB=db(AB)
  let phAB=180/pi*ph(AB)
  display
  meas ac unitf when dbAB=0
  meas ac phm find phAB at=unitf
.endc

Some things to note here are that local labels in eeschema will have
"/" in their names and thus must be quoted, also the new signals AB,
B1 and Aol won't show up in the signal list, but you can still add
them manually by entering their name in the textbox below the list!
(Actually I added that textbox specifically for this purpose, but it
also works for quickly adding a signal with known name instead of
having to scroll around in the list)

Cheers

-- 
/Jonatan
http://kymatica.com

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] eeschema for IC design

2020-10-15 Thread Tomasz Wlostowski
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=%E2%9C%93=opened_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@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp