Subversion Repositories Vertical

Rev

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

  1. /* rep_main*/
  2. /*
  3.  * $Id: rep_main.c,v 1.1.1.1 2003/11/04 23:34:58 mjames Exp $
  4.  *
  5.  * $Log: rep_main.c,v $
  6.  * Revision 1.1.1.1  2003/11/04 23:34:58  mjames
  7.  * Imported into local repositrory
  8.  *
  9.  * Revision 1.10  2002/09/09 10:36:20  mjames
  10.  * Checkpoint checkin
  11.  *
  12.  * Revision 1.9  2002/08/14 12:05:15  mjames
  13.  * Added an 'external' tag to the documentation
  14.  *
  15.  * Revision 1.9  2002/04/04 15:04:26  mjames
  16.  * Fixed #ident problem
  17.  *
  18.  * Revision 1.8  2001/10/31 22:20:16  mjames
  19.  * Tidying up problematical comments caused by CVS
  20.  * 'intelligent' comment guessing
  21.  *
  22.  * Revision 1.7  2001/10/22 10:56:05  mjames
  23.  * Modified list_devices to take an options flag
  24.  *
  25.  * Revision 1.6  2001/10/02 20:50:50  mjames
  26.  * Moved documentation about code to main program module.
  27.  *
  28.  * Revision 1.5  2001/09/28 14:34:11  mjames
  29.  * FIxed yydebug variable to exist when YYDEBUG macro
  30.  * is not defined. Otherwise linker error will be reported.
  31.  *
  32.  * Revision 1.4  2001/07/09 10:05:28  mjames
  33.  * Placed the version string in an independent file to save time on building
  34.  * all of the variants of Vertical
  35.  *
  36.  * Revision 1.3  2001/06/06 12:10:18  mjames
  37.  * Move from HPUX
  38.  *
  39.  * Revision 1.2  2000/12/04 13:14:04  mjames
  40.  * Imported all of the PCB syntax readers.
  41.  *
  42.  * Converted "a/b" to mean "a" divided by "b" insted of a single string
  43.  * "a/b" in Verilog
  44.  *
  45.  * Revision 1.1.1.1  2000/10/19 21:58:39  mjames
  46.  * Mike put it here
  47.  *
  48.  *
  49.  * Revision 1.21  2000/10/04  10:37:09  10:37:09  mjames (Mike James)
  50.  * Modified for Vertical2 : support COMPONENTS and SIGNALS
  51.  *
  52.  * Revision 1.21  2000/10/04  10:37:09  10:37:09  mjames (Mike James)
  53.  * Part of Release PSAVAT01
  54.  *
  55.  * Revision 1.20  2000/10/02  11:04:19  11:04:19  mjames (Mike James)
  56.  * new_vhdl
  57.  *
  58.  * Revision 1.19  2000/09/27  14:42:19  14:42:19  mjames (Mike James)
  59.  * Part of Release Sep_27_ST_2000
  60.  *
  61.  * Revision 1.18  2000/09/27  10:58:36  10:58:36  mjames (Mike James)
  62.  * Started using correct return code for yyparse()
  63.  *
  64.  * Revision 1.17  2000/09/21  10:15:50  10:15:50  mjames (Mike James)
  65.  * Part of Release Sep21Alpha
  66.  *
  67.  * Revision 1.16  2000/08/25  09:57:15  09:57:15  mjames (Mike James)
  68.  * Part of Release Aug25_alpha
  69.  *
  70.  * Revision 1.15  2000/08/16  08:57:31  08:57:31  mjames (Mike James)
  71.  * Part of Release CD01_Aug2000
  72.  *
  73.  * Revision 1.14  2000/08/14  14:45:12  14:45:12  mjames (Mike James)
  74.  * Part of Release Aug_14_2000
  75.  *
  76.  * Revision 1.13  2000/08/11  08:30:33  08:30:33  mjames (Mike James)
  77.  * Part of Release Aug_11_2000
  78.  *
  79.  * Revision 1.12  2000/08/09  10:31:48  10:31:48  mjames (Mike James)
  80.  * Part of Release Aug__9_2000
  81.  *
  82.  * Revision 1.11  2000/05/31  11:42:59  11:42:59  mjames (Mike James)
  83.  * Part of Release May_31_2000
  84.  *
  85.  * Revision 1.10  2000/05/31  11:13:52  11:13:52  mjames (Mike James)
  86.  * Added use of vertical.ini
  87.  *
  88.  * Revision 1.9  2000/05/08  17:01:39  17:01:39  mjames (Mike James)
  89.  * Part of Release May__8_2000
  90.  *
  91.  * Revision 1.8  2000/05/08  16:59:32  16:59:32  mjames (Mike James)
  92.  * Part of Release May__8_2000
  93.  *
  94.  * Revision 1.7  2000/05/08  16:57:09  16:57:09  mjames (Mike James)
  95.  * Part of Release May__8_2000
  96.  *
  97.  * Revision 1.6  2000/03/08  16:19:27  16:19:27  mjames (Mike James)
  98.  * New version including PC
  99.  *
  100.  * Revision 1.3  2000/01/20  15:58:49  15:58:49  mjames (Mike James)
  101.  * Part of Release R22
  102.  *
  103.  * Revision 1.2  99/12/22  11:15:29  11:15:29  mjames (Mike James)
  104.  * Part of Release Dec_22_1999
  105.  *
  106.  * Revision 1.1  99/11/23  13:54:30  13:54:30  mjames (Mike James)
  107.  * Initial revision
  108.  *
  109.  *
  110.  *
  111. */
  112.  
  113.  
  114. /*
  115. @title
  116. PROGRAM repread: Converter number 1 for .REP files
  117. @application external
  118. @text
  119. PCB netlist to ACFP converter. The netlist file has net names in the first column of the
  120. file and then connected pins on the net listed as indented by one character.
  121. @break
  122. Example Netlist
  123. @listing
  124. NETNAME1
  125.  X1 A1
  126.  X3 12
  127. NETNAME2
  128.  U1 A4
  129.  G1 12
  130.  X1 A2
  131. @text
  132. Invocation
  133. @listing
  134. repread <rep_file> [ d ]
  135. @text
  136. If a lower  
  137. case 'd' is present as the second argument, the Bison parser
  138. (interpreter of keywords and syntax) prints extremely verbose diagnostics.
  139. @break
  140. Normally the acfp file produced on standard output is redirected to a file e.g.
  141. @listing
  142. repread file.rep > file.acfp
  143. @text
  144. Will produce file.acfp from file.rep.
  145. @break
  146. Following this it is necessary to run the output through Vertical again in order to
  147. set up properties on nets (power and ground being made not routable for instance) using the
  148. del routable command. Alternatively the acfp file can be edited to set the net routing
  149. flags for these nets.
  150. @break
  151. Netlist is commonly seen with a '.REP' file suffix. One of several file formats the Southampton
  152. Drawing office is likely to hand out. See also PROGRAM frbread and PROGRAM rep2read .
  153. @end
  154. */
  155.  
  156. #include <stdio.h>
  157. #include <string.h>
  158. #include <stdlib.h>
  159.  
  160.  
  161. #if defined HAS_TCL
  162. #include "tcl_l.h"
  163. #endif
  164. #include "expression.h"
  165. #include "generic.h"
  166. #include "database.h"
  167. #include "printout.h"
  168. #include "routing.h"
  169. #include "cmdparse.h"
  170. #include "cmdlog.h"
  171. #include "yacc_common.h"
  172.  
  173. #ident "@(#)$Header: c:\\cygwin\\cvsroot/Vert03/rep_src/rep_main.c,v 1.1.1.1 2003/11/04 23:34:58 mjames Exp $"
  174.  
  175.  
  176. int main(int argc , char * argv[])
  177.   {
  178.   InitialiseData();
  179.   ExecuteString("echo running \\$(VERTICAL_INIT) file name = $(VERTICAL_INIT) ", argc-1, (argv+1));
  180.   ExecuteString("do $(VERTICAL_INIT) ", argc-2, (argv+2));
  181.   Log(LOG_GENERAL,
  182.       "# Finished initialisation script\n");
  183.   print_header(stdout,"'repread': From .rep file");
  184.   yydebug = 0;
  185.   if (argc>2 && argv[2][0]=='d')
  186.     yydebug = 1;
  187.   if (argc>1)
  188.     yyin = fopen(argv[1],"r");
  189.   else
  190.     yyin = stdin;
  191.   if(!yyin)
  192.     Log(LOG_ERROR,"cannot open input file (%s)\n",argv[1]);
  193.   else
  194.     while(yyparse()==0);
  195.   perform_routing(Free);
  196.  
  197.   list_database(stdout,0);
  198.     list_devices(stdout,
  199.          PRINT_TYPE|PRINT_EXPAND_BUS|
  200.          PRINT_GENERIC|PRINT_GROUP|
  201.          PRINT_ROUTE_FLAGS | PRINT_EQUIVALENT_PINS);
  202.   }
  203.