Rev 2 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2 | Rev 11 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | /* pads_main*/ |
1 | /* pads_main*/ |
2 | /* $Id: eagle_main.c,v 1.1.1.1 2003/11/04 23:34:56 mjames Exp $ |
2 | /* $Id: eagle_main.c,v 1.1.1.1 2003/11/04 23:34:56 mjames Exp $ |
3 | * |
3 | * |
4 | * $Log: eagle_main.c,v $ |
4 | * $Log: eagle_main.c,v $ |
5 | * Revision 1.1.1.1 2003/11/04 23:34:56 mjames |
5 | * Revision 1.1.1.1 2003/11/04 23:34:56 mjames |
6 | * Imported into local repositrory |
6 | * Imported into local repositrory |
7 | * |
7 | * |
8 | * Revision 1.1 2002/12/04 22:28:28 mjames |
8 | * Revision 1.1 2002/12/04 22:28:28 mjames |
9 | * Initial release Eagle PCB reader |
9 | * Initial release Eagle PCB reader |
10 | * |
10 | * |
11 | */ |
11 | */ |
12 | /* |
12 | /* |
13 | @title |
13 | @title |
14 | PROGRAM eagle_read: Converter for Eagle .net files |
14 | PROGRAM eagle_read: Converter for Eagle .net files |
15 | @application external |
15 | @application external |
16 | @text |
16 | @text |
17 | PCB netlist to ACFP converter. Looks for netlists in ASCII containing tags like: |
17 | PCB netlist to ACFP converter. Looks for netlists in ASCII containing tags like: |
18 | @listing |
18 | @listing |
19 | Netlist |
19 | Netlist |
20 | 20 | ||
21 | Exported from H02SM05.brd at 11-10-2002 12:15:48 |
21 | Exported from H02SM05.brd at 11-10-2002 12:15:48 |
22 | 22 | ||
23 | EAGLE Version 4.09r1 Copyright (c) 1988-2002 CadSoft |
23 | EAGLE Version 4.09r1 Copyright (c) 1988-2002 CadSoft |
24 | 24 | ||
25 | Net Part Pad |
25 | Net Part Pad |
26 | 26 | ||
27 | @text |
27 | @text |
28 | Commonly seen with a '.net' file suffix. This file is from Eagle PCB. |
28 | Commonly seen with a '.net' file suffix. This file is from Eagle PCB. |
29 | @text |
29 | @text |
30 | Usage |
30 | Usage |
31 | @listing |
31 | @listing |
32 | eagle_read <eagle_file> [ d ] |
32 | eagle_read <eagle_file> [ d ] |
33 | @text |
33 | @text |
34 | If a lower |
34 | If a lower |
35 | case 'd' is present as the second argument, the Bison parser |
35 | case 'd' is present as the second argument, the Bison parser |
36 | (interpreter of keywords and syntax) prints extremely verbose diagnostics. |
36 | (interpreter of keywords and syntax) prints extremely verbose diagnostics. |
37 | @break |
37 | @break |
38 | Normally the acfp file produced on standard output is redirected to a file e.g. |
38 | Normally the acfp file produced on standard output is redirected to a file e.g. |
39 | @listing |
39 | @listing |
40 | eagle_read file.net > file.acfp |
40 | eagle_read file.net > file.acfp |
41 | @text |
41 | @text |
42 | Will produce file.acfp from file.net. |
42 | Will produce file.acfp from file.net. |
43 | @break |
43 | @break |
44 | Following this it is necessary to run the output through Vertical again in order to |
44 | Following this it is necessary to run the output through Vertical again in order to |
45 | set up properties on nets (power and ground being made not routable for instance) using the |
45 | set up properties on nets (power and ground being made not routable for instance) using the |
46 | del routable command. Alternatively the acfp file can be edited to set the net routing |
46 | del routable command. Alternatively the acfp file can be edited to set the net routing |
47 | flags for these nets. |
47 | flags for these nets. |
48 | @end |
48 | @end |
49 | */ |
49 | */ |
50 | 50 | ||
51 | #include <stdio.h> |
51 | #include <stdio.h> |
52 | #include <stdlib.h> |
- | |
- | 52 | ||
53 | #include <string.h> |
53 | #include <string.h> |
- | 54 | ||
- | 55 | #include <stdlib.h> |
|
54 | #if defined HAS_TCL |
56 | #if defined HAS_TCL |
55 | #include "tcl_l.h" |
57 | #include "tcl_l.h" |
56 | #endif |
58 | #endif |
57 | #include "cmdlog.h" |
- | |
58 | #include "cmdparse.h" |
- | |
59 | #include "database.h" |
- | |
60 | #include "expression.h" |
59 | #include "expression.h" |
61 | #include "generic.h" |
60 | #include "generic.h" |
- | 61 | #include "database.h" |
|
62 | #include "printout.h" |
62 | #include "printout.h" |
63 | #include "routing.h" |
63 | #include "routing.h" |
- | 64 | #include "cmdparse.h" |
|
- | 65 | #include "cmdlog.h" |
|
- | 66 | #include "yacc_common.h" |
|
- | 67 | ||
- | 68 | #ident "@(#)$Header: c:\\cygwin\\cvsroot/Vert03/eagle_src/eagle_main.c,v 1.1.1.1 2003/11/04 23:34:56 mjames Exp $" |
|
- | 69 | ||
- | 70 | ||
- | 71 | int main(int argc , char * argv[]) |
|
- | 72 | { |
|
- | 73 | InitialiseData(); |
|
- | 74 | ExecuteString("echo running \\$(VERTICAL_INIT) file name = $(VERTICAL_INIT) ", argc-1, (argv+1)); |
|
- | 75 | ExecuteString("do $(VERTICAL_INIT) ", argc-2, (argv+2)); |
|
- | 76 | Log(LOG_GENERAL, |
|
- | 77 | "# Finished initialisation script\n"); |
|
- | 78 | print_header(stdout,"'Eagle_Read': From Eagle PCB .net file"); |
|
- | 79 | yydebug = 0; |
|
- | 80 | if (argc>2 && argv[2][0]=='d') |
|
- | 81 | yydebug = 1; |
|
- | 82 | if (argc>1) |
|
- | 83 | yyin = fopen(argv[1],"r"); |
|
- | 84 | else |
|
- | 85 | yyin = stdin; |
|
- | 86 | if(!yyin) |
|
- | 87 | printf("cannot open input file (%s)\n",argv[1]); |
|
- | 88 | else |
|
- | 89 | while(yyparse()==0); |
|
- | 90 | ||
- | 91 | perform_routing(Free); |
|
- | 92 | list_database(stdout,0); /*no jumpers so flatten jumpers arg=0 */ |
|
- | 93 | list_devices(stdout, |
|
- | 94 | PRINT_TYPE|PRINT_EXPAND_BUS| |
|
- | 95 | PRINT_GENERIC|PRINT_GROUP| |
|
- | 96 | PRINT_ROUTE_FLAGS | PRINT_EQUIVALENT_PINS); |
|
- | 97 | } |
|
64 | 98 | ||
65 | #ident \ |
- | |
66 | "@(#)$Header: c:\\cygwin\\cvsroot/Vert03/eagle_src/eagle_main.c,v 1.1.1.1 2003/11/04 23:34:56 mjames Exp $"; |
- | |
67 | #if defined YYDEBUG |
- | |
68 | extern int yydebug; |
- | |
69 | #else |
- | |
70 | int yydebug = 0; |
- | |
71 | #endif |
- | |
72 | 99 | ||
73 | extern FILE *yyin; |
- | |
74 | 100 | ||
75 | int main (int argc, char *argv[]) |
- | |
76 | { |
- | |
77 | InitialiseData (); |
- | |
78 | ExecuteString ( |
- | |
79 | "echo running \\$(VERTICAL_INIT) file name = $(VERTICAL_INIT) ", |
- | |
80 | argc - 1, |
- | |
81 | (argv + 1)); |
- | |
82 | ExecuteString ("do $(VERTICAL_INIT) ", argc - 2, (argv + 2)); |
- | |
83 | Log (LOG_GENERAL, "# Finished initialisation script\n"); |
- | |
84 | print_header (stdout, "'Eagle_Read': From Eagle PCB .net file"); |
- | |
85 | yydebug = 0; |
- | |
86 | if (argc > 2 && argv[2][0] == 'd') |
- | |
87 | yydebug = 1; |
- | |
88 | if (argc > 1) |
- | |
89 | yyin = fopen (argv[1], "r"); |
- | |
90 | else |
- | |
91 | yyin = stdin; |
- | |
92 | if (!yyin) |
- | |
93 | printf ("cannot open input file (%s)\n", argv[1]); |
- | |
94 | else |
- | |
95 | while (yyparse () == 0) |
- | |
96 | ; |
- | |
97 | - | ||
98 | perform_routing (Free); |
- | |
99 | list_database (stdout, 0); /*no jumpers so flatten jumpers arg=0 */ |
- | |
100 | list_devices ( |
- | |
101 | stdout, |
- | |
102 | PRINT_TYPE | PRINT_EXPAND_BUS | PRINT_GENERIC | PRINT_GROUP | PRINT_ROUTE_FLAGS | |
- | |
103 | PRINT_EQUIVALENT_PINS); |
- | |
104 | } |
- |