This section has been written by Ales Hvezda for the gEDA project and later adapted for Lepton.
This document describes the creation of component symbols, including style conventions, and hints/tips and things to look out for when drawing symbols for the gEDA/gaf system.
Component symbols (from here on known as symbols) are drawn
using lepton-schematic
. You can start with a blank page or a known-to-be
good symbol that is similar to the one you want to create.
Before you open lepton-schematic
to create your symbol, there are a few
questions you should ask yourself, that will effect how you create
your symbol:
Once you’ve answered those questions, the following guide will be more useful to you.
To start building your symbol:
lepton-schematic
.
Use the ‘line’, ‘box’, ‘circle’, and ‘arc’ tools
(in the ‘Add’ menu) to create a simplified visual representation
of your device. Make sure that the only color you use is
graphic
(green). Do not place any pins on the device until the
next step.
To check what color you are using to draw, go to Edit → Color... (or hit E O).
If you have decided your symbol is graphical in nature (e.g., does not connect to anything, is just artwork), you can skip this step.
Add your first pin.
In the Edit dialog for a pin, you should see four attributes (name=value pairs) already associated with your new pin. These attributes can be edited by clicking on the attribute in the list at the top of the edit window, then clicking on the field you want to edit. Note that when selected, the ‘Add Attribute’ section of this dialog does not reflect what has been selected, as it is only meant for addition, not for editing.
Let’s look at each attribute already associated with your pin, and edit some of the values. I recommend expanding the size of the edit window until all attributes are visible.
lepton-netlist
, and
other tools. For our first pin, start this sequence number at
1
, incrementing it on each new pin, as we add them.
E
or
C
).
Possible pintype values are: in, out, io, oc, oe, pas, tp, tri, clk, pwr. See pintype attribute for more info.
Every symbol needs some attributes (name=value pairs) in order
to be useful in lepton-schematic
, and in other tools.
First we’re going to add all of the attributes we want, then make the ones that need to be invisible invisible.
DIP14
or DIP40
.
Please see the footprint naming conventions page for further detail. If you are
using gEDA / PCB, also see the
PCB documentation and
gnetlist/docs/README.pcb for more info on this attribute and how it is
used.
Now that those have been added, make the numslots, footprint, description, graphical and device attributes invisible. Leave only the value of the refdes attribute visible, and place it somewhere at the top of your symbol.
0
into the entry field and press ‘OK’.
Note: Translating the symbol to the origin is a required step. To translate a symbol elsewhere, enter a offset (in mils) which is a even multiple of 100. Make sure all pins are snapped to a 100 mil grid point.
#
is a number. Typically
#
is 1
but if there are multiple symbols for a device
then this number simply increments.
This section describes the various requirements which must be met in order to create a valid symbol which will display and netlist in the gEDA/gaf system.
lepton-netlist
, and
other tools. This is just a sequence number, and should increment
sequentially starting at 1.
E
or C
).
For more information on the attributes presented here, please see the Master attribute list.
Running gsymcheck will check that all of these requirements are met. gsymcheck will output fatal errors which are quite serious and must be corrected. gsymcheck will also output warnings on things which should be fixed but are not fatal.
This section describes the style which is used in the standard gEDA/gaf symbol library.
lepton-schematic
select
Edit → Show/Hide Inv Text.
A0
on top through A3
and B0
on top through B3
).
Violating this rule will make connecting buses much more difficult.
This section describes some hints and tips which will make your symbol creation experience easier.
This section provides a simple example which tries to follow all of the above rules. This symbol is of a 7400 (NAND gate).
v 20031231 1 L 300 200 300 800 3 0 0 0 -1 -1 T 300 0 9 8 1 0 0 0 1 7400 L 300 800 700 800 3 0 0 0 -1 -1 T 500 900 5 10 0 0 0 0 1 device=7400 T 500 1100 5 10 0 0 0 0 1 slot=1 T 500 1300 5 10 0 0 0 0 1 numslots=4 T 500 1500 5 10 0 0 0 0 1 slotdef=1:1,2,3 T 500 1700 5 10 0 0 0 0 1 slotdef=2:4,5,6 T 500 1900 5 10 0 0 0 0 1 slotdef=3:9,10,8 T 500 2100 5 10 0 0 0 0 1 slotdef=4:12,13,11 L 300 200 700 200 3 0 0 0 -1 -1 A 700 500 300 270 180 3 0 0 0 -1 -1 V 1050 500 50 6 0 0 0 -1 -1 0 -1 -1 -1 -1 -1 P 1100 500 1300 500 1 0 1 { T 1100 550 5 8 1 1 0 0 1 pinnumber=3 T 1100 450 5 8 0 1 0 2 1 pinseq=3 T 950 500 9 8 0 1 0 6 1 pinlabel=Y T 950 500 5 8 0 1 0 8 1 pintype=out } P 300 300 0 300 1 0 1 { T 200 350 5 8 1 1 0 6 1 pinnumber=2 T 200 250 5 8 0 1 0 8 1 pinseq=2 T 350 300 9 8 0 1 0 0 1 pinlabel=B T 350 300 5 8 0 1 0 2 1 pintype=in } P 300 700 0 700 1 0 1 { T 200 750 5 8 1 1 0 6 1 pinnumber=1 T 200 650 5 8 0 1 0 8 1 pinseq=1 T 350 700 9 8 0 1 0 0 1 pinlabel=A T 350 700 5 8 0 1 0 2 1 pintype=in } T 300 900 8 10 1 1 0 0 1 refdes=U? T 500 2250 5 10 0 0 0 0 1 footprint=DIP14 T 500 2450 5 10 0 0 0 0 1 description=4 NAND gates with 2 inputs T 500 2850 5 10 0 0 0 0 1 net=Vcc:14 T 500 3050 5 10 0 0 0 0 1 net=GND:7 T 500 2650 5 10 0 0 0 0 1 documentation=http://www-s.ti.com/sc/ds/sn74hc00.pdf
This example produces the following (using lepton-schematic
):
This is the same symbol with all the hidden text visible (via Edit → Show/Hide Inv Text):