delorie.com/archives/browse.cgi   search  
Mail Archives: geda-help/2016/07/28/09:37:28

X-Authentication-Warning: delorie.com: mail set sender to geda-help-bounces using -f
X-Recipient: geda-help AT delorie DOT com
X-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20120113;
h=mime-version:in-reply-to:references:from:date:message-id:subject:to;
bh=NojPa9MRPSDnHXleTMUkLcHXm6aOqiHZZLgibdEvnrU=;
b=Be7BX+RplTFaQoGjZYBIHgGYImtg6PXXsYNMxz0oguqBuElLW0f3wuxhXaHxG60So4
lxzn+fAegFPbGWFQYrfFCvvjgCnXIldGqi4ot7Bz7Fpmu3IVBFDB6x8YPBDWWhN6NDmH
06zlkQMqwCzeuUZwEb0cdr0FZeBA9MIXFcWVGOsHz3BmDFqxO3OJks8uQAh3W87mREtY
r2FqIO6itoZ9lG/p4Zvcb5fG92/pJRIUarlMqBy/ySljs24HgQOnsJMfrALbCL+91HCZ
XCNaCXEOfs/xfaqEANBfIDkMZ+3n1fONXyaPKXZqCXCl8cZwIL2eGjRDG1b2j7/fS4kA
/b7Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20130820;
h=x-gm-message-state:mime-version:in-reply-to:references:from:date
:message-id:subject:to;
bh=NojPa9MRPSDnHXleTMUkLcHXm6aOqiHZZLgibdEvnrU=;
b=DuxdyRd0Wt97kkCzba3pyoEaWid0KjW3NvQADf4P0X9OUEoXOnzrSIk4IoPSlX6M+7
uf6hJT1zQwbQh8/dcGknk5KMXhd3jZpX+mZq3SOLlk9DUhYSHqaF95Iks9WgvfUzzkrH
9LSCCEOPsNY6xB8VefddHTThnxlAUD9bhliRqepHCc301vusbKI6MaYgsU1QwFeEU+r3
/FBUy7mimwOvz2CuQ5tHifRgAYTP9nidiEoVOZMqXv81D9DdZP1Yavh9kKeycaCuYDql
j0lN8cf5FoHYm1C6Kbjk7AQZY5hGImjzF4D39Iwwq272nYrIY5J996fToh5Or7Q2iDyL
mh/w==
X-Gm-Message-State: AEkoouvDg6NGBNp4Q94S8Z/SAgp079KG2zpJUkuQnsnh9CXuAiCyiUs2Tr4Q5/h/WZp+bcgstBQvrYmn7hcvqQ==
X-Received: by 10.159.41.164 with SMTP id s33mr15388494uas.146.1469713013683;
Thu, 28 Jul 2016 06:36:53 -0700 (PDT)
MIME-Version: 1.0
In-Reply-To: <7217b314-539b-27c6-a1f2-368120973adc@ecosensory.com>
References: <7217b314-539b-27c6-a1f2-368120973adc AT ecosensory DOT com>
From: "Vladimir Zhbanov (vzhbanov AT gmail DOT com) [via geda-help AT delorie DOT com]" <geda-help AT delorie DOT com>
Date: Thu, 28 Jul 2016 16:36:52 +0300
Message-ID: <CAMvDHVCecAztKdq1UAWNN6QsvWJQOzTAm_BExJQ8NpVXDGJQ4w@mail.gmail.com>
Subject: Re: [geda-help] gschem to gnucap simulation with gaw waveform output
To: geda-help AT delorie DOT com
Reply-To: geda-help AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: geda-help AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

--001a114ca92c1a720b0538b23ad3
Content-Type: text/plain; charset=UTF-8

John,

On 7/22/16, John Griessen (john AT ecosensory DOT com) [via
geda-help AT delorie DOT com] <geda-help AT delorie DOT com> wrote:
> I've hassled with gwave before and it went unmaintained and now there is gaw
> waveform viewer.
>
> There is a nice write by up on how to use makefiles to drive simulation from
> schematics when you have a complicated enough network
> to analyze that entering it in line by line as a netlist is not productive:
>   http://www.johannes-bauer.com/electronics/gnucap/
>
> It depends on gwave though, so it won't help as is.  I substituted gaw and
> got the makefile rewritten to use it, so I
> plan to write it up on a blog -- sometime soon.
>
> Here's a screenshot of analyzing a volt doubler:
> http://ecosensory.com/tek/gaw-doubler-simul.png
>
> I ran it with a makefile, so it has very quick iteration speed, similar to
> the Kicad demo video:
> https://www.youtube.com/watch?v=A2_-hdRcf4U
> but using gschem and gnetlist.
>
>
>
> On 07/22/2016 12:17 PM, Vladimir Zhbanov (vzhbanov AT gmail DOT com) [via
> geda-user AT delorie DOT com] wrote:
>  > I have prototyped some (very) minimal simulation workflow. I
>  > did it when I learned nullor. If anybody is interested, I could
>  > publish the code.
>
>
>
> I'm interested in seeing whatever is easy to publish.  It could help some
> way, even if I stay with gschem/gnucap/gaw/make.
>

