[Contents][Index]

#### 4.1.2.4 Adding attributes to your symbol

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.

1. A device=DEVICENAME attribute should be placed somewhere in the symbol. The devicename should consist of nothing but capital letters, dashes, numbers, and underscores. If the object is a graphic then device= should be set to none (device=none).
2. A graphical=1 attribute should exist somewhere in a symbol which is purely graphical (such as a title block or `decon` symbol). Symbols which have this attribute have no electrical or circuit significance. Don’t forget to set device=none per the previous step.
3. A description=TEXT attribute should exist somewhere in the symbol. The TEXT value should provide a one line description of the symbol.
4. A footprint=PACKAGENAME attribute should exist somewhere in the symbol which might be used with a pcb netlister. PACKAGENAME is a pcb footprint or package type like `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.
5. A refdes= attribute should be placed inside all non-graphical symbols. This attribute should default to U? for integrated circuits, and T? for transistors. Make only the value visible and it will be promoted (attached to the outside of the symbol (so it can be edited)) when the symbol is placed in a schematic.
6. A numslots= attribute should be placed inside of all symbols, to prevent a warning when you will check your symbol by gsymcheck. numslots=1 works fine.

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.

#### 4.1.2.5 Finishing

1. Add a label to your symbol by selecting Add → Text... or pressing `A T`. Type out your label, and move it to the top of your symbol.
2. Translate the symbol to the origin using Edit → Symbol Translate... or press `E T`.
3. Enter `0` into the entry field and press ‘`OK`’.
4. Save the symbol using File → Save or File → Save As...
5. Place the symbol in one of the directories specified as a symbol library in a suite configuration file (one of the gafrc files). For an explanation of how to set up symbol libraries, see the Legacy configuration. Once this is done, the symbol should be visible immediately and can be selected and placed with the Add → Select Component... menu item. On Debian, placing files in `/usr/share/gEDA/sym/local/` works, but requires permissions setup.

> 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.

#### 4.1.3 Common Symbol Naming Conventions

1. Symbols are named: `symbolname-#.sym`
2. Symbols end with a `.sym` extension.
3. Symbols have a `-#` where `#` is a number. Typically `#` is `1` but if there are multiple symbols for a device then this number simply increments.
4. Symbol names are typically lowercase but letters which are part of a part number are uppercase.
5. The above case rule can be broken if the filename looks incorrect or wrong.

#### 4.1.4 Symbol Requirements

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.

#### 4.1.4.1 Pins

1. All pins should have a pinseq attribute. This number dictates the order pins are looked at on this symbol in spice, `lepton-netlist`, and other tools. This is just a sequence number, and should increment sequentially starting at 1.
2. All pins should have a pinnumber attribute attached to them. This is the number of the pin, on the package of the item you are drawing a symbol for. The pin number can be alphanumeric (i.e. like `E` or `C`).
3. All pins should have a pinlabel attribute attached to them. This attribute is the name or label of the pin (not the pin number). This attribute is also used when a symbol is used in a hierarchical schematic.
4. All pins should have pintype attribute attached to them. This attribute describes the kind of a pin. Possible values are: in, out, io, oc, oe, pas, tp, tri, clk, pwr. See pintype attribute for more info.

[Contents][Index]