/*
* $Header: /cygwin/cvsroot/vertical/frb_main.c,v 1.10 2002/09/09 10:36:19 mjames Exp $
*
* $Log: frb_main.c,v $
* Revision 1.10 2002/09/09 10:36:19 mjames
* Checkpoint checkin
*
* Revision 1.9 2002/08/14 12:11:31 mjames
* Added an 'external' tag to the documentation
*
* Revision 1.9 2002/04/04 14:53:06 mjames
* Added mentor board station reader to the portfolio
*
* Revision 1.8 2001/10/31 22:20:05 mjames
* Tidying up problematical comments caused by CVS
* 'intelligent' comment guessing
*
* Revision 1.7 2001/10/22 11:00:15 mjames
* Modified list_devices to take an options flag
*
* Revision 1.6 2001/10/02 20:53:47 mjames
* Moved documentation about code to main program module.
*
* Revision 1.5 2001/09/28 14:34:12 mjames
* FIxed yydebug variable to exist when YYDEBUG macro
* is not defined. Otherwise linker error will be reported.
*
* Revision 1.4 2001/07/09 15:47:35 mjames
* Placed the version string in an independent file to save time on building
* all of the variants of Vertical
*
* Revision 1.3 2001/06/06 12:10:22 mjames
* Move from HPUX
*
* Revision 1.2 2000/12/04 13:14:02 mjames
* Imported all of the PCB syntax readers.
*
* Converted "a/b" to mean "a" divided by "b" insted of a single string
* "a/b" in Verilog
*
* Revision 1.1.1.1 2000/10/19 21:58:38 mjames
* Mike put it here
*
*
* Revision 1.36 2000/10/04 10:37:05 10:37:05 mjames (Mike James)
* Modified for Vertical2 : support COMPONENTS and SIGNALS
*
* Revision 1.36 2000/10/04 10:37:05 10:37:05 mjames (Mike James)
* Part of Release PSAVAT01
*
* Revision 1.35 2000/10/02 11:04:13 11:04:13 mjames (Mike James)
* new_vhdl
*
* Revision 1.34 2000/09/27 14:42:13 14:42:13 mjames (Mike James)
* Part of Release Sep_27_ST_2000
*
* Revision 1.33 2000/09/27 10:45:08 10:45:08 mjames (Mike James)
* Corrected to use correct return code from yyparse()
*
* Revision 1.32 2000/09/21 10:15:43 10:15:43 mjames (Mike James)
* Part of Release Sep21Alpha
*
* Revision 1.31 2000/08/25 09:57:11 09:57:11 mjames (Mike James)
* Part of Release Aug25_alpha
*
* Revision 1.30 2000/08/16 08:57:27 08:57:27 mjames (Mike James)
* Part of Release CD01_Aug2000
*
* Revision 1.29 2000/08/14 14:45:09 14:45:09 mjames (Mike James)
* Part of Release Aug_14_2000
*
* Revision 1.28 2000/08/11 08:30:29 08:30:29 mjames (Mike James)
* Part of Release Aug_11_2000
*
* Revision 1.27 2000/08/09 10:31:43 10:31:43 mjames (Mike James)
* Part of Release Aug__9_2000
*
* Revision 1.26 2000/05/31 11:42:52 11:42:52 mjames (Mike James)
* Part of Release May_31_2000
*
* Revision 1.25 2000/05/31 11:30:11 11:30:11 mjames (Mike James)
* Added acfread.ini file reading
*
* Revision 1.24 2000/05/08 17:01:35 17:01:35 mjames (Mike James)
* Part of Release May__8_2000
*
* Revision 1.23 2000/05/08 16:59:28 16:59:28 mjames (Mike James)
* Part of Release May__8_2000
*
* Revision 1.22 2000/05/08 16:57:04 16:57:04 mjames (Mike James)
* Part of Release May__8_2000
*
* Revision 1.21 2000/03/08 16:19:02 16:19:02 mjames (Mike James)
* New version including PC
*
* Revision 1.18 2000/01/20 15:58:44 15:58:44 mjames (Mike James)
* Part of Release R22
*
* Revision 1.17 99/12/22 11:15:24 11:15:24 mjames (Mike James)
* Part of Release Dec_22_1999
*
* Revision 1.16 99/06/25 14:35:32 14:35:32 mjames (Mike James)
* Added in reference to expression.h, but no changes made
* to the function of acfread yet.
*
* Revision 1.15 99/05/04 09:51:08 09:51:08 mjames (Mike James)
* General checkin
*
* Revision 1.13 98/02/11 11:26:01 11:26:01 mjames (Mike James)
* Checked in for version 6.2a
*
* Revision 1.12 97/04/23 08:42:53 08:42:53 mjames (Mike James)
* CHecked in for release rel23041997
*
* Revision 1.11 97/01/03 13:33:14 13:33:14 mjames (Mike James)
* Changed the order of printing the banner on startup so that it is before all
* other output from the tool.
*
* Revision 1.10 96/08/06 13:35:32 13:35:32 mjames (Mike James)
* Changed date of compile
*
* Revision 1.9 96/07/19 14:36:33 14:36:33 mjames (Mike James)
* Amended major revision
*
* Revision 1.8 1996/07/12 15:52:12 mjames
* Sorted out things like Alias and Jumpers
* Work Correctly
* Print COrrectly
*
* Revision 1.7 96/03/29 14:46:09 14:46:09 mjames (Mike James)
* Added VHDL netlist writing to the capabilities of ACFREAD
*
* Revision 1.6 96/03/18 13:50:34 13:50:34 mjames (Mike James)
* Real Revision 2.1
*
* Revision 1.3 96/02/13 09:13:04 09:13:04 mjames (Mike James)
* Updated to be version 2.0 with net joining
*
* Revision 1.2 96/02/07 16:01:19 16:01:19 mjames (Mike James)
* Added correct RCS header
*
* Revision 1.1 96/02/07 15:49:03 15:49:03 mjames (Mike James)
* Initial revision
*
* Revision 1.5 96/02/07 11:04:14 11:04:14 mjames (Mike James)
* Checkin before adding new command parsing to program
*
* Revision 1.4 96/01/10 13:12:59 13:12:59 mjames (Mike James)
* Works in debug mode with EPLD listings and PCB layout
*
* Revision 1.3 96/01/08 15:23:13 15:23:13 mjames (Mike James)
* Managing to make sense of things now
*
* Revision 1.2 96/01/07 20:23:01 Mike_James
*
* Revision 1.1 96/01/07 12:38:41 Mike_James
* Initial revision
*
* Revision 1.2 96/01/04 17:54:41 17:54:41 mjames (Mike James)
* Altered to conditionally debug
*
* Revision 1.1 96/01/04 10:17:57 10:17:57 mjames (Mike James)
* Initial revision
*
*/
/*
@title
PROGRAM frbread: Converter for .FRB files
@application external
@text
PCB netlist to ACFP converter. Looks for netlists in ASCII containing tags like:
@listing
.HEA
.END
.TIM
.UNI
.JOB
.TYP
.APP
.ADD_COM
.ADD_TER
.ATT_COM
.ATT_TRE
.TER
@text
Commonly seen with a '.FRB' file suffix or '.CDI' file suffix.
More common Racal-Zuken CadStar
file format.
One of several file formats the Southampton
Drawing office is likely to hand out. See also PROGRAM repread and PROGRAM rep2read.
@break
Invocation
@listing
frbread <frb_file> [d]
@text
The frb file name is the first argument, the third argument is a debug flag.
If a lower
case 'd' is present, the Bison parser (interpreter of keywords and syntax) prints extremely
verbose diagnostics.
@break
Normally the acfp file produced on standard output is redirected to a file e.g.
@listing
frbread file.frb > file.acfp
@text
Will produce file.acfp from file.frb.
@break
Following this it is necessary to run the output through Vertical again in order to
set up properties on nets (power and ground being made not routable for instance) using the
del routable command. Alternatively the acfp file can be edited to set the net routing flags
for these nets.
@end
*/
#include "cmdlog.h"
#include "cmdparse.h"
#include "database.h"
#include "expression.h"
#include "generic.h"
#include "printout.h"
#include "routing.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ident \
"@(#)$Header: /cygwin/cvsroot/vertical/frb_main.c,v 1.10 2002/09/09 10:36:19 mjames Exp $";
#if defined YYDEBUG
extern int yydebug;
#else
int yydebug = 0;
#endif
extern FILE *yyin;
int main (int argc, char *argv[])
{
InitialiseData ();
ExecuteString (
"echo running \\$(VERTICAL_INIT) file name = $(VERTICAL_INIT) ",
argc - 1,
(argv + 1));
ExecuteString ("do $(VERTICAL_INIT) ", argc - 2, (argv + 2));
Log (LOG_GENERAL, "# Finished initialisation script\n");
print_header (stdout, "'frbread': From Drawing Office file");
yydebug = 0;
if (argc > 2 && argv[2][0] == 'd')
yydebug = 1;
if (argc > 1)
yyin
= fopen (argv
[1], "r");
else
yyin = stdin;
if (!yyin)
printf ("cannot open input file (%s)\n", argv
[1]);
else
while (yyparse () == 0)
;
perform_routing (Free);
list_database (stdout, 0); /* no jumpers 0= do not flatten them */
list_devices (
stdout,
PRINT_TYPE | PRINT_EXPAND_BUS | PRINT_GENERIC | PRINT_GROUP | PRINT_ROUTE_FLAGS |
PRINT_EQUIVALENT_PINS);
}