/*
* $Id: orcad_main.c,v 1.1.1.1 2003/11/04 23:34:58 mjames Exp $
*
* $Log: orcad_main.c,v $
* Revision 1.1.1.1 2003/11/04 23:34:58 mjames
* Imported into local repositrory
*
* Revision 1.4 2002/09/09 10:36:20 mjames
* Checkpoint checkin
*
* Revision 1.3 2002/08/14 12:07:29 mjames
* Added an 'external' tag to the documentation
*
* Revision 1.3 2002/04/04 15:04:27 mjames
* Fixed #ident problem
*
* Revision 1.2 2001/10/31 22:20:10 mjames
* Tidying up problematical comments caused by CVS
* 'intelligent' comment guessing
*
* Revision 1.1 2001/10/23 21:11:38 mjames
* Added in an Orcad reader into Vertical
*
*
*
*/
/*
@title
PROGRAM orcadread: Converter for orcad files
@application external
@text
PCB netlist to ACFP converter. The netlist file has net names in the first column of the
file and then connected pins on the net listed as indented by one character.
@break
Example Netlist
@listing
stuff above line of --- ignored
-------------------------------
NETNAME1
U1.A1 U2.A3
NETNAME2
U3.A4 U2.A1
U1.12 I2.33
@text
Invocation
@listing
orcadread <orcad_file> [ d ]
@text
If a lower
case 'd' is present as the second argument, 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
orcadread file.txt > file.acfp
@text
Will produce file.acfp from file.txt.
@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
delete routable command. Alternatively the acfp file can be edited to set the net routing
flags for these nets.
@break
Netlist is commonly seen with a '.REP' file suffix. One of several file formats the Southampton
Drawing office is likely to hand out. See also PROGRAM frbread
and PROGRAM repread .
@end
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#if defined HAS_TCL
#include "tcl_l.h"
#endif
#include "cmdlog.h"
#include "cmdparse.h"
#include "database.h"
#include "expression.h"
#include "generic.h"
#include "printout.h"
#include "routing.h"
#ident \
"@(#)$Header: c:\\cygwin\\cvsroot/Vert03/orcad_src/orcad_main.c,v 1.1.1.1 2003/11/04 23:34:58 mjames Exp $";
#if defined YYDEBUG
extern int yydebug;
#else
int yydebug = 1;
#endif
extern FILE *yyin;
int main (int argc, char *argv[])
{
InitialiseData ();
ExecuteString (
"echo running \\$(VERTICAL_INIT) filen ame = $(VERTICAL_INIT) ",
argc - 1,
(argv + 1));
ExecuteString ("do $(VERTICAL_INIT) ", argc - 2, (argv + 2));
Log (LOG_GENERAL, "# Finished initialisation script\n");
print_header (stdout, "'orcadread': From ORCAD text 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)
Log (LOG_ERROR, "cannot open input file (%s)\n", argv[1]);
else
while (yyparse () == 0)
;
perform_routing (Free);
list_database (stdout, 0);
list_devices (
stdout,
PRINT_TYPE | PRINT_EXPAND_BUS | PRINT_GENERIC | PRINT_GROUP | PRINT_ROUTE_FLAGS |
PRINT_EQUIVALENT_PINS);
}