File: fileformats.html

package info (click to toggle)
geda-doc 20020209-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 112 kB
  • ctags: 12
  • sloc: makefile: 27
file content (381 lines) | stat: -rw-r--r-- 9,087 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
<HTML>
<HEAD> <TITLE> gEDA File Formats </TITLE> </HEAD>
<BODY>


<font face="arial,helvetica"> 


<CENTER>   
<H1>
File Formats in gEDA
</H1>
</CENTER>

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

<OL TYPE="I">
<H3>
<LI> Schematic/Symbol File Format </LI>
</H3>
<p>


<OL TYPE="A">
<H4> <LI> Basic Info </LI> </H4>
<p>

All coords are in mils (1/1000 or an inch).   <br>
Origin is in lower left hand corner.<br>
Files should end in either .sch or .sym
<p>

<H4> <LI> Coordinate system </LI> </H4>
<p>

</font>
<pre>
   ^
 ^ |
 | |
 y |
   +-------->
 0,0  x->
</pre>
<font face="arial,helvetica"> 

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

<H4> <LI> Object types </LI> </H4>
<p>

The object type letter <strong>must</strong> start in the first
column.  Schematic/Symbol files are case sensitive. <p>

<hr>
<strong> Version number </strong> <p>

type versionnumber <p>

Example:<br>
v 19990327<p>

<UL>
	type = v<br>
	versionnumber = version of gEDA which created this file<p>

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

</UL>
<p>

<hr>
<strong> Components </strong> <p>

type x y selectable angle mirror basename <p>

Example:<br>
C 18600 19900 1 0 0 7400-1.sym<p>

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

<hr>
<strong> Text </strong> <p>

type x y color size visibility show_name_value angle alignment<br>
string<p>

Example:<br>
T 16900 35800 3 10 1 0 0 0<br>
I'm a string!<p>

<UL>
        type = T<br>
        x y = same as above<br>
        color = see include/colors.h<br>
	size = height in points of the text<br>
        visibility = 0 if invisible or 1 if visible<br>
        show_name_value = show both name and value 0<br>
<UL>
                          show value only 1<br>
                          show name only 2<br>
</UL>
        angle = rotation, 0, 90, 180, 270 (only)<br>
	alignment = the relative location which the (x,y) coords specify using
	the following diagram as a guide:
</font>
<UL>
<pre>
	2 -- 5 -- 8
	|    |    |
	1 -- 4 -- 7
	|    |    |
	0 -- 3 -- 6
</pre>
</UL>
<font face="arial,helvetica"> 
        string = text string<br>
</UL>
<p>

<hr>
<strong>
Net<br>
Pin<br>
Bus<p>
</strong>

type x1 y1 x2 y2 color<p>

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

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

<hr>
<strong> Line </strong><p>

type x1 y1 x2 y2 color width end type length space<p>

Example:<br> 
L 23000 69000 28000 69000 3 40 0 1 -1 75<p>

<UL>
        type = N P U (net pin bus respectively)<br>
        x1 y1 = first point<br>
        x2 y2 = second point<br>
        color = see include/colors.h<br>
	width = width of line in mils<br>
	end = line cap style 
<UL>
		END_NONE = 0, END_SQUARE = 1, END_ROUND = 2
</UL>

	type = line type 
<UL>
        TYPE_SOLID = 0, TYPE_DOTTED = 1, TYPE_DASHED = 2, TYPE_CENTER = 3<br>
	TYPE_PHANTOM = 4<br>
</UL>
	length = length of dashes in mils (not used for TYPE_SOLID and TYPE_DOTTED)<br>
	space = space inbetween dashes in mils (not used for TYPE_SOLID)<br>
	
</UL>
<p>
<hr>

<strong> Arc </strong><p>

type x y radius start_angle sweep_angle color width end type length space<p>

Example:<br>
30600 75000 2000 0 45 3 0 0 3 75 50<p>

<UL>
        type = A<br>
        x y = center of arc<br>
        radius = radius of arc<br>
        start_angle = starting angle in degrees / Standard cartesian layout<br>
        sweep_angle = degrees to sweep arc<br>
        color = see include/colors.h<br>
	width = width of line in mils<br>
	end = line cap style<br> 
