Rev 2 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2 | Rev 11 | ||
---|---|---|---|
Line 28... | Line 28... | ||
28 | /* |
28 | /* |
29 | @title |
29 | @title |
30 | PROGRAM orcadread: Converter for orcad files |
30 | PROGRAM orcadread: Converter for orcad files |
31 | @application external |
31 | @application external |
32 | @text |
32 | @text |
33 | PCB netlist to ACFP converter. The netlist file has net names in the first column of the |
33 | PCB netlist to ACFP converter. The netlist file has net names in the first column of the |
34 | file and then connected pins on the net listed as indented by one character. |
34 | file and then connected pins on the net listed as indented by one character. |
35 | @break |
35 | @break |
36 | Example Netlist |
36 | Example Netlist |
37 | @listing |
37 | @listing |
38 | stuff above line of --- ignored |
38 | stuff above line of --- ignored |
39 | ------------------------------- |
39 | ------------------------------- |
40 | NETNAME1 |
40 | NETNAME1 |
41 | U1.A1 U2.A3 |
41 | U1.A1 U2.A3 |
42 | 42 | ||
43 | NETNAME2 |
43 | NETNAME2 |
44 | U3.A4 U2.A1 |
44 | U3.A4 U2.A1 |
45 | U1.12 I2.33 |
45 | U1.12 I2.33 |
46 | 46 | ||
47 | 47 | ||
48 | @text |
48 | @text |
49 | Invocation |
49 | Invocation |
50 | @listing |
50 | @listing |
51 | orcadread <orcad_file> [ d ] |
51 | orcadread <orcad_file> [ d ] |
52 | @text |
52 | @text |
53 | If a lower |
53 | If a lower |
54 | case 'd' is present as the second argument, the Bison parser |
54 | case 'd' is present as the second argument, the Bison parser |
55 | (interpreter of keywords and syntax) prints extremely verbose diagnostics. |
55 | (interpreter of keywords and syntax) prints extremely verbose diagnostics. |
56 | @break |
56 | @break |
57 | Normally the acfp file produced on standard output is redirected to a file e.g. |
57 | Normally the acfp file produced on standard output is redirected to a file e.g. |
58 | @listing |
58 | @listing |
59 | orcadread file.txt > file.acfp |
59 | orcadread file.txt > file.acfp |
60 | @text |
60 | @text |
61 | Will produce file.acfp from file.txt. |
61 | Will produce file.acfp from file.txt. |
62 | @break |
62 | @break |
63 | Following this it is necessary to run the output through Vertical again in order to |
63 | Following this it is necessary to run the output through Vertical again in order to |
64 | set up properties on nets (power and ground being made not routable for instance) using the |
64 | set up properties on nets (power and ground being made not routable for instance) using the |
65 | delete routable command. Alternatively the acfp file can be edited to set the net routing |
65 | delete routable command. Alternatively the acfp file can be edited to set the net routing |
66 | flags for these nets. |
66 | flags for these nets. |
67 | @break |
67 | @break |
68 | Netlist is commonly seen with a '.REP' file suffix. One of several file formats the Southampton |
68 | Netlist is commonly seen with a '.REP' file suffix. One of several file formats the Southampton |
69 | Drawing office is likely to hand out. See also PROGRAM frbread |
69 | Drawing office is likely to hand out. See also PROGRAM frbread |
70 | and PROGRAM repread . |
70 | and PROGRAM repread . |
71 | @end |
71 | @end |
72 | */ |
72 | */ |
73 | 73 | ||
74 | #include <stdio.h> |
74 | #include <stdio.h> |
75 | #include <stdlib.h> |
- | |
76 | #include <string.h> |
75 | #include <string.h> |
- | 76 | #include <stdlib.h> |
|
77 | #if defined HAS_TCL |
77 | #if defined HAS_TCL |
78 | #include "tcl_l.h" |
78 | #include "tcl_l.h" |
79 | #endif |
79 | #endif |
80 | #include "cmdlog.h" |
- | |
81 | #include "cmdparse.h" |
- | |
82 | #include "database.h" |
- | |
83 | #include "expression.h" |
80 | #include "expression.h" |
84 | #include "generic.h" |
81 | #include "generic.h" |
- | 82 | #include "database.h" |
|
85 | #include "printout.h" |
83 | #include "printout.h" |
86 | #include "routing.h" |
84 | #include "routing.h" |
- | 85 | #include "cmdparse.h" |
|
- | 86 | #include "cmdlog.h" |
|
87 | 87 | ||
88 | #ident \ |
- | |
89 | "@(#)$Header: c:\\cygwin\\cvsroot/Vert03/orcad_src/orcad_main.c,v 1.1.1.1 2003/11/04 23:34:58 mjames Exp $"; |
88 | #ident "@(#)$Header: c:\\cygwin\\cvsroot/Vert03/orcad_src/orcad_main.c,v 1.1.1.1 2003/11/04 23:34:58 mjames Exp $"; |
90 | #if defined YYDEBUG |
89 | #if defined YYDEBUG |
91 | extern int yydebug; |
90 | extern int yydebug; |
92 | #else |
91 | #else |
93 | int yydebug = 1; |
92 | int yydebug = 1; |
94 | #endif |
93 | #endif |
95 | extern FILE *yyin; |
94 | extern FILE * yyin; |
96 | int main (int argc, char *argv[]) |
95 | int main(int argc , char * argv[]) |
97 | { |
96 | { |
98 | InitialiseData (); |
97 | InitialiseData(); |
99 | ExecuteString ( |
- | |
100 | "echo running \\$(VERTICAL_INIT) filen ame = $(VERTICAL_INIT) ", |
98 | ExecuteString("echo running \\$(VERTICAL_INIT) filen ame = $(VERTICAL_INIT) ", argc-1, (argv+1)); |
101 | argc - 1, |
- | |
102 | (argv + 1)); |
- | |
103 | ExecuteString ("do $(VERTICAL_INIT) ", argc - 2, (argv + 2)); |
99 | ExecuteString("do $(VERTICAL_INIT) ", argc-2, (argv+2)); |
- | 100 | Log(LOG_GENERAL, |
|
104 | Log (LOG_GENERAL, "# Finished initialisation script\n"); |
101 | "# Finished initialisation script\n"); |
105 | print_header (stdout, "'orcadread': From ORCAD text file"); |
102 | print_header(stdout,"'orcadread': From ORCAD text file"); |
106 | yydebug = 0; |
103 | yydebug = 0; |
107 | if (argc > 2 && argv[2][0] == 'd') |
104 | if (argc>2 && argv[2][0]=='d') |
108 | yydebug = 1; |
105 | yydebug = 1; |
109 | if (argc > 1) |
106 | if (argc>1) |
110 | yyin = fopen (argv[1], "r"); |
107 | yyin = fopen(argv[1],"r"); |
111 | else |
108 | else |
112 | yyin = stdin; |
109 | yyin = stdin; |
113 | if (!yyin) |
110 | if(!yyin) |
114 | Log (LOG_ERROR, "cannot open input file (%s)\n", argv[1]); |
111 | Log(LOG_ERROR,"cannot open input file (%s)\n",argv[1]); |
115 | else |
112 | else |
116 | while (yyparse () == 0) |
113 | while(yyparse()==0); |
117 | ; |
- | |
118 | perform_routing (Free); |
114 | perform_routing(Free); |
119 | 115 | ||
120 | list_database (stdout, 0); |
116 | list_database(stdout,0); |
121 | list_devices ( |
117 | list_devices(stdout, |
122 | stdout, |
118 | PRINT_TYPE|PRINT_EXPAND_BUS| |
123 | PRINT_TYPE | PRINT_EXPAND_BUS | PRINT_GENERIC | PRINT_GROUP | PRINT_ROUTE_FLAGS | |
119 | PRINT_GENERIC|PRINT_GROUP| |
124 | PRINT_EQUIVALENT_PINS); |
120 | PRINT_ROUTE_FLAGS | PRINT_EQUIVALENT_PINS); |
125 | } |
121 | } |