User Tools

Site Tools


geda:faq-gschem

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
geda:faq-gschem [2013/12/13 05:19]
vzh Removed dead link
geda:faq-gschem [2014/06/29 14:02]
vzh Add info about (component-library-search ...)
Line 1: Line 1:
 +//​Translations of this page are also available in the following languages://​ [[faq-gschem.fr|Français]],​ [[faq-gschem.ru|Русский]].
 +
 ====== General ====== ====== General ======
  
Line 91: Line 93:
 Yes. Sub sheets are represented by special symbols on the top level schematic. You can find an example for a hierarchical design in the doc section of gschem (''​geda-doc/​examples/​gTAG/​gTAG.sch''​). Currently, there is no way to automatically build a sub sheet symbol from an actual sub sheet. The sub sheet symbol has to be drawn manually. Any patches or external scripts that get the job done would be greatly appreciated. Yes. Sub sheets are represented by special symbols on the top level schematic. You can find an example for a hierarchical design in the doc section of gschem (''​geda-doc/​examples/​gTAG/​gTAG.sch''​). Currently, there is no way to automatically build a sub sheet symbol from an actual sub sheet. The sub sheet symbol has to be drawn manually. Any patches or external scripts that get the job done would be greatly appreciated.
  
-A ''​source=''​ attribute attached to the sub sheet symbol gives the path to the sub sheet file. The pins of the symbol correspond to ports from top sheet to sub sheet. These ports should correspond to a refdes of a port symbol on the sub sheet. The port symbols in the default library of geda are ''​in-1.sym''​ and ''​out-1.sym''​. Use the hierarchy menu to navigate within the hierarchy of sub sheets. Alternatively,​ you can navigate with the page manager. ​+A ''​source=''​ attribute attached to the sub sheet symbol gives the path to the sub sheet file. The pins of the symbol correspond to ports from top sheet to sub sheet. These ports should correspond to a refdes of a port symbol on the sub sheet. The port symbols in the default library of geda are ''​in-1.sym''​ and ''​out-1.sym''​. Use the hierarchy menu to navigate within the hierarchy of sub sheets. Alternatively,​ you can navigate with the page manager.
  
 To convert a hierarchy to a netlist just call gsch2pcb on the top level schematic. By default, net names and refdes'​s of components are strictly local to the subsheet. They get the sub sheet symbol refdes as a prefix when inserted into the net list. You can even use multiple instances of a sub sheet symbol without undue short cuts. Whether or not net names and refdes'​s are mangled and thus local to the sub sheet can be configured in the config file gnetlistrc. Copy the corresponding lines from ''​system-gnetlistrc''​ to ''​gnetlistrc''​ in the current working directory or to ''​$HOME/​.gEDA/​gnetlistrc''​. A convenient configuration is to make nets delivered by power symbols global while ordinary nets remain local to the sub sheet. This can be achieved with "​hierarchy-netattrib-mangle"​ enabled. To convert a hierarchy to a netlist just call gsch2pcb on the top level schematic. By default, net names and refdes'​s of components are strictly local to the subsheet. They get the sub sheet symbol refdes as a prefix when inserted into the net list. You can even use multiple instances of a sub sheet symbol without undue short cuts. Whether or not net names and refdes'​s are mangled and thus local to the sub sheet can be configured in the config file gnetlistrc. Copy the corresponding lines from ''​system-gnetlistrc''​ to ''​gnetlistrc''​ in the current working directory or to ''​$HOME/​.gEDA/​gnetlistrc''​. A convenient configuration is to make nets delivered by power symbols global while ordinary nets remain local to the sub sheet. This can be achieved with "​hierarchy-netattrib-mangle"​ enabled.
Line 119: Line 121:
 ===== Are there limitations to hierarchy design? ===== ===== Are there limitations to hierarchy design? =====
 Although support for subsheets covers many aspects of hierarchical design, there are some limitations:​ Although support for subsheets covers many aspects of hierarchical design, there are some limitations:​
-  * Buses cannot connect into subsheets.  +  * Buses cannot connect into subsheets. 
-  * There is no GUI way to start subsheets. You need to manually create a separate symbol for each subsheet.  +  * 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. ​ +Feel free to fix these issues. Contributions are welcome.
  
  
Line 129: Line 131:
  
 ===== Where do I find symbols beyond the default library? ===== ===== Where do I find symbols beyond the default library? =====
