Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 11 | mjames | 1 | /* mentor_main*/ |
| 2 | mjames | 2 | |
| 3 | /* contains the database functions that store the pin configurations */ |
||
| 4 | |||
| 5 | /* |
||
| 11 | mjames | 6 | * $Header: C:/cvsroot/Vert03/mentor_src/mentor_main.c,v 1.2 2004/06/22 21:44:12 mjames Exp $ |
| 2 | mjames | 7 | * |
| 8 | * $Log: mentor_main.c,v $ |
||
| 9 | * Revision 1.2 2004/06/22 21:44:12 mjames |
||
| 10 | * Firrst build most files |
||
| 11 | * |
||
| 12 | * Revision 1.2 2002/08/22 08:31:19 mjames |
||
| 13 | * Converted to using #ident as the CVS identifier string place holder. |
||
| 14 | * |
||
| 15 | * Amended the comments intended for HTML help. |
||
| 16 | * |
||
| 17 | * Revision 1.1 2002/08/14 12:13:01 mjames |
||
| 18 | * Mentor Board Station reader modified to work with latest .nets file format |
||
| 19 | * |
||
| 20 | * Revision 1.1 2002/04/04 14:53:06 mjames |
||
| 21 | * Added mentor board station reader to the portfolio |
||
| 22 | * |
||
| 23 | * Initial revision |
||
| 11 | mjames | 24 | * |
| 2 | mjames | 25 | * |
| 11 | mjames | 26 | */ |
| 2 | mjames | 27 | #include <stdio.h> |
| 11 | mjames | 28 | #include <string.h> |
| 2 | mjames | 29 | #include <stdlib.h> |
| 30 | /* |
||
| 31 | @title |
||
| 32 | PROGRAM mentor_read: Converter for .NET files |
||
| 33 | @application external |
||
| 34 | @text |
||
| 35 | PCB netlist to ACFP converter. If a file comes from Mentor Board station |
||
| 36 | use this one. |
||
| 37 | @break |
||
| 38 | Looks for netlists in ASCII containing tags like: |
||
| 39 | @listing |
||
| 40 | NET |
||
| 41 | @text |
||
| 42 | Invocation |
||
| 11 | mjames | 43 | @listing |
| 2 | mjames | 44 | mentor_read <net_file> [ d ] |
| 45 | @text |
||
| 11 | mjames | 46 | If a lower |
| 47 | case 'd' is present as the second argument, the Bison parser |
||
| 2 | mjames | 48 | (interpreter of keywords and syntax) prints extremely verbose diagnostics. |
| 49 | @break |
||
| 50 | Normally the acfp file produced on standard output is redirected to a file e.g. |
||
| 51 | @listing |
||
| 52 | mentor_read file.net > file.acfp |
||
| 53 | @text |
||
| 54 | Will produce file.acfp from file.net. |
||
| 55 | @break |
||
| 56 | Following this it is necessary to run the output through Vertical again in order to |
||
| 11 | mjames | 57 | set up properties on nets (power and ground being made not routable for instance) using the |
| 2 | mjames | 58 | delete routable command. Alternatively the acfp file can be edited to set the net routing |
| 59 | flags for these nets. |
||
| 60 | @break |
||
| 11 | mjames | 61 | There are some hints in the netlist, where attributes of some nets are given. These will appear as comments |
| 62 | at the top of the .acfp file produced. These may help identify power and |
||
| 63 | ground pins. |
||
| 2 | mjames | 64 | @break |
| 11 | mjames | 65 | If the attribute is NET_TYPE and the value following is |
| 2 | mjames | 66 | @listing |
| 67 | POWER |
||
| 68 | SUPPLY |
||
| 69 | POWERS |
||
| 70 | GROUND |
||
| 71 | HI-CURRENT |
||
| 72 | @text |
||
| 11 | mjames | 73 | Mentor_read will automatically set any nets with any attribute set to be not routable. Use set routable in Vertical |
| 74 | to allow these nets to be routable. |
||
| 2 | mjames | 75 | @break |
| 11 | mjames | 76 | Netlist is commonly seen with a '.NET' or '.NETS' file suffix. |
| 77 | This format comes from Mentor Graphics. It also mentions Board Station in the header of the file. |
||
| 2 | mjames | 78 | @end |
| 79 | */ |
||
| 80 | |||
| 81 | #if defined HAS_TCL |
||
| 82 | #include "tcl_l.h" |
||
| 83 | #endif |
||
| 84 | #include "expression.h" |
||
| 85 | #include "generic.h" |
||
| 11 | mjames | 86 | #include "database.h" |
| 2 | mjames | 87 | #include "printout.h" |
| 88 | #include "routing.h" |
||
| 11 | mjames | 89 | #include "cmdparse.h" |
| 90 | #include "cmdlog.h" |
||
| 91 | #include "yacc_common.h" |
||
| 2 | mjames | 92 | |
| 11 | mjames | 93 | #ident "@(#)$Header: C:/cvsroot/Vert03/mentor_src/mentor_main.c,v 1.2 2004/06/22 21:44:12 mjames Exp $" |
| 2 | mjames | 94 | |
| 95 | |||
| 11 | mjames | 96 | int main(int argc , char * argv[]) |
| 97 | { |
||
| 98 | InitialiseData(); |
||
| 99 | ExecuteString("echo running \\$(VERTICAL_INIT) file name = $(VERTICAL_INIT) ", argc-1, (argv+1)); |
||
| 100 | ExecuteString("do $(VERTICAL_INIT) ", argc-2, (argv+2)); |
||
| 101 | Log(LOG_GENERAL, |
||
| 102 | "# Finished initialisation script\n"); |
||
| 103 | print_header(stdout,"'mentor_read': From .net file"); |
||
| 104 | yydebug = 0; |
||
| 105 | |||
| 106 | if (argc>2 && argv[2][0]=='d') |
||
| 107 | yydebug = 1; |
||
| 108 | |||
| 109 | if (argc>1) |
||
| 110 | yyin = fopen(argv[1],"r"); |
||
| 111 | else |
||
| 112 | yyin = stdin; |
||
| 113 | if(!yyin) |
||
| 114 | printf("cannot open input file (%s)\n",argv[1]); |
||
| 115 | else |
||
| 116 | while(yyparse()==0); |
||
| 117 | |||
| 118 | perform_routing(Free); |
||
| 119 | list_database(stdout,0); /*no jumpers so flatten jumpers arg=0 */ |
||
| 120 | list_devices(stdout, |
||
| 121 | PRINT_TYPE|PRINT_EXPAND_BUS| |
||
| 122 | PRINT_GENERIC|PRINT_GROUP| |
||
| 123 | PRINT_ROUTE_FLAGS | PRINT_EQUIVALENT_PINS); |
||
| 124 | } |
||
| 125 | |||
| 126 | |||
| 127 |