File Formats in gEDA

This file is the official documentation for the file formats in gEDA. The primary file format used in gEDA is the schematic/symbol format. Files which end with .sch or .sym are schematics or symbol files. This file format is current as of gEDA version 20001006.

  1. Schematic/Symbol File Format
    1. Basic Info
    2. All coords are in mils (1/1000 or an inch).
      Origin is in lower left hand corner.
      Files should end in either .sch or .sym

    3. Coordinate system
    4.    ^
       ^ |
       | |
       y |
         +-------->
       0,0  x->
      
      Origin in the lower left hand corner. X increases going to the right. Y increase going up. Coordinate system is landscape and corresponds to a sheet of paper turned on its side.

    5. Object types
    6. The object type letter must start in the first column. Schematic/Symbol files are case sensitive.


      Version number

      type versionnumber

      Example:
      v 19990327

        type = v
        versionnumber = version of gEDA which created this file

        This flag must be in EVERY file used by the gEDA tools. The version number is not a timestamp.


      Components

      type x y selectable angle mirror basename

      Example:
      C 18600 19900 1 0 0 7400-1.sym

        type = C
        x y = location of lower left corner point
        selectable = 1 if selectable or 0 if not
        angle = rotation, 0, 90, 180, 270 (only)
        mirror = 0 if not mirrored or 1 if mirrored
        basename = component name, does not include any path!


      Text

      type x y color size visibility show_name_value angle alignment
      string

      Example:
      T 16900 35800 3 10 1 0 0 0
      I'm a string!


      Net
      Pin
      Bus

      type x1 y1 x2 y2 color

      Examples:
      N 12700 29400 32900 29400 4
      P 17800 33100 22300 33100 1
      U 27300 37400 37200 35300 3

        type = N P U (net pin bus respectively)
        x1 y1 = first point
        x2 y2 = second point
        color = see include/colors.h


      Line

      type x1 y1 x2 y2 color width end type length space

      Example:
      L 23000 69000 28000 69000 3 40 0 1 -1 75

        type = N P U (net pin bus respectively)
        x1 y1 = first point
        x2 y2 = second point
        color = see include/colors.h
        width = width of line in mils
        end = line cap style
          END_NONE = 0, END_SQUARE = 1, END_ROUND = 2
        type = line type
          TYPE_SOLID = 0, TYPE_DOTTED = 1, TYPE_DASHED = 2, TYPE_CENTER = 3
          TYPE_PHANTOM = 4
        length = length of dashes in mils (not used for TYPE_SOLID and TYPE_DOTTED)
        space = space inbetween dashes in mils (not used for TYPE_SOLID)


      Arc

      type x y radius start_angle sweep_angle color width end type length space

      Example:
      30600 75000 2000 0 45 3 0 0 3 75 50

        type = A
        x y = center of arc
        radius = radius of arc
        start_angle = starting angle in degrees / Standard cartesian layout
        sweep_angle = degrees to sweep arc
        color = see include/colors.h
        width = width of line in mils
        end = line cap style
          END_NONE = 0, END_SQUARE = 1, END_ROUND = 2
        type = line type
          TYPE_SOLID = 0, TYPE_DOTTED = 1, TYPE_DASHED = 2, TYPE_CENTER = 3
          TYPE_PHANTOM = 4
        length = length of dashes in mils (not used for TYPE_SOLID and TYPE_DOTTED)
        space = space inbetween dashes in mils (not used for TYPE_SOLID)


      Box

      type x y width height color width end type length space filling fillwidth angle1 pitch1 angle2 pitch2

      Example:
      B 33000 67300 2000 2000 3 60 0 2 75 50 0 -1 -1 -1 -1 -1

        type = B
        x y = lower left hand corner
        width height = width and height of the box
        color = see include/colors.h
        width = width of line in mils
        end = line cap style
          END_NONE = 0, END_SQUARE = 1, END_ROUND = 2
        type = line type
          TYPE_SOLID = 0, TYPE_DOTTED = 1, TYPE_DASHED = 2, TYPE_CENTER = 3
          TYPE_PHANTOM = 4
        length = length of dashes in mils (not used for TYPE_SOLID and TYPE_DOTTED)
        space = space inbetween dashes in mils (not used for TYPE_SOLID)
        filling = unused currently should be 0
        fillewidth = unused currently should be -1
        angle1 = unused currently should be -1
        pitch1 = unused currently should be -1
        angle2 = unused currently should be -1
        pitch2 = unused currently should be -1


      Circle

      Example:
      V 38000 67000 900 3 0 0 2 75 50 0 -1 -1 -1 -1 -1

      type x y width height color width end type length space filling fillwidth angle1 pitch1 angle2 pitch2

        type = V
        x y = center of circle
        radius = radius of the circle
        color = see include/colors.h
        width = width of line in mils
        end = line cap style
          END_NONE = 0, END_SQUARE = 1, END_ROUND = 2
        type = line type
          TYPE_SOLID = 0, TYPE_DOTTED = 1, TYPE_DASHED = 2, TYPE_CENTER = 3
          TYPE_PHANTOM = 4
        length = length of dashes in mils (not used for TYPE_SOLID and TYPE_DOTTED)
        space = space inbetween dashes in mils (not used for TYPE_SOLID)
        filling = unused currently should be 0
        fillewidth = unused currently should be -1
        angle1 = unused currently should be -1
        pitch1 = unused currently should be -1
        angle2 = unused currently should be -1
        pitch2 = unused currently should be -1


      Special font definition object

      Example:
      F A 29

      type character width [optional_flag]

        type = F
        character = the character being defined
        width = the width of the character in mils
        optional_flag = is only used in space char definition

        This is a special tag and should ONLY show up in font definition files. The space character is special and is defined as follows:

        F _ 11 1

        The last one signifies that this definition is the space character.

    7. Attributes
    8. Attributes are enclosed in { } and can only be text. Attributes are text items which take on the form name=value. If it doesn't have name=value it's not an attribute. Attributes are attached to the previous object. Here's an example:

      P 988 500 1300 500 1
      {
      T 1000 550 5 8 1 1 0
      pin3=3
      }

      The object is a pin which has an attribute pin3=3 (name=value). You can have multiple text objects (both the T ... and text string are required) in between the { }

      You can also have "toplevel" attributes. These attributes are not attached to any object, but instead are just text objects that take on the form name=value. These attributes are useful when you need to convey some info about a schematic page and need the netlister to have access to this info.

    9. Embedded objects
    10. Embedded objects take on the following form:

      C 18600 21500 1 0 0 EMBEDDED555-1.sym
      [
      ...
      ... Embedded primitive objects
      ...
      ]

      Where the basename is EMBEDDEDcomponent_name.sym In the example above 555-1.sym is the basename. The EMBEDDED tag and the [ ] are the distinguishing characteristics of embedded components. component_name.sym must exist in one of the specified component-libraries if you want to unembed a component.

    11. Extra info
    12. Currently, nets and other components should NOT be inside components.

      gschem and friends do not like bad schematic/symbol files. A lot of work has gone into making gschem and friends read invalid files, but there are some cases were gschem may exit abruptly (core dump).

Up one level