Subversion Repositories Vertical

Rev

Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 mjames 1
/* contains the database functions that store the pin configurations
2
 *
11 mjames 3
 * $Header: c:\\cygwin\\cvsroot/Vert03/rep2_src/rep2_main.c,v 1.1.1.1 2003/11/04 23:34:58 mjames Exp $
2 mjames 4
 *
5
 * $Log: rep2_main.c,v $
6
 * Revision 1.1.1.1  2003/11/04 23:34:58  mjames
7
 * Imported into local repositrory
8
 *
9
 * Revision 1.4  2002/08/14 12:05:56  mjames
10
 * Added an 'external' tag to the documentation
11
 *
12
 * Revision 1.4  2002/04/04 15:04:26  mjames
13
 * Fixed #ident problem
14
 *
15
 * Revision 1.3  2001/10/31 22:20:15  mjames
16
 * Tidying up problematical comments caused by CVS
17
 * 'intelligent' comment guessing
18
 *
19
 * Revision 1.2  2001/10/22 10:56:05  mjames
20
 * Modified list_devices to take an options flag
21
 *
22
 * Revision 1.1  2001/10/02 20:52:58  mjames
23
 * Another .REP file format reader
24
 *
25
 */
26
 
27
/*
28
@title
29
PROGRAM rep2read: Converter number 2 for .REP files
30
@application external
31
@text
11 mjames 32
PCB netlist to ACFP converter. The netlist file has net names in the first column of the
2 mjames 33
file and then connected pins on the net listed as indented by one character.
34
@break
35
Example Netlist
36
@listing
37
X1      12 NETNAME1 1230 4190 Bottom
38
U1      A4 NETNAME1 1240 4190 Bottom
39
G1      12  1250 4190 Bottom
40
X1      A2 NETNAME2 1260 4200 Bottom
41
@text
42
This reads
43
Socket Pin_identifer Netname
44
@break
11 mjames 45
The columns following the (optional) netname
2 mjames 46
(if missing there are 2 spaces) are the X and Y location
47
of the pin and the PCB layer.
48
Invocation
11 mjames 49
@listing
2 mjames 50
rep2read <rep_file> [ d ]
51
@text
11 mjames 52
If a lower  
53
case 'd' is present as the second argument, the Bison parser
2 mjames 54
(interpreter of keywords and syntax) prints extremely verbose diagnostics.
55
@break
56
Normally the acfp file produced on standard output is redirected to a file e.g.
57
@listing
58
rep2read file.rep > file.acfp
59
@text
60
Will produce file.acfp from file.rep.
61
@break
62
Following this it is necessary to run the output through Vertical again in order to
11 mjames 63
set up properties on nets (power and ground being made not routable for instance) using the
2 mjames 64
delete routable command. Alternatively the acfp file can be edited to set the net routing
65
flags for these nets.
66
@break
67
Netlist is commonly seen with a '.REP' file suffix. One of several file formats the Southampton
68
Drawing office is likely to hand out. See also PROGRAM frbread
69
and PROGRAM repread .
70
@end
71
*/
72
 
73
#include <stdio.h>
11 mjames 74
#include <string.h>
2 mjames 75
#include <stdlib.h>
76
#if defined HAS_TCL
77
#include "tcl_l.h"
78
#endif
79
#include "expression.h"
80
#include "generic.h"
11 mjames 81
#include "database.h"
2 mjames 82
#include "printout.h"
83
#include "routing.h"
11 mjames 84
#include "cmdparse.h"
85
#include "cmdlog.h"
86
#include "yacc_common.h"
2 mjames 87
 
11 mjames 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 $"
2 mjames 89
 
11 mjames 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
 
111
  list_database(stdout,0);
112
    list_devices(stdout,
113
         PRINT_TYPE|PRINT_EXPAND_BUS|
114
         PRINT_GENERIC|PRINT_GROUP|
115
         PRINT_ROUTE_FLAGS | PRINT_EQUIVALENT_PINS);
116
  }