Free Electronic Lab

Opensource EDA software development, some thoughts about the EDA/Semiconductor industry and Mixed-signal integrated circuit design

life without gwave when using gspiceui


Gspiceui is about to enter into the fedora collection. However gwave (a requirement of gspiceui) isn’t yet packaged for review. Xavier Lamien is struggling to satisfy the BuildRequires of gwave, which are quite old and painful to build them properly. But gspiceui is such a great tool (though GUI isn’t attractive) for spice simulation. It can work on either the gnucap or ngspice engine.

I wrote a simple scenario, a RC circuit. which describes how Mr Joe or Miss Jane will use this gspiceui even without gwave to satify the missing feature ‘plot’. You would surely guess plotting curves in electronic simulation is a must.

We will simulate the charging process of a capacitor.
cir1.ckt describes the spice netlist of the RC circuit with a different voltage source. We will choose our own voltage source.

$ mkdir gspiceui_test
$ cp cir1.ckt gspiceui_test
$ cd gspiceui_test
$ cp cir1.ckt cir2.ckt
We will work with this cir2.ckt leaving cir1.ckt as a backup.

# launch gspiceui
$ gspiceui&

gspiceui uses either the gnucap or ngspice engine for simulation. First of all, we will start with ngspice, because I maintain it, after if you want, you can retry doing the procedures with gnucap.

Options -> ngspice (and wait a few secs, till gspiceui configures itself)

File -> Open -> choose cir2.ckt
now, choose “c” under “component” and choose “Transient”
then, change “stop time” to 1 sec. ONE SECOND.
You should see the following screenshot:

then choose “vin” at “Voltage Source”. Next to it, is a button called “setup …”. Click it.
Fill the dialog as shown in this screenshot:

and hit OK
Simulate -> Create
you should see this screenshot:
Simulate -> Run
you should see this screenshot:
Till now, without gwave, the user can’t do more. Hence the data you saw in the above screenshot, is pretty much useless, unless Mr. Joe or Miss Jane knows “LabPlot”.

LabPlot is already on fedora repositories. (thanks Mamuro for reviewing that package :) )
# yum install LabPlot
then launch LabPlot.
File -> Import “cir2.ngspice.tr”
As you can see gspiceui stored the simulated data in the file “cir2.ngspice.tr”
hit OK:
you will see the data properly filled into a spreadsheet.:
Now we will plot the simulated data, which gspiceui should have done if we have gwave.

on labplot,
Spreadsheet -> Plot -> 2D Plot (XY)

That’s it, you should see the charging curve:http://tux.u-strasbg.fr/~chit/gspiceui/out.lpl

You can do the same way with the “gnucap” engine. Just copy cir1.ckt to cir3.ckt and start the hold process again.

In this example, we started the simulation with a netlist (a simple text file), but there is another way to do the simulation (from a schematic).
If you want to grab a rpm of gspiceui:
http://tux.u-strasbg.fr/~chit/gspiceui/gspiceui-0.8.90-3.i386.rpm

About these ads

Filed under: Uncategorized

One Response

  1. DenisG says:

    A much simpler and more convenient way is using gnuplot, mimicking gwave‘s behaviour for gspiceui. Put the following into the file “/usr/bin/gwave”:

    ———————-
    #!/bin/bash

    FILE=”$1″
    HEAD=`head -n 1 “$FILE” | tr -s ‘ ‘`
    COLS=`echo $HEAD | wc -w`

    {
    echo plot ‘\’
    for x in `seq 2 $COLS`
    do
    echo -n ‘ ‘ \”$FILE\” using 1:$x with lines ti \”`echo $HEAD | cut -d ‘ ‘ -f $x`\”
    if [ ! $x -eq $COLS ]
    then
    echo -n ‘,\’
    fi
    echo
    done
    } | gnuplot -persist
    —————————-

    That way you simply can click the “plot” button. gnuplot‘s window will pop up and show the plot automagically.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Profile

Chitlesh Goorah
Digital IC design engineer
Neuchâtel, Switzerland

Read the blog ….


This blog is featured on Sean Murphy's EDA blogger list.

Also, on a side track, I sometimes write about the success stories of opensource EDA tools on [open electrons] on edacafe.com.

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 26 other followers

Archives

Je touitte – I tweet

Follow

Get every new post delivered to your Inbox.

Join 26 other followers

%d bloggers like this: