Subversion Repositories Vertical

Rev

Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 mjames 1
/*
2
 * $Header: /cygwin/cvsroot/vertical/frb_main.c,v 1.10 2002/09/09 10:36:19 mjames Exp $
3
 *
4
 * $Log: frb_main.c,v $
5
 * Revision 1.10  2002/09/09 10:36:19  mjames
6
 * Checkpoint checkin
7
 *
8
 * Revision 1.9  2002/08/14 12:11:31  mjames
9
 * Added an 'external' tag to the documentation
10
 *
11
 * Revision 1.9  2002/04/04 14:53:06  mjames
12
 * Added mentor board station reader to the portfolio
13
 *
14
 * Revision 1.8  2001/10/31 22:20:05  mjames
15
 * Tidying up problematical comments caused by CVS
16
 * 'intelligent' comment guessing
17
 *
18
 * Revision 1.7  2001/10/22 11:00:15  mjames
19
 * Modified list_devices to take an options flag
20
 *
21
 * Revision 1.6  2001/10/02 20:53:47  mjames
22
 * Moved documentation about code to main program module.
23
 *
24
 * Revision 1.5  2001/09/28 14:34:12  mjames
25
 * FIxed yydebug variable to exist when YYDEBUG macro
26
 * is not defined. Otherwise linker error will be reported.
27
 *
28
 * Revision 1.4  2001/07/09 15:47:35  mjames
29
 * Placed the version string in an independent file to save time on building
30
 * all of the variants of Vertical
31
 *
32
 * Revision 1.3  2001/06/06 12:10:22  mjames
33
 * Move from HPUX
34
 *
35
 * Revision 1.2  2000/12/04 13:14:02  mjames
36
 * Imported all of the PCB syntax readers.
37
 *
38
 * Converted "a/b" to mean "a" divided by "b" insted of a single string
39
 * "a/b" in Verilog
40
 *
41
 * Revision 1.1.1.1  2000/10/19 21:58:38  mjames
42
 * Mike put it here
43
 *
44
 *
45
 * Revision 1.36  2000/10/04  10:37:05  10:37:05  mjames (Mike James)
46
 * Modified for Vertical2 : support COMPONENTS and SIGNALS
47
 *
48
 * Revision 1.36  2000/10/04  10:37:05  10:37:05  mjames (Mike James)
49
 * Part of Release PSAVAT01
50
 *
51
 * Revision 1.35  2000/10/02  11:04:13  11:04:13  mjames (Mike James)
52
 * new_vhdl
53
 *
54
 
55
 * Revision 1.34  2000/09/27  14:42:13  14:42:13  mjames (Mike James)
56
 
57
 * Part of Release Sep_27_ST_2000
58
 
59
 *
60
 
61
 * Revision 1.33  2000/09/27  10:45:08  10:45:08  mjames (Mike James)
62
 
63
 * Corrected to use correct return code from yyparse()
64
 
65
 *
66
 
67
 * Revision 1.32  2000/09/21  10:15:43  10:15:43  mjames (Mike James)
68
 
69
 * Part of Release Sep21Alpha
70
 
71
 *
72
 
73
 * Revision 1.31  2000/08/25  09:57:11  09:57:11  mjames (Mike James)
74
 
75
 * Part of Release Aug25_alpha
76
 
77
 *
78
 
79
 * Revision 1.30  2000/08/16  08:57:27  08:57:27  mjames (Mike James)
80
 
81
 * Part of Release CD01_Aug2000
82
 
83
 *
84
 
85
 * Revision 1.29  2000/08/14  14:45:09  14:45:09  mjames (Mike James)
86
 
87
 * Part of Release Aug_14_2000
88
 
89
 *
90
 
91
 * Revision 1.28  2000/08/11  08:30:29  08:30:29  mjames (Mike James)
92
 
93
 * Part of Release Aug_11_2000
94
 
95
 *
96
 
97
 * Revision 1.27  2000/08/09  10:31:43  10:31:43  mjames (Mike James)
98
 
99
 * Part of Release Aug__9_2000
100
 
101
 *
102
 
103
 * Revision 1.26  2000/05/31  11:42:52  11:42:52  mjames (Mike James)
104
 
105
 * Part of Release May_31_2000
106
 
107
 *
108
 
109
 * Revision 1.25  2000/05/31  11:30:11  11:30:11  mjames (Mike James)
110
 
111
 * Added acfread.ini file reading
112
 
113
 *
114
 
115
 * Revision 1.24  2000/05/08  17:01:35  17:01:35  mjames (Mike James)
116
 
117
 * Part of Release May__8_2000
118
 
119
 *
120
 
121
 * Revision 1.23  2000/05/08  16:59:28  16:59:28  mjames (Mike James)
122
 
123
 * Part of Release May__8_2000
124
 
125
 *
126
 
127
 * Revision 1.22  2000/05/08  16:57:04  16:57:04  mjames (Mike James)
128
 
129
 * Part of Release May__8_2000
130
 
131
 *
132
 
133
 * Revision 1.21  2000/03/08  16:19:02  16:19:02  mjames (Mike James)
134
 
135
 * New version including PC
136
 
137
 *
138
 
139
 * Revision 1.18  2000/01/20  15:58:44  15:58:44  mjames (Mike James)
140
 
141
 * Part of Release R22
142
 
143
 *
144
 
145
 * Revision 1.17  99/12/22  11:15:24  11:15:24  mjames (Mike James)
146
 
147
 * Part of Release Dec_22_1999
148
 
149
 *
150
 
151
 * Revision 1.16  99/06/25  14:35:32  14:35:32  mjames (Mike James)
152
 
153
 * Added in reference to expression.h, but no changes made
154
 
155
 * to the function of acfread yet.
156
 
157
 *
158
 
159
 * Revision 1.15  99/05/04  09:51:08  09:51:08  mjames (Mike James)
160
 
161
 * General checkin
162
 
163
 *
164
 
165
 * Revision 1.13  98/02/11  11:26:01  11:26:01  mjames (Mike James)
166
 
167
 * Checked in for version 6.2a
168
 
169
 *
170
 
171
 * Revision 1.12  97/04/23  08:42:53  08:42:53  mjames (Mike James)
172
 
173
 * CHecked in for release rel23041997
174
 
175
 *
176
 
177
 * Revision 1.11  97/01/03  13:33:14  13:33:14  mjames (Mike James)
178
 
179
 * Changed the order of printing the banner on startup so that it is before all
180
 
181
 * other output from the tool.
182
 
183
 *
184
 
185
 * Revision 1.10  96/08/06  13:35:32  13:35:32  mjames (Mike James)
186
 
187
 * Changed date of compile
188
 
189
 *
190
 
191
 * Revision 1.9  96/07/19  14:36:33  14:36:33  mjames (Mike James)
192
 
193
 * Amended major revision
194
 
195
 *
196
 
197
 * Revision 1.8  1996/07/12  15:52:12  mjames
198
 
199
 * Sorted out things like Alias and Jumpers
200
 
201
 * Work Correctly
202
 
203
 * Print COrrectly
204
 
205
 *
206
 
207
 * Revision 1.7  96/03/29  14:46:09  14:46:09  mjames (Mike James)
208
 
209
 * Added VHDL netlist writing to the capabilities of ACFREAD
210
 
211
 *
212
 
213
 * Revision 1.6  96/03/18  13:50:34  13:50:34  mjames (Mike James)
214
 
215
 * Real Revision 2.1
216
 
217
 *
218
 
219
 * Revision 1.3  96/02/13  09:13:04  09:13:04  mjames (Mike James)
220
 
221
 * Updated to be version 2.0 with net joining
222
 
223
 *
224
 
225
 * Revision 1.2  96/02/07  16:01:19  16:01:19  mjames (Mike James)
226
 
227
 * Added correct RCS header
228
 
229
 *
230
 
231
 * Revision 1.1  96/02/07  15:49:03  15:49:03  mjames (Mike James)
232
 
233
 * Initial revision
234
 
235
 *
236
 
237
 * Revision 1.5  96/02/07  11:04:14  11:04:14  mjames (Mike James)
238
 
239
 * Checkin before adding new command parsing to program
240
 
241
 *
242
 
243
 * Revision 1.4  96/01/10  13:12:59  13:12:59  mjames (Mike James)
244
 
245
 * Works in debug mode with EPLD listings and PCB layout
246
 
247
 *
248
 
249
 * Revision 1.3  96/01/08  15:23:13  15:23:13  mjames (Mike James)
250
 
251
 * Managing to make sense of things now
252
 
253
 *
254
 
255
 * Revision 1.2  96/01/07  20:23:01  Mike_James
256
 
257
 *
258
 
259
 * Revision 1.1  96/01/07  12:38:41  Mike_James
260
 
261
 * Initial revision
262
 
263
 *
264
 
265
 * Revision 1.2  96/01/04  17:54:41  17:54:41  mjames (Mike James)
266
 
267
 * Altered to conditionally debug
268
 
269
 *
270
 
271
 * Revision 1.1  96/01/04  10:17:57  10:17:57  mjames (Mike James)
272
 
273
 * Initial revision
274
 
275
 *
276
 
277
*/
278
/*
279
@title
280
PROGRAM frbread: Converter for .FRB files
281
@application external
282
@text
283
PCB netlist to ACFP converter. Looks for netlists in ASCII containing tags like:
284
@listing
285
.HEA
286
.END
287
.TIM
288
.UNI
289
.JOB
290
.TYP
291
.APP
292
.ADD_COM
293
.ADD_TER
294
.ATT_COM
295
.ATT_TRE
296
.TER
297
@text
298
Commonly seen with a '.FRB' file suffix or '.CDI' file suffix.
299
More common Racal-Zuken CadStar
300
file format.
301
One of several file formats the Southampton
302
Drawing office is likely to hand out. See also PROGRAM repread and PROGRAM rep2read.
303
 
304
@break
305
Invocation
306
@listing
307
frbread <frb_file> [d]
308
@text
309
The frb file name is the first argument, the third argument is a debug flag.
310
If a lower
311
case 'd' is present, the Bison parser (interpreter of keywords and syntax) prints extremely
312
verbose diagnostics.
313
@break
314
Normally the acfp file produced on standard output is redirected to a file e.g.
315
@listing
316
frbread file.frb > file.acfp
317
@text
318
Will produce file.acfp from file.frb.
319
@break
320
Following this it is necessary to run the output through Vertical again in order to
321
set up properties on nets (power and ground being made not routable for instance) using the
322
del routable command. Alternatively the acfp file can be edited to set the net routing flags
323
for these nets.
324
@end
325
*/
326
 