-There is a website [[http://​www.gedasymbols.org/​|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 [[faq-gschem#​can_gafrc_use_a_variable_to_set_the_root_of_my_library|below]] for the details. ​+There is a website [[http://​www.gedasymbols.org/​|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 [[faq-gschem#​can_gafrc_use_a_variable_to_set_the_root_of_my_library|below]] for the details.
  
 You can even download all user contributed content from gedasymbols. See the instructions on how to You can even download all user contributed content from gedasymbols. See the instructions on how to
Line 152: Line 154:
 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 [[http://​www.seul.org/​cgi-bin/​mailman/​listinfo/​geda-user|mailinglist geda-user]] 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 [[http://​www.seul.org/​cgi-bin/​mailman/​listinfo/​geda-user|mailinglist geda-user]]
  
-The symbols at [[http://​www.gedasymbols.org | gedasymbols.org]] are even more adapted to the specific preference of their author. ​  ​+The symbols at [[http://​www.gedasymbols.org | 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. 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.
  
Line 198: Line 200:
  
 ===== Is there a symbol wizard in gschem? ===== ===== 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_readme|tragesym]]. It is part of the default installation of geda. A short [[tragesym_tutorial|tutorial]] will get you started with this tool. +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_readme|tragesym]]. It is part of the default installation of geda. A short [[tragesym_tutorial|tutorial]] will get you started with this tool.
  
 One of the major contributors to the project wrote his own symbol creation script: [[http://​www.gedasymbols.org/​user/​dj_delorie/​tools/​djboxsym.html|djboxsym]] One of the major contributors to the project wrote his own symbol creation script: [[http://​www.gedasymbols.org/​user/​dj_delorie/​tools/​djboxsym.html|djboxsym]]
Line 208: Line 210:
  
 ===== Why are symbols so big? ===== ===== 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. +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. +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. [[http://​www.gedasymbols.org/​user/​kai_martin_knaak/​symbols/​titleblock/​title-block.sym|title-block.sym]] by Kai-Martin Knaak). 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. [[http://​www.gedasymbols.org/​user/​kai_martin_knaak/​symbols/​titleblock/​title-block.sym|title-block.sym]] by Kai-Martin Knaak).
  
Line 223: Line 225:
 ===== How do I configure my local gafrc to find my local symbol directory? ===== ===== How do I configure my local gafrc to find my local symbol directory? =====
  
-  -  Create a project directory, for example ${HOME}/​myproj. +  - Create a project directory, for example ${HOME}/​myproj. 
-  -  Place the symbols you want to use into ${HOME}/​myproj/​symbols. +  - Place the symbols you want to use into ${HOME}/​myproj/​symbols. 
-  -  Create a gafrc file in ${HOME}/​myproj. +  - Create a gafrc file in ${HOME}/​myproj. 
-  -  In gafrc, put this line:  <​code>​ (component-library "​./​symbols"​) </​code>​ +  - In gafrc, put this line:  <​code>​ (component-library "​./​symbols"​) </​code>​ 
-  -  Run gschem from your project directory ${HOME}/​myproj. ​ That  is, do this to run gschem:<​code>​cd ${HOME}/​myproj+  - Run gschem from your project directory ${HOME}/​myproj. ​ That  is, do this to run gschem:<​code>​cd ${HOME}/​myproj
 gschem myschematic.sch</​code>​ gschem myschematic.sch</​code>​
  
 Points to remember: Points to remember:
   * The guile stuff which processes your RC file doesn'​t understand or expand shell wildcards like "​~"​ or ${HOME}. ​ It does understand "​."​ as the current working directory, and it does understand absolute file paths. ​ If you want to do something tricky, you can try to  use Scheme functions to get directory information.   * The guile stuff which processes your RC file doesn'​t understand or expand shell wildcards like "​~"​ or ${HOME}. ​ It does understand "​."​ as the current working directory, and it does understand absolute file paths. ​ If you want to do something tricky, you can try to  use Scheme functions to get directory information.
-  * Make sure gafrc lives in your main project directory.  +  * Make sure gafrc lives in your main project directory. 
-  * Run all gEDA programs from your main project directory. ​+  * Run all gEDA programs from your main project directory.
   * Run the programs from the command line in a terminal shell -- don't use any whizzy, shiny desktop icons to run gschem (if you have them) since you won't know what directory gschem is starting in, and gschem might not find gafrc.   * Run the programs from the command line in a terminal shell -- don't use any whizzy, shiny desktop icons to run gschem (if you have them) since you won't know what directory gschem is starting in, and gschem might not find gafrc.
   * The key is: start gschem in the same directory as where your gafrc lives.   * The key is: start gschem in the same directory as where your gafrc lives.
  
-===== Can gafrc use a variable to set the root of my library? ===== +===== How can I set the root of my library? ===== 
-Currently (v1.3.1) gschem does not descend into subdirectories ​of the symbol ​library. You have to give individually each and every directory of your local lib in your gafrc file. However, you don't have to repeat the absolute base path over and over. You can use the function '​build-path'​ to concatenate the path on the fly:+There are two approachesIf you want each of your library ​to have a unique name, you have to set it individually ​for each and every directory of your local lib in your gafrc file. However, you don't have to repeat the absolute base path over and over. You can use the function '​build-path'​ to concatenate the path on the fly:
 <​code>​(define gedasymbols "/​path/​to/​local/​library"​) <​code>​(define gedasymbols "/​path/​to/​local/​library"​)
 (component-library (build-path gedasymbols "​analog"​)) (component-library (build-path gedasymbols "​analog"​))
 (component-library (build-path gedasymbols "​block"​)) (component-library (build-path gedasymbols "​block"​))
 (component-library (build-path gedasymbols "​connector"​))</​code>​ (component-library (build-path gedasymbols "​connector"​))</​code>​
 +
 +If you don't want to list separate subdirectories,​ you can only
 +set the name of a root directory using:
 +<​code>​(component-library-search "/​path/​to/​local/​library"​ "​library:"​)</​code>​
  
 ===== Can the library path contain environment variables? ===== ===== Can the library path contain environment variables? =====
Line 255: Line 261:
 <​code>​(component-library "​${HOME}/​geda/​symbols/​analog"​)</​code>​ <​code>​(component-library "​${HOME}/​geda/​symbols/​analog"​)</​code>​
  
-===== Is there a way to give a library a name that differs from its directory? ​ =====+===== 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.: Add a third argument to the component-library stanza in gafrc, e.g.:
 <​code>​ <​code>​
Line 261: Line 267:
  
 ===== Can my local library cover frequently needed sub circuits? ===== ===== Can my local library cover frequently needed sub circuits? =====
-Yes, symbols can contain symbols and nets. +Yes, symbols can contain symbols and nets.
   - Copy the subcircuit to a fresh sheet. (unlock and remove the default title block as you won't need it)   - Copy the subcircuit to a fresh sheet. (unlock and remove the default title block as you won't need it)
-  - The values of refdes attributes should end with "?",​ to allow to auto number them later. ​+  - The values of refdes attributes should end with "?",​ to allow to auto number them later.
   - Move the sub circuit to the lower left of the available space. (You can use symbol-translate from the edit menu)   - Move the sub circuit to the lower left of the available space. (You can use symbol-translate from the edit menu)
-  - Save the sub circuit as a *.sym file in your local library.  +  - Save the sub circuit as a *.sym file in your local library. 
-  - 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. ​+  - 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? ===== ===== The library window is cluttered with default symbols. Can I restrict to my local lib? =====
Line 276: Line 282:
 (component-library "/​bar/​foo/​localgedalib2"​) (component-library "/​bar/​foo/​localgedalib2"​)
 </​code>​ </​code>​
-You have to add each and every dir of your local library. ​Subdirs are not automatically recognized by gschem and gsch2pcbIts a good idea to place this gafrc in your projects ​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.+You can either ​add directories ​of your local library ​separately or add a whole tree with subdirsSee above on [[#How can I set the root of my library|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? ===== ===== How can I change the default size of floating text? =====
-Put +Put
 <​code>​(text-size 10)</​code>​ <​code>​(text-size 10)</​code>​
 into your gschemrc and replace "​10"​ with your favorite size. into your gschemrc and replace "​10"​ with your favorite size.
Line 329: Line 335:
 Put the following line into your gschemrc file: Put the following line into your gschemrc file:
 <​code>​(define default-titleblock "​title-A3.sym"​)</​code>​ <​code>​(define default-titleblock "​title-A3.sym"​)</​code>​
-Replace "​title-A3.sym"​ with the file name of your favorite title block symbol. ​+Replace "​title-A3.sym"​ with the file name of your favorite title block symbol.
  
 ====== Printing/​Output ====== ====== Printing/​Output ======
Line 416: Line 422:
 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''​**. 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-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. ​+  * 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. 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.
Line 434: Line 440:
 All of these config files may or may not append paths to the library search list. If a config file contains the command All of these config files may or may not append paths to the library search list. If a config file contains the command
 <​code>​(reset-component-library)</​code>​ <​code>​(reset-component-library)</​code>​
-the library search path will be emptied. Order is obviously important, as this command will erase any previously appended paths. ​ +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"​.'​ ===== ===== I'm using gschem/gaf through a SSH connection and I get an error like: 'Xlib: extension "​RENDER"​ missing on display "​localhost:​10.0"​.'​ =====
geda/faq-gschem.txt · Last modified: 2015/07/06 16:53 by vzh