Subversion Repositories Vertical

Rev

Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. /* contains the database functions that store the pin configurations
  2.  *
  3.  * $Header: c:\\cygwin\\cvsroot/Vert03/rep2_src/rep2_main.c,v 1.1.1.1 2003/11/04 23:34:58
  4.  * mjames Exp $
  5.  *
  6.  * $Log: rep2_main.c,v $
  7.  * Revision 1.1.1.1  2003/11/04 23:34:58  mjames
  8.  * Imported into local repositrory
  9.  *
  10.  * Revision 1.4  2002/08/14 12:05:56  mjames
  11.  * Added an 'external' tag to the documentation
  12.  *
  13.  * Revision 1.4  2002/04/04 15:04:26  mjames
  14.  * Fixed #ident problem
  15.  *
  16.  * Revision 1.3  2001/10/31 22:20:15  mjames
  17.  * Tidying up problematical comments caused by CVS
  18.  * 'intelligent' comment guessing
  19.  *
  20.  * Revision 1.2  2001/10/22 10:56:05  mjames
  21.  * Modified list_devices to take an options flag
  22.  *
  23.  * Revision 1.1  2001/10/02 20:52:58  mjames
  24.  * Another .REP file format reader
  25.  *
  26.  */
  27.  
  28. /*
  29. @title
  30. PROGRAM rep2read: Converter number 2 for .REP files
  31. @application external
  32. @text
  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.
  35. @break
  36. Example Netlist
  37. @listing
  38. X1      12 NETNAME1 1230 4190 Bottom
  39. U1      A4 NETNAME1 1240 4190 Bottom
  40. G1      12  1250 4190 Bottom
  41. X1      A2 NETNAME2 1260 4200 Bottom
  42. @text
  43. This reads
  44. Socket Pin_identifer Netname
  45. @break
  46. The columns following the (optional) netname
  47. (if missing there are 2 spaces) are the X and Y location
  48. of the pin and the PCB layer.
  49. Invocation
  50. @listing
  51. rep2read <rep_file> [ d ]
  52. @text
  53. If a lower
  54. case 'd' is present as the second argument, the Bison parser
  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. rep2read file.rep > file.acfp
  60. @text
  61. Will produce file.acfp from file.rep.
  62. @break
  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
  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>
  75. #include <stdlib.h>
  76. #include <string.h>
  77. #if defined HAS_TCL
  78. #include "tcl_l.h"
  79. #endif
  80. #include "cmdlog.h"
  81. #include "cmdparse.h"
  82. #include "database.h"
  83. #include "expression.h"
  84. #include "generic.h"
  85. #include "printout.h"
  86. #include "routing.h"
  87.  
  88. #ident                                                                                        \
  89.     "@(#)$Header: c:\\cygwin\\cvsroot/Vert03/rep2_src/rep2_main.c,v 1.1.1.1 2003/11/04 23:34:58 mjames Exp $";
  90. #if defined YYDEBUG
  91. extern int yydebug;
  92. #else
  93. int yydebug = 1;
  94. #endif
  95. extern FILE *yyin;
  96. int main (int argc, char *argv[])
  97. {
  98.         InitialiseData ();
  99.         ExecuteString (
  100.             "echo running \\$(VERTICAL_INIT) file name = $(VERTICAL_INIT) ",
  101.             argc - 1,
  102.             (argv + 1));
  103.         ExecuteString ("do $(VERTICAL_INIT) ", argc - 2, (argv + 2));
  104.         Log (LOG_GENERAL, "# Finished initialisation script\n");
  105.         print_header (stdout, "'rep2read': From .rep file");
  106.         yydebug = 0;
  107.         if (argc > 2 && argv[2][0] == 'd')
  108.                 yydebug = 1;
  109.         if (argc > 1)
  110.                 yyin = fopen (argv[1], "r");
  111.         else
  112.                 yyin = stdin;
  113.         if (!yyin)
  114.                 Log (LOG_ERROR, "cannot open input file (%s)\n", argv[1]);
  115.         else
  116.                 while (yyparse () == 0)
  117.                         ;
  118.         perform_routing (Free);
  119.  
  120.         list_database (stdout, 0);
  121.         list_devices (
  122.             stdout,
  123.             PRINT_TYPE | PRINT_EXPAND_BUS | PRINT_GENERIC | PRINT_GROUP | PRINT_ROUTE_FLAGS |
  124.                 PRINT_EQUIVALENT_PINS);
  125. }
  126.