327
#include "cmdlog.h"
328
#include "cmdparse.h"
329
#include "database.h"
330
#include "expression.h"
331
#include "generic.h"
332
#include "printout.h"
333
#include "routing.h"
334
 
335
#include <stdio.h>
336
#include <stdlib.h>
337
#include <string.h>
338
 
339
#ident                                                                                        \
340
    "@(#)$Header: /cygwin/cvsroot/vertical/frb_main.c,v 1.10 2002/09/09 10:36:19 mjames Exp $";
341
 
342
#if defined YYDEBUG
343
extern int yydebug;
344
#else
345
int yydebug = 0;
346
#endif
347
 
348
extern FILE *yyin;
349
 
350
int main (int argc, char *argv[])
351
 
352
{
353
        InitialiseData ();
354
        ExecuteString (
355
            "echo running \\$(VERTICAL_INIT) file name = $(VERTICAL_INIT) ",
356
            argc - 1,
357
            (argv + 1));
358
        ExecuteString ("do $(VERTICAL_INIT) ", argc - 2, (argv + 2));
359
        Log (LOG_GENERAL, "# Finished initialisation script\n");
360
        print_header (stdout, "'frbread': From Drawing Office file");
361
        yydebug = 0;
362
        if (argc > 2 && argv[2][0] == 'd')
363
                yydebug = 1;
364
        if (argc > 1)
365
                yyin = fopen (argv[1], "r");
366
        else
367
                yyin = stdin;
368
        if (!yyin)
369
                printf ("cannot open input file (%s)\n", argv[1]);
370
        else
371
                while (yyparse () == 0)
372
                        ;
373
        perform_routing (Free);
374
 
375
        list_database (stdout, 0); /* no jumpers 0= do not flatten them */
376
        list_devices (
377
            stdout,
378
            PRINT_TYPE | PRINT_EXPAND_BUS | PRINT_GENERIC | PRINT_GROUP | PRINT_ROUTE_FLAGS |
379
                PRINT_EQUIVALENT_PINS);
380
}