Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 2 | mjames | 1 | /* |
| 2 | * $Id: orcad_main.c,v 1.1.1.1 2003/11/04 23:34:58 mjames Exp $ |
||
| 3 | * |
||
| 4 | * $Log: orcad_main.c,v $ |
||
| 5 | * Revision 1.1.1.1 2003/11/04 23:34:58 mjames |
||
| 6 | * Imported into local repositrory |
||
| 7 | * |
||
| 8 | * Revision 1.4 2002/09/09 10:36:20 mjames |
||
| 9 | * Checkpoint checkin |
||
| 10 | * |
||
| 11 | * Revision 1.3 2002/08/14 12:07:29 mjames |
||
| 12 | * Added an 'external' tag to the documentation |
||
| 13 | * |
||
| 14 | * Revision 1.3 2002/04/04 15:04:27 mjames |
||
| 15 | * Fixed #ident problem |
||
| 16 | * |
||
| 17 | * Revision 1.2 2001/10/31 22:20:10 mjames |
||
| 18 | * Tidying up problematical comments caused by CVS |
||
| 19 | * 'intelligent' comment guessing |
||
| 20 | * |
||
| 21 | * Revision 1.1 2001/10/23 21:11:38 mjames |
||
| 22 | * Added in an Orcad reader into Vertical |
||
| 23 | * |
||
| 24 | * |
||
| 25 | * |
||
| 26 | */ |
||
| 27 | |||
| 28 | /* |
||
| 29 | @title |
||
| 30 | PROGRAM orcadread: Converter for orcad files |
||
| 31 | @application external |
||
| 32 | @text |
||
| 11 | mjames | 33 | PCB netlist to ACFP converter. The netlist file has net names in the first column of the |
| 2 | mjames | 34 | file and then connected pins on the net listed as indented by one character. |
| 35 | @break |
||
| 36 | Example Netlist |
||
| 37 | @listing |
||
| 38 | stuff above line of --- ignored |
||
| 39 | ------------------------------- |
||
| 40 | NETNAME1 |
||
| 41 | U1.A1 U2.A3 |
||
| 42 | |||
| 43 | NETNAME2 |
||
| 11 | mjames | 44 | U3.A4 U2.A1 |
| 2 | mjames | 45 | U1.12 I2.33 |
| 46 | |||
| 47 | |||
| 48 | @text |
||
| 49 | Invocation |
||
| 11 | mjames | 50 | @listing |
| 2 | mjames | 51 | orcadread <orcad_file> [ d ] |
| 52 | @text |
||
| 11 | mjames | 53 | If a lower |
| 54 | case 'd' is present as the second argument, the Bison parser |
||
| 2 | mjames | 55 | (interpreter of keywords and syntax) prints extremely verbose diagnostics. |
| 56 | @break |
||
| 57 | Normally the acfp file produced on standard output is redirected to a file e.g. |
||
| 58 | @listing |
||
| 59 | orcadread file.txt > file.acfp |
||
| 60 | @text |
||
| 61 | Will produce file.acfp from file.txt. |
||
| 62 | @break |
||
| 63 | Following this it is necessary to run the output through Vertical again in order to |
||
| 11 | mjames | 64 | set up properties on nets (power and ground being made not routable for instance) using the |
| 2 | mjames | 65 | delete routable command. Alternatively the acfp file can be edited to set the net routing |
| 66 | flags for these nets. |
||
| 67 | @break |
||
| 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 |
||
| 70 | and PROGRAM repread . |
||
| 71 | @end |
||
| 72 | */ |
||
| 73 | |||
| 74 | #include <stdio.h> |
||
| 11 | mjames | 75 | #include <string.h> |
| 2 | mjames | 76 | #include <stdlib.h> |
| 77 | #if defined HAS_TCL |
||
| 78 | #include "tcl_l.h" |
||
| 79 | #endif |
||
| 80 | #include "expression.h" |
||
| 81 | #include "generic.h" |
||
| 11 | mjames | 82 | #include "database.h" |
| 2 | mjames | 83 | #include "printout.h" |
| 84 | #include "routing.h" |
||
| 11 | mjames | 85 | #include "cmdparse.h" |
| 86 | #include "cmdlog.h" |
||
| 2 | mjames | 87 | |
| 11 | mjames | 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 $"; |
| 2 | mjames | 89 | #if defined YYDEBUG |
| 90 | extern int yydebug; |
||
| 91 | #else |
||
| 92 | int yydebug = 1; |
||
| 93 | #endif |
||
| 11 | mjames | 94 | extern FILE * yyin; |
| 95 | int main(int argc , char * argv[]) |
||
| 96 | { |
||
| 97 | InitialiseData(); |
||
| 98 | ExecuteString("echo running \\$(VERTICAL_INIT) filen ame = $(VERTICAL_INIT) ", argc-1, (argv+1)); |
||
| 99 | ExecuteString("do $(VERTICAL_INIT) ", argc-2, (argv+2)); |
||
| 100 | Log(LOG_GENERAL, |
||
| 101 | "# Finished initialisation script\n"); |
||
| 102 | print_header(stdout,"'orcadread': From ORCAD text file"); |
||
| 103 | yydebug = 0; |
||
| 104 | if (argc>2 && argv[2][0]=='d') |
||
| 105 | yydebug = 1; |
||
| 106 | if (argc>1) |
||
| 107 | yyin = fopen(argv[1],"r"); |
||
| 108 | else |
||
| 109 | yyin = stdin; |
||
| 110 | if(!yyin) |
||
| 111 | Log(LOG_ERROR,"cannot open input file (%s)\n",argv[1]); |
||
| 112 | else |
||
| 113 | while(yyparse()==0); |
||
| 114 | perform_routing(Free); |
||
| 115 | |||
| 116 | list_database(stdout,0); |
||
| 117 | list_devices(stdout, |
||
| 118 | PRINT_TYPE|PRINT_EXPAND_BUS| |
||
| 119 | PRINT_GENERIC|PRINT_GROUP| |
||
| 120 | PRINT_ROUTE_FLAGS | PRINT_EQUIVALENT_PINS); |
||
| 121 | } |