Subversion Repositories Vertical

Rev

Rev 2 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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