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
/* contains the database functions that store the pin configurations
1
/* contains the database functions that store the pin configurations
2
 *
2
 *
3
 * $Header: c:\\cygwin\\cvsroot/Vert03/rep2_src/rep2_main.c,v 1.1.1.1 2003/11/04 23:34:58
3
 * $Header: c:\\cygwin\\cvsroot/Vert03/rep2_src/rep2_main.c,v 1.1.1.1 2003/11/04 23:34:58 mjames Exp $
4
 * mjames Exp $
-
 
5
 *
4
 *
6
 * $Log: rep2_main.c,v $
5
 * $Log: rep2_main.c,v $
7
 * Revision 1.1.1.1  2003/11/04 23:34:58  mjames
6
 * Revision 1.1.1.1  2003/11/04 23:34:58  mjames
8
 * Imported into local repositrory
7
 * Imported into local repositrory
9
 *
8
 *
Line 28... Line 27...
28
/*
27
/*
29
@title
28
@title
30
PROGRAM rep2read: Converter number 2 for .REP files
29
PROGRAM rep2read: Converter number 2 for .REP files
31
@application external
30
@application external
32
@text
31
@text
33
PCB netlist to ACFP converter. The netlist file has net names in the first column of the
32
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.
33
file and then connected pins on the net listed as indented by one character.
35
@break
34
@break
36
Example Netlist
35
Example Netlist
37
@listing
36
@listing
38
X1      12 NETNAME1 1230 4190 Bottom
37
X1      12 NETNAME1 1230 4190 Bottom
Line 41... Line 40...
41
X1      A2 NETNAME2 1260 4200 Bottom
40
X1      A2 NETNAME2 1260 4200 Bottom
42
@text
41
@text
43
This reads
42
This reads
44
Socket Pin_identifer Netname
43
Socket Pin_identifer Netname
45
@break
44
@break
46
The columns following the (optional) netname
45
The columns following the (optional) netname
47
(if missing there are 2 spaces) are the X and Y location
46
(if missing there are 2 spaces) are the X and Y location
48
of the pin and the PCB layer.
47
of the pin and the PCB layer.
49
Invocation
48
Invocation
50
@listing
49
@listing
51
rep2read <rep_file> [ d ]
50
rep2read <rep_file> [ d ]
52
@text
51
@text
53
If a lower
52
If a lower  
54
case 'd' is present as the second argument, the Bison parser
53
case 'd' is present as the second argument, the Bison parser
55
(interpreter of keywords and syntax) prints extremely verbose diagnostics.
54
(interpreter of keywords and syntax) prints extremely verbose diagnostics.
56
@break
55
@break
57
Normally the acfp file produced on standard output is redirected to a file e.g.
56
Normally the acfp file produced on standard output is redirected to a file e.g.
58
@listing
57
@listing
59
rep2read file.rep > file.acfp
58
rep2read file.rep > file.acfp
60
@text
59
@text
61
Will produce file.acfp from file.rep.
60
Will produce file.acfp from file.rep.
62
@break
61
@break
63
Following this it is necessary to run the output through Vertical again in order to
62
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
63
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
64
delete routable command. Alternatively the acfp file can be edited to set the net routing
66
flags for these nets.
65
flags for these nets.
67
@break
66
@break
68
Netlist is commonly seen with a '.REP' file suffix. One of several file formats the Southampton
67
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
68
Drawing office is likely to hand out. See also PROGRAM frbread
70
and PROGRAM repread .
69
and PROGRAM repread .
71
@end
70
@end
72
*/
71
*/
73
 
72
 
74
#include <stdio.h>
73
#include <stdio.h>
75
#include <stdlib.h>
-
 
76
#include <string.h>
74
#include <string.h>
-
 
75
#include <stdlib.h>
77
#if defined HAS_TCL
76
#if defined HAS_TCL
78
#include "tcl_l.h"
77
#include "tcl_l.h"
79
#endif
78
#endif
80
#include "cmdlog.h"
-
 
81
#include "cmdparse.h"
-
 
82
#include "database.h"
-
 
83
#include "expression.h"
79
#include "expression.h"
84
#include "generic.h"
80
#include "generic.h"
-
 
81
#include "database.h"
85
#include "printout.h"
82
#include "printout.h"
86
#include "routing.h"
83
#include "routing.h"
-
 
84
#include "cmdparse.h"
-
 
85
#include "cmdlog.h"
-
 
86
#include "yacc_common.h"
87
 
87
 
88
#ident                                                                                        \
-
 
89
    "@(#)$Header: c:\\cygwin\\cvsroot/Vert03/rep2_src/rep2_main.c,v 1.1.1.1 2003/11/04 23:34:58 mjames Exp $";
88
#ident "@(#)$Header: c:\\cygwin\\cvsroot/Vert03/rep2_src/rep2_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) file name = $(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, "'rep2read': From .rep 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
 
89
 
-
 
90
int main(int argc , char * argv[])
-
 
91
  {
-
 
92
  InitialiseData();
-
 
93
  ExecuteString("echo running \\$(VERTICAL_INIT) file name = $(VERTICAL_INIT) ", argc-1, (argv+1));
-
 
94
  ExecuteString("do $(VERTICAL_INIT) ", argc-2, (argv+2));
-
 
95
  Log(LOG_GENERAL,
-
 
96
      "# Finished initialisation script\n");
-
 
97
  print_header(stdout,"'rep2read': From .rep file");
-
 
98
  yydebug = 0;
-
 
99
  if (argc>2 && argv[2][0]=='d')
-
 
100
    yydebug = 1;
-
 
101
  if (argc>1)
-
 
102
    yyin = fopen(argv[1],"r");
-
 
103
  else
-
 
104
    yyin = stdin;
-
 
105
  if(!yyin)
-
 
106
    Log(LOG_ERROR,"cannot open input file (%s)\n",argv[1]);
-
 
107
  else
-
 
108
    while(yyparse()==0);
-
 
109
  perform_routing(Free);
-
 
110
 
120
        list_database (stdout, 0);
111
  list_database(stdout,0);
121
        list_devices (
112
    list_devices(stdout,
122
            stdout,
113
         PRINT_TYPE|PRINT_EXPAND_BUS|
123
            PRINT_TYPE | PRINT_EXPAND_BUS | PRINT_GENERIC | PRINT_GROUP | PRINT_ROUTE_FLAGS |
114
         PRINT_GENERIC|PRINT_GROUP|
124
                PRINT_EQUIVALENT_PINS);
115
         PRINT_ROUTE_FLAGS | PRINT_EQUIVALENT_PINS);
125
}
116
  }