gEDA Project Wiki

Site Tools

geda:faq-gschem

Translations of this page are also available in the following languages: Français, Русский.

General

I found a bug! What can I do about it?

1. See if you can reproduce the bug.
2. Ask on the geda-user mailing list if there is a work around, or has been dealt with in the bleeding edge version of gEDA/gaf. Note, that you must subscribe to the geda-user e-mail list before you can post to this list.
3. See whether the issue is already in the bug tracking system of geda/gaf. If not, file a bug report. Make sure to give all information necessary to reproduce the bug and add the version of gEDA/gaf that contains the bug.
4. Finally, as with all open source projects, you may flex your programming muscles and try to fix the bug yourself. Please file a patch of the changes you had to make to the BTS of geda/gaf. The patch will be gladly accepted to improve the next release of gEDA/gaf.

Gschem usage

There is no symbol in the chooser dialog!

The chooser dialog presents a list of captions of the library sections. Click on the right-pointing triangle to the left of caption. This will expand the list. Scroll down to the symbol you want to add to the schematics.

How do I move a component?

1. Select the component by clicking it with the left mouse button. The component will highlight.
2. Drag the component (using the left mouse button) to the place you want it.

How do I move components without dragging a tail of connected nets?

Type [or] to toggle this behaviour. That is, the “o” key followed by the “r” key. The status window will report if the toggle command was performed. The command can also be accessed via the Options menu.

How do I change the size of the text on a symbol?

1. Select the symbol.
2. Right click → down symbol (or do Hierarchy → down symbol). This takes you to the symbol editor.
3. Select the pinnumber you want to change.
4. Do Edit → Edit Text (or type keyboard shortcut “ex”).
5. Change the font size in the pop-up box.
6. Repeat for all desired text elements.
7. File → save
8. Right click → up (or Hierarchy → Up). Now you are back in the schematic editor.
9. With the symbol still selected do Edit → Update component (or use the keyboard shortcut “ep”). If this doesn’t work, just delete the symbol and reload it.

More generally, you can use this procedure to edit anything on a symbol. (Substitute “Edit Text” for your desired edit, of course.)

Is it possible to overline text in gschem?

Yes, overbars are possible. A backslash followed by an underscore will start an overlined section of text. A second backslash-underscore combo will return to normal text. Example: Double click on an attribute and type “\_this\_”.

Note, on transfer to pcb, there will be no overline on the layout.The backslash is ignored, which leaves an underscore at the edges of the overlined text.

How do I unlock a locked component

When a component is locked it cannot be selected with the middle mouse button; however it is selectable using a window select. To window select a component, click and hold the left mouse button and drag the mouse to create a rectangular region containing the component to be unlocked. Execute the command Edit unLock to unlock the component.

How can I get refdes automatically numbered when I draw a schematic?

Edit the system-gschemrc file or place the following into a gschemrc file (either ~/.gEDA/gschemrc or a gschemrc file in the local directory where you invoke gschem):

(load (string-append geda-data-path "/scheme/auto-uref.scm")) ; load the autonumbering script
(add-hook! copy-component-hook auto-uref)      ; autonumber when copying a component

What is a Bus and how do I use it?

A 'bus' is purely decoration. The netlister ignores it. The netname= attribute does actual work of connecting points together–this is what gnetlist reads and transforms into your netlist. It is not possible to connect to a discrete line or 'bit' on a bus because, again, the bus is merely a graphical entity.

Some users have found it helpful to organize their nets by incorporating a bus name into the net name. For example “net=busA:1” may be added to each busripper to aid in sorting out the nets.

What are the mouse bindings in gschem?

By default you get:

• Left mouse button is used for picking and drawing.
• Middle mouse button is either move object (just hold down the middle button over an object and move the mouse) or copy object (ALT key held down while holding down the middle button over object and move the mouse).
• Right mouse button is a popup menu.

You can change the middle button by adding the following to a gschemrc file:

(middle-button "action")   ;default binding, move or copy an object

or:

(middle-button "stroke")   ;draw mouse gestures/strokes (must install libstroke to enable

or:

(middle-button "repeat")   ;repeat the last command executed

You can change the right button by adding the following to a gschemrc file:

(third-button "popup")     ;default binding, show a popup menu

or:

(third-button "mousepan")  ;use the mouse to pan around the schematic

Can gschem do a hierarchy where the top-level symbol points to a multi-page schematic?

Yes. Just attach the source= attribute multiple times with different values. Drill down into the schematic from the symbol, then use [page-up] / [page-down] to navigate through the pages on that level.

Can the hierarchy be setup in multiple directories?

Yes. Make sure, the (source-library “…”) and (component-library “…”) declarations in your gafrc file list the appropriate paths.

All netnames are global with regard to the current sheet. Whether or not netnames are global in a hierarchical stack of schematics, depends on the settings in gnetlistrc. This file can reside in HOME/.gEDA or locally next to the schematics. Defaults are set in system-gschemrc. Copy the respective lines to your local gnetlistrc, if you want a different behavior. There is no way to make individual netnames global. However, you can differentiate between netnames granted to nets the netname attribute and netnames defined by the net attribute. This aims at power symbols, which set their net with the net attribute. That way, you don't need to hand the power nets in the sub sheet symbols. How can options and libraries be specific on subsheet level? When opening schematics, libgeda changes directory. So it should load any gafrc in the sub-dirs too, as and when the schematics are processed. Are there limitations to hierarchy design? Although support for subsheets covers many aspects of hierarchical design, there are some limitations: • Buses cannot connect into subsheets. • There is no GUI way to start subsheets. You need to manually create a separate symbol for each subsheet. Feel free to fix these issues. Contributions are welcome. gschem symbols Where do I find symbols beyond the default library? There is a website gedasymbols.org dedicated to user contributed resources for gEDA. You can search the site, preview symbols and download them individually. If you have configured your gafrc files accordingly you can put the symbols right next to the schematics file of your project. You might want to build a local library of symbols, so all projects can access the new symbols. See below for the details. You can even download all user contributed content from gedasymbols. See the instructions on how to access gedasymbols using CVS. What's this business about heavy vs. light symbols? This nomenclature arose from a discussion which frequently appears on the geda-user and geda-dev mailing lists. A light symbol is one which contains very few built-in attributes in the symbol itself. It requires that the user attach almost all attributes at the schematic level (e.g. using either gschem or gattrib). A heavy symbol is one which contains many attributes (such as package footprints, SPICE model names, etc.) built into the symbol file itself. A heavy symbol therefore requires very little attribute attachment at the schematic level – you just place it and you’re done. The debate between proponents of heavy and light symbols is very detailed and involved. Briefly, proponents of heavy symbols believe that they provide better integration between gschem and PCB since the important layout attributes (such as footprint name) are already built into the symbol. This is considered a good thing for new users (noobs) who just want to design a simple board and don’t appreciate or don’t care about the zillions of variations that even a simple resistor might have (e.g. different footprint, TCR, precision, material composition, etc). Proponents of light symbols prefer to deal with attributes at the schematic level because they believe it to be more flexible. They are quick to point out that a library of heavy symbols will quickly grow into the thousands of parts with grotesquely long names trying to distinguish between the different variations of the part. They also point out that the utility “gattrib” is the preferred tool for dealing with attributes at the schematic level (i.e. in the .sch file). GEDA/gaf, as default configured, uses light symbols, although it can be configured to use heavy symbols. For further information, you may read these discussions from the geda-user mailing list: I am loaded a symbol from the library. How come it is not aligned to the grid? The vast majority of symbols in the library is designed for 100 units grid. Make sure, your grid is set to 100 units. Choose “Snap_Grid_Spacing” in the options menu for a dialog to check and change the grid. The symbols in the symbol library, were contributed by users just like you. Some people use different grid settings than other people (e.g. 50 units rather than 100). If you discover a symbol which seems to be off the grid, try to reduce your grid spacing and move the hot spots of the pins so that they sit on the grid. Then revert to your preferred grid settings. In addition, you may send the corrected symbol to the mailinglist geda-user The symbols at gedasymbols.org are even more adapted to the specific preference of their author. Yes, the gEDA docs strongly suggest that symbols use 100 units grid spacing. But everybody likes to do things their own way, and there is no overall symbol dictator to enforce the rules on contributed symbols. That said, the vast majority of symbols out there conform to the recommendation. You just need to be aware of this possibility. Is there an explicit "no connect" symbol that I can/should place in the schematic to prevent gnetlist from thinking I've forgotten a connection? Answer: misc → nc-left, nc-right, nc-top, nc-bottom. Caution: occasionally this may create a net called “no_connect” (or “NC??“) which may lead to no-connect pins being connected together in gnetlist – which you probably don’t want to happen. If you want an entire symbol to be graphical (no elec. connections) , add a “graphical=1” attribute. The netlister will ignore these symbols entirely. How do I promote an invisible symbol attribute into the schematic? Most attributes living in the symbol do not get promoted to the schematic unless they are visible. To promote invisible symbol attributes, look for the following keywords in the system-gafrc file: (attribute-promotion "enabled"); (promote-invisible "disabled") ; ⇐ This one (keep-invisible "enabled") Add to your gafrc file: (promote-invisible "enabled") and you will get all the attributes promoted. The “keep-invisible” keyword will keep hidden those attributes that are hidden in the symbol file. What should I do about power pins on my symbols: Make them visible (explicit) or invisible (implicit)? In the past, digital logic circuits often hid the power pin, and attached power nets using an attribute inside the symbol. Modern thought is that this is a bad practice (although religious wars still occasionally rage about this topic). It’s marginally OK for an old logic circuit which is all 5V TTL to have hidden power and GND pins. If you only have +5V on your board, then hiding the power pin can simplify your schematic somewhat. However, few designers design such circuits nowadays; 5V TTL (and 5V CMOS) are rapidly becoming antique technologies. It’s always been unacceptable to hide the power pins on analog chips. First, analog often has multiple power connections (VCC, VEE) which need to be explicitly drawn out. Second, good design practice is to place decoupling caps on each and every power pin. Sometimes one places an inductor in series with power also. Since these should be drawn into the schematic, it is best done by attaching them to an explicit power pin. Therefore, one should never use hidden power pins for analog symbols. New logic circuits often use multiple supplies for different chip sections (OVDD, DVDD, etc). It is also typical to have several logic families on a single board (5V, 3.3V etc.). Therefore, it’s best to explicitly place and wire the power pins on the symbol. Hidden power pins are a recipe for disaster since you can all too easily misconnect a 5V part to a 3.3V power net, for example. To paraphrase Nancy Reagan: Just say “no” to hidden power pins. That said, it may still be useful to detach the power pins from the functional part of the symbol. To do so, define a separate power symbol and give it the same refdes as the functional part. A run of gsch2pcb will treat the siblings properly as one single component. As neither gschem nor gsch2pcb explicitly know that the component is only complete with both symbols defined, you have to check yourself. With this workaround, you can draw all power related circuitry in one corner of the schematic where it does not interfere with the signal nets. In many cases this is advantageous with analog circuits. Is it possible to have zero length pins? You can set both ends of the pin to the same coordinate. This will give you a pure red marker without a pin extending from it. Currently, the GUI won't let you draw such a pin. Append the following line to a symbol file in a file editor: P 100 100 100 100 1 0 0 This is a zero size pin at the bottom left of the canvas. You can move it around, attach attributes, or copy it like any other pin. Unattached, it looks like a little red flag, while with a net attached it disappears. Gnetlist has no trouble treating it as a pin. Is there a specification or manual for creating gschem symbols? Where is it? Yes. It is the Symbol Creation Guide. Is there a symbol wizard in gschem? There is no wizard included in the gschem-GUI. But there are scripts which automatically create symbols from parameters given in a config file. One of these scripts is tragesym. It is part of the default installation of geda. A short tutorial will get you started with this tool. One of the major contributors to the project wrote his own symbol creation script: djboxsym Additionally, there is a tool (ibs2symdef.py) for generating symdef files for use with djboxsym from IBIS models. It is distributed with the PyBIS project: PyBIS wiki Check the gschem symbol generators page for others generators available. Where can I find information on gschem's file format? Unlike many other EDA software, the format of gschem is strictly human readable ASCII. This is deliberate, to facilitate scripting. It also allows for quick fixes with the text editor. The format of gschem files is described here. Why are symbols so big? There is nothing in gschem that defines the absolute size of objects. The only connection to real world units is the file name of the various title blocks. For some long forgotten reason, the frame of the title block symbols named “title-A4.sym”, or “title-B.sym” can contain only relatively simple circuits made of the symbols in the default library. If you'd like to put a frame around more complex circuits just choose a title page symbol that fits. When printing, gschem scales the output so that everything fits within the desired paper format. This paper format is completely independent of the title page symbol used in the schematic. So there is no need to scale the symbols themselves to make them fit a particular paper size. Most people prefer to use title-A2.sym or title-A3.sym when printing to A4 sized paper. Some use title block symbols with no frame at all and draw a rectangle as needed (e.g. title-block.sym by Kai-Martin Knaak). That said, there may be circumstances where you actually want scaled symbols. There is a number of options to achieve this: • DJ Delorie contributed a Perl script called scale-schematic on his pages in gedasymbols.org. • Build your own library of symbols. This is not that far off, since many people end-up using exclusively their own symbols anyway. Gschem configuration/customization Gschem is configurable in more ways than can be described here. Look at “system-gschemrc” for suggestions what else can be done. How do I configure my local gafrc to find my local symbol directory? 1. Create a project directory, for example{HOME}/myproj.
2. Place the symbols you want to use into ${HOME}/myproj/symbols. 3. Create a gafrc file in${HOME}/myproj.
4. In gafrc, put this line:
 (component-library "./symbols")
5. Run gschem from your project directory ${HOME}/myproj. That is, do this to run gschem: cd${HOME}/myproj
gschem myschematic.sch

Points to remember:

(component-library "${HOME}/geda/symbols/analog") Is there a way to give a library a name that differs from its directory? Add a third argument to the component-library stanza in gafrc, e.g.: (component-library "/home/comp/sch_symbols/AutoGen/Panasonic/0603/1P" "Panasonic 0603 1P") Can my local library cover frequently needed sub circuits? Yes, symbols can contain symbols and nets. 1. Copy the subcircuit to a fresh sheet. (unlock and remove the default title block as you won't need it) 2. The values of refdes attributes should end with ”?“, to allow to auto number them later. 3. Move the sub circuit to the lower left of the available space. (You can use symbol-translate from the edit menu) 4. Save the sub circuit as a *.sym file in your local library. 5. Choose “Include component as individual objects” when selecting this complex symbol for your actual schematic. The whole sub circuit will be pasted to your sheet. Be sure to switch back to the default mode for inclusion of ordinary symbols. The library window is cluttered with default symbols. Can I restrict to my local lib? Put a localized version of the following lines in a gafrc. ; empty the library path and populate it with local paths (reset-component-library) (component-library "/foo/localgedalib1") (component-library "/bar/foo/localgedalib2") You can either add directories of your local library separately or add a whole tree with subdirs. See above on how to do this. It's a good idea to place this gafrc in your project's dir. That way, if you start gschem from some other place, you still get the system symbols shown. This also allows to configure special symbol libs for specific projects. How can I change the default size of floating text? Put (text-size 10) into your gschemrc and replace “10” with your favorite size. Can I have light background color, please? Put this line in a gschemrc file at a place where gschem looks at start-up: (load (build-path geda-rc-path "gschem-colormap-lightbg")) How can I tweak colors in gschem? Currently, there is no GUI to tweak the colors of gschem interactively. However, you can set them in a RC file. 1. Copy the file gschem-colormap-lightbg or gschem-colormap-darkbg to $HOME/.gEDA/mycolors.
2. Edit the settings in .gEDA/mycolors to please your taste.
3. Add this line to your gschemrc:
(load (build-path (getenv "HOME") ".gEDA" "mycolors"))

Each time I start gschem, the log message window is shown. Can I disable it?

In the system-gschemrc file, you will find the following section:

; log-window string
;
; Controls if the log message window is mapped when gschem is started up
; Possible options:
;       startup - opened up when gschem starts
;       later   - NOT opened up when gschem starts
;                 (can be opened by Options/Show Log Window)
;
(log-window "startup")
;(log-window "later")

Comment out the startup line (with a ;) and comment in the later line, or add the following line to your gschemrc file:

(log-window "later")

If you want to see the logging messages on stdout instead of the log window, put this line in your gschemrc file:

(logging-destination "tty")

do
base="${name%.*}" gaf export --output=$base.ps -- $base.sch lpr -P$PRINTER $base.ps done The paper size can be adjusted using the -p option. To set the paper size to A4 use something like: gaf export --paper=iso_a4 -o MY_SCH.pdf MY_SCH.sch To set the preferred paper size to “US Letter” for all schematics you open, run: gaf config --user export paper na_letter How can I get color PDF/PNG output? Edit the system-gschemrc file or place the following into a gschemrc file (either ~/.gEDA/gschemrc or a gschemrc file in the local directory where you invoke gschem): (print-color "enabled") ; for color PDF output (image-color "enabled") ; for color PNG output (enabled by default) How can I get black and white postscript/PNG output? For black and white PS output, place the following into a gschemrc file: (output-color "disabled") ; for monochrome postscript output For black and white PNG images, place the following into a gschemrc file: (image-color "disabled") ; for monochrome PNG output How can I produce PDF output? Use File→Write image… to show the “Write image…” window. This gives the option to export to PDF. Alternatively, run: gaf export --output=foo.pdf bar.sch How can I insert schematics into my LaTeX document? For use with normal the latex command, you will need an EPS (Encapsulated PostScript) file. For pdflatex, you will need a PDF file. To generate an appropriate file, run: gaf export --size=auto --output=foo.eps foo.sch or: gaf export --size=auto --output=foo.pdf foo.sch Add usepackage{graphicx} to the preamble of your LaTeX document. Use the command includegraphics to place your schematic. A simple example: \documentclass{article} \usepackage{graphicx} \begin{document} \begin{figure} \includegraphics[width=100mm]{foo} \end{figure} \end{document} How can I split Postscript output over multiple pages? gschem does not provide this functionality internally, however there is a program called “poster” which does exactly this. It can be downloaded from either here (GNU) or here (KDE Print). Gschem installation/run-time problems After installation gschem does not work!? What could be wrong? If you run gschem and you get a window without a menu bar, no colors, and the program terminates when you press a key with the following message: ERROR: Unbound variable: current-keymap Or you get errors like this: Gtk-CRITICAL : file gtkpixmap.c: line 97 (gtk_pixmap_new): assertion val != NULL’ failed. Gtk-CRITICAL : file gtkpixmap.c: line 97 (gtk_pixmap_new): assertion val != NULL’ failed. Tried to get an invalid color: 0 Tried to get an invalid color: 7 Tried to get an invalid color: 0 Tried to get an invalid color: 7 then gschem is not finding an rc file. There are two required rc files. The first is system-gschemrc and the second is system-gafrc. • The system-gschemrc rc file should be installed when you install gschem and typically resides in ${prefix}/share/gEDA/system-gschemrc. ${prefix} is where you installed gschem (usually /usr or /usr/local or $HOME/geda). This file can also be installed in /etc/gEDA (the .debs packages do this).
• The system-gafrc rc file should be installed when you install the libgeda shared library gEDA/gaf. It resides in ${prefix}/share/gEDA/system-gafrc. This file can also be installed in /etc/gEDA (the .debs packages do this). This file is not loaded directly by gschem. Make sure these file are installed. The gschem.log file (which is created everytime you run gschem) holds valuable debugging information which should help in determining what is wrong. Check this file for where gschem is looking for the rc files. Also, some older releases of gEDA/gaf had some bugs when the rc files were installed in other locations (other that ${prefix}/share/gEDA), so please upgrade to a more current release.

Make sure that at least one of your config files contains a valid path to a symbol library. At startup, gschem checks for the following config files (on a Debian system):

1. distributed system-wide gafrc file: /etc/gEDA/system-gafrc (will be overwritten on update)
2. local system-wide gafrc file /usr/share/gEDA/gafrc.d/gafrc (with geda versions after summer 2009)
3. user gafrc file: ~/.gEDA/gafrc
4. local gafrc file: $PWD/gafrc 5. system gschemrc file: /etc/gEDA/system-gschemrc 6. user gschemrc file: ~/.gEDA/gschemrc 7. local gschemrc file: $PWD/gschemrc

All of these config files may or may not append paths to the library search list. If a config file contains the command

(reset-component-library)

the library search path will be emptied. Order is obviously important, as this command will erase any previously appended paths.

I'm using gschem/gaf through a SSH connection and I get an error like: 'Xlib: extension "RENDER" missing on display "localhost:10.0".'

If you are getting into the remote machine by doing:

$ssh -X your_username@your_remote_machine and afterwards you get the Xlib RENDER message, then try using: $ ssh -Y your_username@your_remote_machine

The latter enables trusted X11 forwarding.