Re: Update gnucap gitbook

2020-08-23 Thread patrick
On Sun, Aug 23, 2020 at 8:39 AM Vladimir Zhbanov  wrote:
>
> FWIW, I've added a link to your book here:
>
> https://github.com/lepton-eda/lepton-eda/wiki/Simulation
>
> Hopefully, some more people will find it :-)
>

Thank you Vladimir! That is helpful, interesting to learn on
lepton-eda and to see the T flipflop example.
How does lepton-eda support gnucap? I can add a link from the book
back to https://github.com/lepton-eda/lepton-eda

Thanks,
Patrick



Update gnucap gitbook

2020-08-22 Thread patrick
Hello,

I added some more notes on getting started with Gnucap in the gitbook:

https://mulder-patrick.gitbook.io/gnucap/gnucap-getting-started

This chapter just should walk you through a basic simulation cycle
 entering a netlist -> probes -> simulation -> processing output

For plotting the output I am not yet sure what to suggest. The builtin
plot command does not yet give a nice curve, the gwave installation
would take some more time, the gnuplot simulation is best so far. (I
mention the work on plugins that in the future it can simply be done
with a plugin)

Also, if you find the quality of the book good enough, it would be
nice to have it linked from:

http://gnucap.org/dokuwiki/doku.php/gnucap:manual:examples

If you have ideas how to improve the quality of the basic examples
also please let me know.

Thanks a lot, nice weekend,

Patrick



Verilog syntax (Was: parameter usage in simulation)

2020-04-20 Thread patrick
On Mon, Apr 20, 2020 at 9:05 AM al davis  wrote:
>
> On Mon, 20 Apr 2020 08:43:55 +0200
> patrick  wrote:
> > module m(1,2);
> >^ ? need 4 more nodes
> >
> ...
> > Surely I am missing some things... anyway thanks for your help.
> >
>
>
> I think it's in spice mode .. expecting spice syntax.
> In spice syntax, a line beginning with 'm' is a mosfet instance.
>
> Commands in spice mode begin with dot, so try ".verilog" to switch to
> verilog mode.
>
>
Thanks Al! Ok, I confirm it looks better with a .verilog at the start.
Also had a quick look at the wiki now:
http://gnucap.org/dokuwiki/doku.php/gnucap:manual:languages:verilog

But trying to run a simple sweep on the Resistor gives:

.verilog

param w=2

module m(1,2);
   resistor #(.r(w*5)) r(1,2);
endmodule

m #(.w(w)) m1(0, 1);

// sweep dc voltage
vin  1  0  dc 3

.dc vin 0 5 0.2


default plugins: cmake-2 2017.10.18

param w=2
^ ? p: no match
m #(.w(w)) m1(0, 1);
 ^ ? m: 1); has no value?
// sweep dc voltage
^ ? /: no match
vin  1  0  dc 3



Re: parameter usage in simulatoin

2020-04-20 Thread patrick
On Sun, Apr 19, 2020 at 4:45 PM Felix Salfelder  wrote:
>
> On Sun, Apr 19, 2020 at 04:16:17PM +0200, patrick wrote:
> > I am trying to vary W/L parameters of a MOS transistor.
>
> Hi Patrick.
>
> Could you share the model or instanciation of that transistor?

Hi Felix,

thanks for the pointers.
My goal is to get/refresh some basic understanding of simple circuits.
As a start I take this inverter where I would like to sweep W/L
parameters. Indeed W and L would be on the global scope (I think it's
what works in other simulators - but not so important):

.param wn=1
.param wp=2

.subckt inv inn outn vddn
  m2 outn inn vddn vddn  pmos1  w=wp
  m1 outn inn 0   0  nmos1  w=wn
.ends

# supply voltage
vdd  inv_vdd1 0  DC  5

# inverter
x1 inv_in out_n inv_vdd inv

# load
rds  inv_vdd1 inv_vdd  1e-6