I've just read the tutorial you've mentioned. AFAIR, we have the
same for ngspice in our wiki.

Before I used the same Makefile approach to work on
simulations. Then I wrote a little simulation script which does
almost the same as the tutorial says. The differences are as
follows:

  - you have to add a spice include symbol and chose the file
    where your simulation commands would live using the file=
    attribute, then you can do two files -- one for ngspice and
    one for gnucap -- because some their commands may differ
    (AFAIR, even `tran' differs) and compare simulations
    (sometimes one of them would fail while another one works);

  - I used the spice-sdb option "sort_mode" in order to
    have less mess in CVS;

  - I used batch mode and looked at the simulator output in the
    background terminal

  - shortkeys also exist for editing the resulting netlist and
    launch your wave viewer (it is "gwave" in the code, however
    "gaw" should work as well)

I load it in my ~/.gEDA/gschemrc like this:

  (load "/path/to/simulation.scm")

Since I edited it several times and rewrote its style a couple of
days ago, something may not work, though I hope it works as it
is (though you have to change "gwave" to "gaw" if you use the
latter).

Slightly OT: Russian speacking users may find my translation of
the gnucap manual done a couple years ago.

One more remark: gnucap can sweep values itself.

  Vladimir

--001a114ca92c1a720b0538b23ad3
Content-Type: application/octet-stream; name="simulation.scm"
Content-Disposition: attachment; filename="simulation.scm"
Content-Transfer-Encoding: base64
X-Attachment-Id: file0

KHVzZS1tb2R1bGVzIChnZWRhIHBhZ2UpCiAgICAgICAgICAgICAoZ3NjaGVtIHdpbmRvdykpCgoo
ZGVmaW5lIChzaW11bGF0aW9uOnJ1bi1jbWQgY21kKQogIChmaWxlLXNhdmUpCiAgKGdzY2hlbS1s
b2cKICAgKHN0cmluZy1hcHBlbmQgIkludm9raW5nIGNvbW1hbmQgIgogICAgICAgICAgICAgICAg
ICAoc3RyaW5nLWpvaW4gY21kICIgIikKICAgICAgICAgICAgICAgICAgK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
bXBhdGliaWxpdGllcyIgZm9yIGluZm9ybWF0aW9uIG9uIGJ1ZyByZWxhdGVkCiAgOzsgdG8gc3lu
dGF4LXRyYW5zZm9ybWVycyBpbiB0b3AtbGV2ZWwgcHJvZ3JhbXMgKE5fIGlzIGEgc3ludGF4IHRy
YW5zZm9ybWVyKQogIChhZGQtbWVudSAoTl8gIl9TaW11bGF0aW9uIikgc2ltdWxhdGlvbjptZW51
LWl0ZW1zKSkKCihnbG9iYWwtc2V0LWtleSAiPFNoaWZ0PlMgTiIgJ3NpbXVsYXRpb246bmV0bGlz
dCkKKGdsb2JhbC1zZXQta2V5ICI8U2hpZnQ+UyBFIiAnc2ltdWxhdGlvbjplZGl0LW5ldGxpc3Qp
CihnbG9iYWwtc2V0LWtleSAiPFNoaWZ0PlMgUiIgJ3NpbXVsYXRpb246c2ltdWxhdG9yKQooZ2xv
YmFsLXNldC1rZXkgIjxTaGlmdD5TIEEiICdzaW11bGF0aW9uOnNpbXVsYXRvci1hbHQpCihnbG9i
YWwtc2V0LWtleSAiPFNoaWZ0PlMgVyIgJ3NpbXVsYXRpb246d2F2ZS12aWV3ZXIpCihnbG9iYWwt
c2V0LWtleSAiPFNoaWZ0PlMgSCIgJ3NpbXVsYXRpb246aGVscCkK
--001a114ca92c1a720b0538b23ad3--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019