Subversion Repositories Vertical

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 mjames 1
/*
2
 * $Id: orcad_main.c,v 1.1.1.1 2003/11/04 23:34:58 mjames Exp $
3
 *
4
 * $Log: orcad_main.c,v $
5
 * Revision 1.1.1.1  2003/11/04 23:34:58  mjames
6
 * Imported into local repositrory
7
 *
8
 * Revision 1.4  2002/09/09 10:36:20  mjames
9
 * Checkpoint checkin
10
 *
11
 * Revision 1.3  2002/08/14 12:07:29  mjames
12
 * Added an 'external' tag to the documentation
13
 *
14
 * Revision 1.3  2002/04/04 15:04:27  mjames
15
 * Fixed #ident problem
16
 *
17
 * Revision 1.2  2001/10/31 22:20:10  mjames
18
 * Tidying up problematical comments caused by CVS
19
 * 'intelligent' comment guessing
20
 *
21
 * Revision 1.1  2001/10/23 21:11:38  mjames
22
 * Added in an Orcad reader into Vertical
23
 *
24
 *
25
 *
26
 */
27
 
28
/*
29
@title
30
PROGRAM orcadread: Converter for orcad 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
stuff above line of --- ignored
39
-------------------------------
40
NETNAME1
41
     U1.A1 U2.A3
42
 
43
NETNAME2
44
     U3.A4 U2.A1
45
     U1.12 I2.33
46
 
47
 
48
@text
49
Invocation
50
@listing
51
orcadread <orcad_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
orcadread file.txt > file.acfp
60
@text
61
Will produce file.acfp from file.txt.
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/orcad_src/orcad_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) filen ame = $(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, "'orcadread': From ORCAD text 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
}