# inverter input
vin  inv_in 0  DC  3

.model nmos1 nmos
.model pmos1 pmos

.print dc v(out_n)

.dc vin 0 5 0.2



Note: The "module" syntax is interesting because I also started to
use/learn verilog. And a common syntax might be nice. However, the
example of the resistor module gives:

default plugins: cmake-2 2017.10.18

module m(1,2);
   ^ ? need 4 more nodes
module m(1,2);
   ^ ? no match: area
resistor #(.r(w*5)) r(1,2);
 ^ ? need )
resistor #(.r(w*5)) r(1,2);
  ^ ? what's this?
resistor #(.r(w*5)) r(1,2);
^ ? what's this?
resistor #(.r(w*5)) r(1,2);
  ^ ? what's this?
endmodule
  ^ ? need 4 more nodes


Surely I am missing some things... anyway thanks for your help.



parameter usage in simulatoin

2020-04-19 Thread patrick
Hello,

I am trying to vary W/L parameters of a MOS transistor.

With this syntax:

.param   L1=180e-9
.param  W1=300e-9

I get:

# simple sweep
parameter L1 not specified, using default
parameter W1 not specified, using default
parameter L1 not specified, using default
parameter W1 not specified, using default
parameter L1 not specified, using default
...


What is wrong? How can I get some more info on the error.

Thanks!
Patrick



Re: [Help-gnucap] gnucap jupyter demo

2019-02-04 Thread Patrick Mulder
Hello,

after Felix's work to connect Python and Gnucap (see details in his Fosdem
talk: https://fosdem.org/2019/schedule/event/gnucap/ )
I've put together some small examples to run Jupyter notebooks (on
Windows/Mac with help of Docker):

https://github.com/mulderp/gnucap-jupyter

* dockerfile: enables a user to run Jupyter and gnucap on all docker
supported platforms (Win/Unix/Mac)
* jupyter notebook: simple example of loading gnucap-python
* spice circuit examples: work in progress, but basic example of DC sweep
works, will play a bit more with that

It would be nice to hear your feedback if any.

Thanks!
Patrick


On Sat, Feb 2, 2019 at 5:10 PM Patrick Mulder 
wrote:

> hello felix,
>
> now all jupyter stuff is one repo:
>
> https://github.com/mulderp/gnucap-jupyter
>
>
> * dockerfile: enables a user to run Jupyter and gnucap on all docker
> supported platforms (Win/Unix/Mac)
> * jupyter notebook: simple example of loading gnucap-python
> * spice circuit examples: work in progress, but basic example of DC sweep
> works, will play a bit more with that
>
>
> nice weekend, and FOSDEM,
>
> patrick
>
> PS feel free to announce this on the gnucap mailing list
>
>
>
___
Help-gnucap mailing list
Help-gnucap@gnu.org
https://lists.gnu.org/mailman/listinfo/help-gnucap


[Help-gnucap] Plotting integration

2018-02-11 Thread Patrick Mulder
Hi there,

I tried to integrate plotting  Gnucap simulation results with help of an
Eclipse plugin. I got a basic DC simulation working:


http://blog.farsinotare.com/media/images/gnucap_eclipse.png

However, I am bit confused on the direction of currents in the Nmos
transistor.
they should be >0 mA not negative ?

Vds 1 0 DC +10V

Vgs 2 0 DC +3V

M1 1 2 0 0 nmos_enhance L=10u W=400u

* model statement (Level 1 by default)

.MODEL nmos_enhance nmos (kp=20u Vto=+2 lambda=0)


** output requests **

.print DC V(1) I(Vds)


** analysis request **

.DC Vds 0V 10V 100mV


Btw, my plan would be try to simulate some simple circuits first, before
going again to Python/mixed signal simulation.

BR,

Patrick
___
Help-gnucap mailing list
Help-gnucap@gnu.org
https://lists.gnu.org/mailman/listinfo/help-gnucap