Subversion Repositories Vertical

Rev

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

  1. /*
  2.  * $Header: c:\\cygwin\\cvsroot/Vert03/frb_src/frb_main.c,v 1.1.1.1 2003/11/04 23:34:59 mjames Exp $
  3.  *
  4.  * $Log: frb_main.c,v $
  5.  * Revision 1.1.1.1  2003/11/04 23:34:59  mjames
  6.  * Imported into local repositrory
  7.  *
  8.  * Revision 1.10  2002/09/09 10:36:19  mjames
  9.  * Checkpoint checkin
  10.  *
  11.  * Revision 1.9  2002/08/14 12:11:31  mjames
  12.  * Added an 'external' tag to the documentation
  13.  *
  14.  * Revision 1.9  2002/04/04 14:53:06  mjames
  15.  * Added mentor board station reader to the portfolio
  16.  *
  17.  * Revision 1.8  2001/10/31 22:20:05  mjames
  18.  * Tidying up problematical comments caused by CVS
  19.  * 'intelligent' comment guessing
  20.  *
  21.  * Revision 1.7  2001/10/22 11:00:15  mjames
  22.  * Modified list_devices to take an options flag
  23.  *
  24.  * Revision 1.6  2001/10/02 20:53:47  mjames
  25.  * Moved documentation about code to main program module.
  26.  *
  27.  * Revision 1.5  2001/09/28 14:34:12  mjames
  28.  * FIxed yydebug variable to exist when YYDEBUG macro
  29.  * is not defined. Otherwise linker error will be reported.
  30.  *
  31.  * Revision 1.4  2001/07/09 15:47:35  mjames
  32.  * Placed the version string in an independent file to save time on building
  33.  * all of the variants of Vertical
  34.  *
  35.  * Revision 1.3  2001/06/06 12:10:22  mjames
  36.  * Move from HPUX
  37.  *
  38.  * Revision 1.2  2000/12/04 13:14:02  mjames
  39.  * Imported all of the PCB syntax readers.
  40.  *
  41.  * Converted "a/b" to mean "a" divided by "b" insted of a single string
  42.  * "a/b" in Verilog
  43.  *
  44.  * Revision 1.1.1.1  2000/10/19 21:58:38  mjames
  45.  * Mike put it here
  46.  *
  47.  *
  48.  * Revision 1.36  2000/10/04  10:37:05  10:37:05  mjames (Mike James)
  49.  * Modified for Vertical2 : support COMPONENTS and SIGNALS
  50.  *
  51.  * Revision 1.36  2000/10/04  10:37:05  10:37:05  mjames (Mike James)
  52.  * Part of Release PSAVAT01
  53.  *
  54.  * Revision 1.35  2000/10/02  11:04:13  11:04:13  mjames (Mike James)
  55.  * new_vhdl
  56.  *
  57.  
  58.  * Revision 1.34  2000/09/27  14:42:13  14:42:13  mjames (Mike James)
  59.  
  60.  * Part of Release Sep_27_ST_2000
  61.  
  62.  *
  63.  
  64.  * Revision 1.33  2000/09/27  10:45:08  10:45:08  mjames (Mike James)
  65.  
  66.  * Corrected to use correct return code from yyparse()
  67.  
  68.  *
  69.  
  70.  * Revision 1.32  2000/09/21  10:15:43  10:15:43  mjames (Mike James)
  71.  
  72.  * Part of Release Sep21Alpha
  73.  
  74.  *
  75.  
  76.  * Revision 1.31  2000/08/25  09:57:11  09:57:11  mjames (Mike James)
  77.  
  78.  * Part of Release Aug25_alpha
  79.  
  80.  *
  81.  
  82.  * Revision 1.30  2000/08/16  08:57:27  08:57:27  mjames (Mike James)
  83.  
  84.  * Part of Release CD01_Aug2000
  85.  
  86.  *
  87.  
  88.  * Revision 1.29  2000/08/14  14:45:09  14:45:09  mjames (Mike James)
  89.  
  90.  * Part of Release Aug_14_2000
  91.  
  92.  *
  93.  
  94.  * Revision 1.28  2000/08/11  08:30:29  08:30:29  mjames (Mike James)
  95.  
  96.  * Part of Release Aug_11_2000
  97.  
  98.  *
  99.  
  100.  * Revision 1.27  2000/08/09  10:31:43  10:31:43  mjames (Mike James)
  101.  
  102.  * Part of Release Aug__9_2000
  103.  
  104.  *
  105.  
  106.  * Revision 1.26  2000/05/31  11:42:52  11:42:52  mjames (Mike James)
  107.  
  108.  * Part of Release May_31_2000
  109.  
  110.  *
  111.  
  112.  * Revision 1.25  2000/05/31  11:30:11  11:30:11  mjames (Mike James)
  113.  
  114.  * Added acfread.ini file reading
  115.  
  116.  *
  117.  
  118.  * Revision 1.24  2000/05/08  17:01:35  17:01:35  mjames (Mike James)
  119.  
  120.  * Part of Release May__8_2000
  121.  
  122.  *
  123.  
  124.  * Revision 1.23  2000/05/08  16:59:28  16:59:28  mjames (Mike James)
  125.  
  126.  * Part of Release May__8_2000
  127.  
  128.  *
  129.  
  130.  * Revision 1.22  2000/05/08  16:57:04  16:57:04  mjames (Mike James)
  131.  
  132.  * Part of Release May__8_2000
  133.  
  134.  *
  135.  
  136.  * Revision 1.21  2000/03/08  16:19:02  16:19:02  mjames (Mike James)
  137.  
  138.  * New version including PC
  139.  
  140.  *
  141.  
  142.  * Revision 1.18  2000/01/20  15:58:44  15:58:44  mjames (Mike James)
  143.  
  144.  * Part of Release R22
  145.  
  146.  *
  147.  
  148.  * Revision 1.17  99/12/22  11:15:24  11:15:24  mjames (Mike James)
  149.  
  150.  * Part of Release Dec_22_1999
  151.  
  152.  *
  153.  
  154.  * Revision 1.16  99/06/25  14:35:32  14:35:32  mjames (Mike James)
  155.  
  156.  * Added in reference to expression.h, but no changes made
  157.  
  158.  * to the function of acfread yet.
  159.  
  160.  *
  161.  
  162.  * Revision 1.15  99/05/04  09:51:08  09:51:08  mjames (Mike James)
  163.  
  164.  * General checkin
  165.  
  166.  *
  167.  
  168.  * Revision 1.13  98/02/11  11:26:01  11:26:01  mjames (Mike James)
  169.  
  170.  * Checked in for version 6.2a
  171.  
  172.  *
  173.  
  174.  * Revision 1.12  97/04/23  08:42:53  08:42:53  mjames (Mike James)
  175.  
  176.  * CHecked in for release rel23041997
  177.  
  178.  *
  179.  
  180.  * Revision 1.11  97/01/03  13:33:14  13:33:14  mjames (Mike James)
  181.  
  182.  * Changed the order of printing the banner on startup so that it is before all
  183.  
  184.  * other output from the tool.
  185.  
  186.  *
  187.  
  188.  * Revision 1.10  96/08/06  13:35:32  13:35:32  mjames (Mike James)
  189.  
  190.  * Changed date of compile
  191.  
  192.  *
  193.  
  194.  * Revision 1.9  96/07/19  14:36:33  14:36:33  mjames (Mike James)
  195.  
  196.  * Amended major revision
  197.  
  198.  *
  199.  
  200.  * Revision 1.8  1996/07/12  15:52:12  mjames
  201.  
  202.  * Sorted out things like Alias and Jumpers
  203.  
  204.  * Work Correctly
  205.  
  206.  * Print COrrectly
  207.  
  208.  *
  209.  
  210.  * Revision 1.7  96/03/29  14:46:09  14:46:09  mjames (Mike James)
  211.  
  212.  * Added VHDL netlist writing to the capabilities of ACFREAD
  213.  
  214.  *
  215.  
  216.  * Revision 1.6  96/03/18  13:50:34  13:50:34  mjames (Mike James)
  217.  
  218.  * Real Revision 2.1
  219.  
  220.  *
  221.  
  222.  * Revision 1.3  96/02/13  09:13:04  09:13:04  mjames (Mike James)
  223.  
  224.  * Updated to be version 2.0 with net joining
  225.  
  226.  *
  227.  
  228.  * Revision 1.2  96/02/07  16:01:19  16:01:19  mjames (Mike James)
  229.  
  230.  * Added correct RCS header
  231.  
  232.  *
  233.  
  234.  * Revision 1.1  96/02/07  15:49:03  15:49:03  mjames (Mike James)
  235.  
  236.  * Initial revision
  237.  
  238.  *
  239.  
  240.  * Revision 1.5  96/02/07  11:04:14  11:04:14  mjames (Mike James)
  241.  
  242.  * Checkin before adding new command parsing to program
  243.  
  244.  *
  245.  
  246.  * Revision 1.4  96/01/10  13:12:59  13:12:59  mjames (Mike James)
  247.  
  248.  * Works in debug mode with EPLD listings and PCB layout
  249.  
  250.  *
  251.  
  252.  * Revision 1.3  96/01/08  15:23:13  15:23:13  mjames (Mike James)
  253.  
  254.  * Managing to make sense of things now
  255.  
  256.  *
  257.  
  258.  * Revision 1.2  96/01/07  20:23:01  Mike_James
  259.  
  260.  *
  261.  
  262.  * Revision 1.1  96/01/07  12:38:41  Mike_James
  263.  
  264.  * Initial revision
  265.  
  266.  *
  267.  
  268.  * Revision 1.2  96/01/04  17:54:41  17:54:41  mjames (Mike James)
  269.  
  270.  * Altered to conditionally debug
  271.  
  272.  *
  273.  
  274.  * Revision 1.1  96/01/04  10:17:57  10:17:57  mjames (Mike James)
  275.  
  276.  * Initial revision
  277.  
  278.  *
  279.  
  280. */
  281. /*
  282. @title
  283. PROGRAM frbread: Converter for .FRB files
  284. @application external
  285. @text
  286. PCB netlist to ACFP converter. Looks for netlists in ASCII containing tags like:
  287. @listing
  288. .HEA  
  289. .END  
  290. .TIM  
  291. .UNI  
  292. .JOB  
  293. .TYP  
  294. .APP  
  295. .ADD_COM
  296. .ADD_TER
  297. .ATT_COM
  298. .ATT_TRE
  299. .TER  
  300. @text
  301. Commonly seen with a '.FRB' file suffix or '.CDI' file suffix.
  302. More common Racal-Zuken CadStar
  303. file format.
  304. One of several file formats the Southampton
  305. Drawing office is likely to hand out. See also PROGRAM repread and PROGRAM rep2read.
  306.  
  307. @break
  308. Invocation
  309. @listing
  310. frbread <frb_file> [d]
  311. @text
  312. The frb file name is the first argument, the third argument is a debug flag.
  313. If a lower  
  314. case 'd' is present, the Bison parser (interpreter of keywords and syntax) prints extremely verbose diagnostics.
  315. @break
  316. Normally the acfp file produced on standard output is redirected to a file e.g.
  317. @listing
  318. frbread file.frb > file.acfp
  319. @text
  320. Will produce file.acfp from file.frb.
  321. @break
  322. Following this it is necessary to run the output through Vertical again in order to
  323. set up properties on nets (power and ground being made not routable for instance) using the
  324. del routable command. Alternatively the acfp file can be edited to set the net routing flags for these nets.
  325. @end
  326. */
  327.  
  328. #include <stdio.h>
  329. #include <string.h>
  330. #include <stdlib.h>
  331. #if defined HAS_TCL
  332. #include "tcl_l.h"
  333. #endif
  334. #include "expression.h"
  335. #include "generic.h"
  336. #include "database.h"
  337. #include "printout.h"
  338. #include "routing.h"
  339. #include "cmdparse.h"
  340. #include "cmdlog.h"
  341. #include "yacc_common.h"
  342.  
  343. #ident "@(#)$Header: c:\\cygwin\\cvsroot/Vert03/frb_src/frb_main.c,v 1.1.1.1 2003/11/04 23:34:59 mjames Exp $"
  344.  
  345. int main(int argc , char * argv[])
  346.  
  347.   {
  348.  
  349.   InitialiseData();
  350.   ExecuteString("echo running \\$(VERTICAL_INIT) file name = $(VERTICAL_INIT) ", argc-1, (argv+1));
  351.   ExecuteString("do $(VERTICAL_INIT) ", argc-2, (argv+2));
  352.   Log(LOG_GENERAL,
  353.         "# Finished initialisation script\n");
  354.   print_header(stdout,"'frbread': From Drawing Office file");
  355.   yydebug = 0;
  356.   if (argc>2 && argv[2][0]=='d')
  357.     yydebug = 1;
  358.   if (argc>1)
  359.     yyin = fopen(argv[1],"r");
  360.   else
  361.     yyin = stdin;
  362.   if(!yyin)
  363.     printf("cannot open input file (%s)\n",argv[1]);
  364.   else
  365.     while(yyparse()==0);
  366.   perform_routing(Free);
  367.  
  368.   list_database(stdout,0); /* no jumpers 0= do not flatten them */
  369.     list_devices(stdout,
  370.          PRINT_TYPE|PRINT_EXPAND_BUS|
  371.          PRINT_GENERIC|PRINT_GROUP|
  372.          PRINT_ROUTE_FLAGS | PRINT_EQUIVALENT_PINS);
  373.   }
  374.  
  375.  
  376.  
  377.