<UL>
		END_NONE = 0, END_SQUARE = 1, END_ROUND = 2
</UL>

	type = line type<br> 
<UL>
        TYPE_SOLID = 0, TYPE_DOTTED = 1, TYPE_DASHED = 2, TYPE_CENTER = 3<br>
	TYPE_PHANTOM = 4<br>
</UL>
	length = length of dashes in mils (not used for TYPE_SOLID and TYPE_DOTTED)<br>
	space = space inbetween dashes in mils (not used for TYPE_SOLID)<br>
</UL>
<p>

<hr>
<strong> Box </strong><p>

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

Example:<br>
B 33000 67300 2000 2000 3 60 0 2 75 50 0 -1 -1 -1 -1 -1<p>

<p>

<UL>
        type = B<br>
        x y = lower left hand corner<br>
        width height = width and height of the box<br>
        color = see include/colors.h<br>
	width = width of line in mils<br>
	end = line cap style<br> 
<UL>
		END_NONE = 0, END_SQUARE = 1, END_ROUND = 2
</UL>

	type = line type<br> 
<UL>
        TYPE_SOLID = 0, TYPE_DOTTED = 1, TYPE_DASHED = 2, TYPE_CENTER = 3<br>
	TYPE_PHANTOM = 4<br>
</UL>
	length = length of dashes in mils (not used for TYPE_SOLID and TYPE_DOTTED)<br>
	space = space inbetween dashes in mils (not used for TYPE_SOLID)<br>
	filling = unused currently should be 0<br> 
	fillewidth = unused currently should be -1<br>	
	angle1 = unused currently should be -1<br>	
	pitch1 = unused currently should be -1<br>	
	angle2 = unused currently should be -1<br>	
	pitch2 = unused currently should be -1<br>
</UL>
<p>

<hr>
<strong> Circle </strong><p>

Example:<br>
V 38000 67000 900 3 0 0 2 75 50 0 -1 -1 -1 -1 -1<p>

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

<UL>
        type = V<br>
        x y = center of circle<br>
        radius = radius of the circle<br>
        color = see include/colors.h<br>
	width = width of line in mils<br>
	end = line cap style<br>
<UL>
		END_NONE = 0, END_SQUARE = 1, END_ROUND = 2
</UL>

	type = line type<br> 
<UL>
        TYPE_SOLID = 0, TYPE_DOTTED = 1, TYPE_DASHED = 2, TYPE_CENTER = 3<br>
	TYPE_PHANTOM = 4<br>
</UL>
	length = length of dashes in mils (not used for TYPE_SOLID and TYPE_DOTTED)<br>
	space = space inbetween dashes in mils (not used for TYPE_SOLID)<br>
	filling = unused currently should be 0<br> 
	fillewidth = unused currently should be -1<br>	
	angle1 = unused currently should be -1<br>	
	pitch1 = unused currently should be -1<br>	
	angle2 = unused currently should be -1<br>	
	pitch2 = unused currently should be -1<br>	
</UL>
<p>

<hr>
<strong>Special font definition object</strong><p>

Example:<br>
F A 29<p>

type character width [optional_flag]<p>

<UL>
	type = F<br>
	character = the character being defined<br>
	width = the width of the character in mils<br>
	optional_flag = is only used in space char definition<p>

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

	F _ 11 1<p>


	The last one signifies that this definition is the space character.<p>
	
</UL>

<H4> <LI> Attributes </LI> </H4>
<p>

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>

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

        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 { } <p>

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


<H4> <LI> Embedded objects </LI> </H4>
<p>

	Embedded objects take on the following form:<p>

C 18600 21500 1 0 0 EMBEDDED555-1.sym<br>
[<br>
...<br>
... Embedded primitive objects<br>
...<br>
]<p>

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


<H4> <LI> Extra info </LI> </H4>
<p>

Currently, nets and other components should NOT be inside components.<p>

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



</OL>
</OL>
<p> 

<H3>
<A HREF="./index.html">Up one level</A>
</H3>  
</font>

</BODY>
</HTML>