scheme-api: Remove redundant checks in edascm_to_object_glist().
[geda-gaf/peter-b.git] / utils / docs / README.gsch2pcb
blob98c775b4353c352cd64250f6ce6bdc8b9efe8a5b
1 gsch2pcb
2 --------
3 gsch2pcb is a program that interfaces a set of schematics generated with
4 with the gEDA gschem to PCB layout files.
6 gsch2pcb is conceptually similar to the gschem2pcb shell script, but
7 additionally handles multiple schematics, handles file element footprints,
8 and removes pc board elements corresponding to components deleted from the
9 schematics.  It also forward annotates component value changes.
11 Using gsch2pcb allows you to drive all design changes from the gschem
12 schematics without the headache of manually keeping PCB elements and
13 element values in sync.
15 It requires that the gnet-gsch2pcb.scm file be install into the gEDA
16 scheme directory.  On Debian this is /usr/share/gEDA/scheme, but see
17 the INSTALL file.
19 Typical usage
20 -------------
21 1) Create your custom PCB elements and save each one into its own file.
22    Some compatibility tips if you will be inserting elements into a
23    layout manually as well as with gsch2pcb:
24      *  Make the initial "Description" field of these elements the same
25         as the file name because gsch2pcb depends on this name (which is
26         the gschem footprint
27         value) to know when footprints/elements are changed.
28      *  Make the initial layout-name field (displayed when the "name on PCB"
29         menu entry is selected) empty (ie "") so that gsch2pcb
30         will not delete your element when you want it to be in the layout
31         even though it is not in the schematic.  You can later edit the
32         layout-name to be some refdes value, but I'm not sure it makes sense
33         to name a PCB element that is not referenced in the schematic.
35    Note: since once a layout element is named PCB won't let you reset it
36    to an empty name, a sort of kludge is that setting the first character
37    of the layout-name to a non-alphanumeric will protect the element from
38    being deleted by gsch2pcb.
40    These file elements should be placed in a directory heirarchy that
41    gsch2pcb will search.  The default directories /usr/local/pcb_lib and
42    ./packages are searched in addition to any directories you specify with
43    --elements-dir dirname arguments to gsch2pcb.
45 2) Create your schematic with gschem.  Make sure each component has a
46    unique refdes attribute and a footprint attribute that matches either
47    a PCB m4 element or one of your custom file element names.  Beware of
48    file element names that collide with PCB m4 macro names (or specify the
49    use-files option).
50    Make a project file if you wish.
52 3) Run "gsch2pcb foo.sch" or "gsch2pcb myproject" if you've created the
53    myproject file.  If you didn't specify an output name, this will generate
54    a foo.pcb and a foo.net file.
55    If you get errors about footprints not found, you need to create PCB
56    elements for them and repeat this step until you get no errors.
57    Or, just run gsch2pcb again and it will shift unfound elements to
58    foo.new.pcb and you can proceed using PCB on foo.pcb if you wish to
59    fix the errors from inside of PCB.
61 4) Run "pcb foo.pcb".  All the elements will be stacked on top of each other,
62    so move them to desired locations.  Load the netlist file foo.net and
63    proceed with using PCB.  
65 5) Modify foo.sch and again run "gsch2pcb foo.sch".
66    * If components were added, PCB elements for them will be placed in the
67      file foo.new.pcb.  If components were deleted, the elements for them
68      will be removed from foo.pcb and the original foo.pcb will be renamed
69      to a foo.pcb.bak sequence.
70    * If elements can't be found for new schematic footprints, then the
71      unfound elements will be indicated with PKG_ lines in foo.new.pcb
72      unless you run "gsch2pcb --remove-unfound foo.sch" which will omit
73      the PKG_ lines so you can go ahead and load foo.new.pcb into PCB.
74    * Note that If you have added elements to the .pcb layout which
75      will not exist on the schematics (mounting holes, etc), make sure
76       there is no "name on PCB" (the gschem refdes) for them or else gsch2pcb
77      will delete them when they don't match a schematic refdes and footprint.
78      You could use the --preserve option to prevent deleting any elements at
79      all, but this is really not the best way to use gsch2pcb.
81 6) Run "pcb foo.pcb" and clean up any dangling traces left over from removed
82    elements.  Load any new elements in foo.new.pcb with the "Load layout
83    data to paste-buffer" function.  Load the new netlist foo.net.
86 Caveats
87 -------
88 * gsch2pcb uses a gnetlist backend gnet-gsch2pcb.scm, so be sure when you
89   install gsch2pcb that the gnet-gsch2pcb.scm file gets installed into the
90   right place.  Look at the INSTALL file in the tarball.
92 * WARNING:  if you wish to start processing with gsch2pcb any existing PCB
93   files that have m4 elements and were originally generated with gschem2pcb,
94   then be sure to run first with at least gsch2pcb 0.4:
96      gsch2pcb --fix-elements
98   on the PCB file schematics or else gsch2pcb will want to delete the
99   m4 elements.
101 * footprint information is saved into PCB element's Description fields,
102   so it's probably not a good idea to change element Description values
103   in your layout while using gsch2pcb unless it is a protected element
104   that has an empty layout-name.
108 Bill Wilson    billw@wt.net