Subversion Repositories Vertical

Rev

Blame | 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. @title
  115. PROGRAM repread: Converter number 1 for .REP files
  116. @application external
  117. @text
  118. PCB netlist to ACFP converter. The netlist file has net names in the first column of the
  119. file and then connected pins on the net listed as indented by one character.
  120. @break
  121. Example Netlist
  122. @listing
  123. NETNAME1
  124.  X1 A1
  125.  X3 12
  126. NETNAME2
  127.  U1 A4
  128.  G1 12
  129.  X1 A2
  130. @text
  131. Invocation
  132. @listing
  133. repread <rep_file> [ d ]
  134. @text
  135. If a lower
  136. case 'd' is present as the second argument, the Bison parser
  137. (interpreter of keywords and syntax) prints extremely verbose diagnostics.
  138. @break
  139. Normally the acfp file produced on standard output is redirected to a file e.g.
  140. @listing
  141. repread file.rep > file.acfp
  142. @text
  143. Will produce file.acfp from file.rep.
  144. @break
  145. Following this it is necessary to run the output through Vertical again in order to
  146. set up properties on nets (power and ground being made not routable for instance) using the
  147. del routable command. Alternatively the acfp file can be edited to set the net routing
  148. flags for these nets.
  149. @break
  150. Netlist is commonly seen with a '.REP' file suffix. One of several file formats the Southampton
  151. Drawing office is likely to hand out. See also PROGRAM frbread and PROGRAM rep2read .
  152. @end
  153. */
  154.  
  155. #include <stdio.h>
  156. #include <stdlib.h>
  157. #include <string.h>
  158.  
  159. #if defined HAS_TCL
  160. #include "tcl_l.h"
  161. #endif
  162. #include "cmdlog.h"
  163. #include "cmdparse.h"
  164. #include "database.h"
  165. #include "expression.h"
  166. #include "generic.h"
  167. #include "printout.h"
  168. #include "routing.h"
  169. #ident                                                                                        \
  170.     "@(#)$Header: c:\\cygwin\\cvsroot/Vert03/rep_src/rep_main.c,v 1.1.1.1 2003/11/04 23:34:58 mjames Exp $";
  171. #if defined YYDEBUG
  172. extern int yydebug;
  173. #else
  174. int yydebug = 1;
  175. #endif
  176. extern FILE *yyin;
  177. int main (int argc, char *argv[])
  178. {
  179.         InitialiseData ();
  180.         ExecuteString (
  181.             "echo running \\$(VERTICAL_INIT) file name = $(VERTICAL_INIT) ",
  182.             argc - 1,
  183.             (argv + 1));
  184.         ExecuteString ("do $(VERTICAL_INIT) ", argc - 2, (argv + 2));
  185.         Log (LOG_GENERAL, "# Finished initialisation script\n");
  186.         print_header (stdout, "'repread': From .rep file");
  187.         yydebug = 0;
  188.         if (argc > 2 && argv[2][0] == 'd')
  189.                 yydebug = 1;
  190.         if (argc > 1)
  191.                 yyin = fopen (argv[1], "r");
  192.         else
  193.                 yyin = stdin;
  194.         if (!yyin)
  195.                 Log (LOG_ERROR, "cannot open input file (%s)\n", argv[1]);
  196.         else
  197.                 while (yyparse () == 0)
  198.                         ;
  199.         perform_routing (Free);
  200.  
  201.         list_database (stdout, 0);
  202.         list_devices (
  203.             stdout,
  204.             PRINT_TYPE | PRINT_EXPAND_BUS | PRINT_GENERIC | PRINT_GROUP | PRINT_ROUTE_FLAGS |
  205.                 PRINT_EQUIVALENT_PINS);
  206. }
  207.