[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-user: series of gnetlist backend patches

I've pushed my local changes to the spice-sdb gnetlist backend and a new
backend out to repo.or.cz and also on the SourceForge patch tracker.
These have been part of my workflow for gschem -> {gnucap-arails,
hspice} within my analog VLSI work for some time.  The holidays
presented time to clean them up.

I use hierarchical, multi-page schematics and mostly use subcircuits for
IC devices to model parasitics and such from the foundry.

The Analog Rails tweaks to gnucap make parallel simulations with hspice
feasible from a common *.sch set.  Their repo is at

A short summary of the patches:

gnetlist: spice-sdb "no_end_card" option suppresses ".end"
SF:  3150011
A two-liner to allow a simulation netlist to .include the
topology/designn netlist.

gnetlist: spice-sdb: write provided subckt parameters from value= attr
SF:  3150016
A value= attribute on the spice-subcircuit-LL symbol is the default
subcircuit parameters.  This then outputs e.g.
.subckt name n1 n2 n3 n4 M=1 foo=43

gnetlist: spice-sdb MOS subcircuits
SF:  3150017
Makes device=SUBCKT_NMOS and PMOS behave like a spice M device but
wrapped in a subcircuit.

gnetlist: New spice-sdb:packsort, generalize to any refdes prefix.
SF:  3150018
The main one, sorts by the refdes alpha-prefix (case insensitive) order
given by 'refdes-sort-order which defaults to: ("*" "TP" "A").  Gnucap
is (more) sensitive to netlist order for parameters, probes, and
analyses.  This gives control over the sorting (with the gnetlist -s
option) by specifying the order of certain prefixes.

gnetlist: Option "sort_port_value" sorts spice-IO devs by value=.
SF:  3150019
This allows using the refdes' to indicate pinlabel and then using
value= to yield a meaningful ordering to a subckt's ports.  My symbol
generator script uses the refdes for pinlabel, order from the value
attribute, and pintype from the device attribute.

gnetlist: makedepend backend
SF:  3150021
Gnetlist backend to determine a schematic's dependencies.  Output
is in the form of:

source.sch: depend1.sch depend2.sch
source.cir: source.sch depend1.cir depend2.cir other.inc

...written to "source.d" file for inclusion into a project's

First line collects all source= attributes in the input pages.  Second
line lists transformed source='s/sch/cir/' and file= attributes
(.include files).

Makefile snippets for my usage of the makedepend backend and other

#  For the moment I don't know a way to avoid restarting make using the methods
#  described in http://mad-scientist.net/make/autodep.html
#generate schematic hierarchy dependencies for .sch and .cir
%.d: %.sch
        $(GNETLIST) -g makedepend -o $@ $<

-include $(schematics:.sch=.d)
# bash script generator, if $1 matches, keep the element
# use as $(shell $(call keep-filter,*.sch))
#   (removes all matches, then removes these elements from orig array)
define keep-filter
  a=( $^ ); for c in $${a[@]##$1}; do a=( $${a[@]#$$c} ); done; echo $${a[@]}

%.cir: $$(wildcard %-*.sch) %.drc
    gnetlist -g spice-sdb -I -s \
        -O sort_port_value \
        -O no_end_card \
        -o $@ $(shell $(call keep-filter,*.sch))

At some point I'll write-up my usage of GAF, but for now: The setup
uses a naming convention including:
some_name-{1,2,..}.sch --> some_name.cir

"make tests" in gnetlist/tests and "./run_tests.sh" in
gnetlist/tests/common both pass.



geda-user mailing list