Subversion Repositories Vertical

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 mjames 1
/* net_main*/
2
 
3
/* contains the database functions that store the pin configurations */
4
 
5
/*
6
 * $Header: C:/cvsroot/Vert03/mentor_src/mentor_main.c,v 1.2 2004/06/22 21:44:12 mjames Exp $
7
 *
8
 * $Log: mentor_main.c,v $
9
 * Revision 1.2  2004/06/22 21:44:12  mjames
10
 * Firrst build most files
11
 *
12
 * Revision 1.2  2002/08/22 08:31:19  mjames
13
 * Converted to using #ident as the CVS identifier string place holder.
14
 *
15
 * Amended the comments intended for HTML help.
16
 *
17
 * Revision 1.1  2002/08/14 12:13:01  mjames
18
 * Mentor Board Station reader modified to work with latest .nets file format
19
 *
20
 * Revision 1.1  2002/04/04 14:53:06  mjames
21
 * Added mentor board station reader to the portfolio
22
 *
23
 * Initial revision
24
 *
25
 *
26
 */
27
#include <stdio.h>
28
#include <stdlib.h>
29
#include <string.h>
30
/*
31
@title
32
PROGRAM mentor_read: Converter for .NET files
33
@application external
34
@text
35
PCB netlist to ACFP converter. If a file comes from Mentor Board station
36
use this one.
37
@break
38
Looks for netlists in ASCII containing tags like:
39
@listing
40
NET
41
@text
42
Invocation
43
@listing
44
mentor_read <net_file> [ d ]
45
@text
46
If a lower
47
case 'd' is present as the second argument, the Bison parser
48
(interpreter of keywords and syntax) prints extremely verbose diagnostics.
49
@break
50
Normally the acfp file produced on standard output is redirected to a file e.g.
51
@listing
52
mentor_read file.net > file.acfp
53
@text
54
Will produce file.acfp from file.net.
55
@break
56
Following this it is necessary to run the output through Vertical again in order to
57
set up properties on nets (power and ground being made not routable for instance) using the
58
delete routable command. Alternatively the acfp file can be edited to set the net routing
59
flags for these nets.
60
@break
61
There are some hints in the netlist, where attributes of some nets are given. These will appear
62
as comments at the top of the .acfp file produced. These may help identify power and ground
63
pins.
64
@break
65
If the attribute is NET_TYPE and the value following is
66
@listing
67
POWER
68
SUPPLY
69
POWERS
70
GROUND
71
HI-CURRENT
72
@text
73
Mentor_read will automatically set any nets with any attribute set to be not routable. Use set
74
routable in Vertical to allow these nets to be routable.
75
@break
76
Netlist is commonly seen with a '.NET' or '.NETS' file suffix.
77
This format comes from Mentor Graphics. It also mentions Board Station in the header of the
78
file.
79
@end
80
*/
81
 
82
#if defined HAS_TCL
83
#include "tcl_l.h"
84
#endif
85
#include "cmdlog.h"
86
#include "cmdparse.h"
87
#include "database.h"
88
#include "expression.h"
89
#include "generic.h"
90
#include "printout.h"
91
#include "routing.h"
92
#ident                                                                                        \
93
    "@(#)$Header: C:/cvsroot/Vert03/mentor_src/mentor_main.c,v 1.2 2004/06/22 21:44:12 mjames Exp $"
94
#if defined YYDEBUG
95
extern int yydebug;
96
#else
97
int yydebug = 0;
98
#endif
99
extern FILE *yyin;
100
int main (int argc, char *argv[])
101
{
102
        InitialiseData ();
103
        ExecuteString (
104
            "echo running \\$(VERTICAL_INIT) file name = $(VERTICAL_INIT) ",
105
            argc - 1,
106
            (argv + 1));
107
        ExecuteString ("do $(VERTICAL_INIT) ", argc - 2, (argv + 2));
108
        Log (LOG_GENERAL, "# Finished initialisation script\n");
109
        print_header (stdout, "'mentor_read': From .net file");
110
        yydebug = 0;
111
 
112
        if (argc > 2 && argv[2][0] == 'd')
113
                yydebug = 1;
114
 
115
        if (argc > 1)
116
                yyin = fopen (argv[1], "r");
117
        else
118
                yyin = stdin;
119
        if (!yyin)
120
                printf ("cannot open input file (%s)\n", argv[1]);
121
        else
122
                while (yyparse () == 0)
123
                        ;
124
 
125
        perform_routing (Free);
126
        list_database (stdout, 0); /*no jumpers so flatten jumpers arg=0 */
127
        list_devices (
128
            stdout,
129
            PRINT_TYPE | PRINT_EXPAND_BUS | PRINT_GENERIC | PRINT_GROUP | PRINT_ROUTE_FLAGS |
130
                PRINT_EQUIVALENT_PINS);
131
}