/* net_main*/
/* contains the database functions that store the pin configurations */
/*
* $Header: c:\\cygwin\\cvsroot/Vert03/net_src/net_main.c,v 1.1.1.1 2003/11/04 23:34:59 mjames Exp $
*
* $Log: net_main.c,v $
* Revision 1.1.1.1 2003/11/04 23:34:59 mjames
* Imported into local repositrory
*
* Revision 1.10 2002/09/09 10:36:20 mjames
* Checkpoint checkin
*
* Revision 1.9 2002/08/14 12:08:43 mjames
* Added an 'external' tag to the documentation
*
* Revision 1.9 2002/04/04 15:04:27 mjames
* Fixed #ident problem
*
* Revision 1.8 2001/10/31 22:20:09 mjames
* Tidying up problematical comments caused by CVS
* 'intelligent' comment guessing
*
* Revision 1.7 2001/10/22 10:59:03 mjames
* Modified list_devices to take an options flag
*
* Revision 1.6 2001/10/02 20:53:28 mjames
* Moved documentation about code to main program module.
*
* Revision 1.5 2001/09/28 14:34:11 mjames
* FIxed yydebug variable to exist when YYDEBUG macro
* is not defined. Otherwise linker error will be reported.
*
* Revision 1.4 2001/07/09 15:47:36 mjames
* Placed the version string in an independent file to save time on building
* all of the variants of Vertical
*
* Revision 1.3 2001/06/06 12:10:20 mjames
* Move from HPUX
*
* Revision 1.2 2000/12/04 13:14:03 mjames
* Imported all of the PCB syntax readers.
*
* Converted "a/b" to mean "a" divided by "b" insted of a single string
* "a/b" in Verilog
*
* Revision 1.1.1.1 2000/10/19 21:58:38 mjames
* Mike put it here
*
*
* Revision 1.26 2000/10/04 10:37:07 10:37:07 mjames (Mike James)
* Modified for Vertical2 : support COMPONENTS and SIGNALS
*
* Revision 1.26 2000/10/04 10:37:07 10:37:07 mjames (Mike James)
* Part of Release PSAVAT01
*
* Revision 1.25 2000/10/02 11:04:16 11:04:16 mjames (Mike James)
* new_vhdl
*
* Revision 1.24 2000/09/27 14:42:17 14:42:17 mjames (Mike James)
* Part of Release Sep_27_ST_2000
*
* Revision 1.23 2000/09/27 10:57:51 10:57:51 mjames (Mike James)
* Using correct return code from yyparse()
*
* Revision 1.22 2000/09/21 10:15:47 10:15:47 mjames (Mike James)
* Part of Release Sep21Alpha
*
* Revision 1.21 2000/08/25 09:57:13 09:57:13 mjames (Mike James)
* Part of Release Aug25_alpha
*
* Revision 1.20 2000/08/16 08:57:29 08:57:29 mjames (Mike James)
* Part of Release CD01_Aug2000
*
* Revision 1.19 2000/08/14 14:45:10 14:45:10 mjames (Mike James)
* Part of Release Aug_14_2000
*
* Revision 1.18 2000/08/11 08:30:31 08:30:31 mjames (Mike James)
* Part of Release Aug_11_2000
*
* Revision 1.17 2000/08/09 10:31:46 10:31:46 mjames (Mike James)
* Part of Release Aug__9_2000
*
* Revision 1.16 2000/05/31 11:42:55 11:42:55 mjames (Mike James)
* Part of Release May_31_2000
*
* Revision 1.15 2000/05/31 11:30:16 11:30:16 mjames (Mike James)
* Added acfread.ini file reading
*
* Revision 1.14 2000/05/08 17:01:36 17:01:36 mjames (Mike James)
* Part of Release May__8_2000
*
* Revision 1.13 2000/05/08 16:59:30 16:59:30 mjames (Mike James)
* Part of Release May__8_2000
*
* Revision 1.12 2000/05/08 16:57:06 16:57:06 mjames (Mike James)
* Part of Release May__8_2000
*
* Revision 1.11 2000/03/08 16:19:17 16:19:17 mjames (Mike James)
* New version including PC
*
* Revision 1.8 2000/01/20 15:58:46 15:58:46 mjames (Mike James)
* Part of Release R22
*
* Revision 1.7 99/12/22 11:15:27 11:15:27 mjames (Mike James)
* Part of Release Dec_22_1999
*
* Revision 1.6 99/06/25 14:35:44 14:35:44 mjames (Mike James)
* Added in reference to expression.h, but no changes made
* to the function of acfread yet.
*
* Revision 1.5 99/05/04 09:52:29 09:52:29 mjames (Mike James)
* General checkin
*
* Revision 1.3 98/02/11 11:26:44 11:26:44 mjames (Mike James)
* Checked in for version 6.2a
*
* Revision 1.2 97/04/23 08:43:16 08:43:16 mjames (Mike James)
* CHecked in for release rel23041997
*
* Revision 1.1 97/01/03 13:32:40 13:32:40 mjames (Mike James)
* Initial revision
*
*
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
/*
@title
PROGRAM netread: Converter for .NET files
@application external
@text
PCB netlist to ACFP converter. Looks for netlists in ASCII containing tags like:
@listing
$PACKAGES
$NETS
$END
@text
Invocation
@listing
netread <net_file> [ d ]
@text
If a lower
case 'd' is present as the second argument, the Bison parser
(interpreter of keywords and syntax) prints extremely verbose diagnostics.
@break
Normally the acfp file produced on standard output is redirected to a file e.g.
@listing
netread file.net > file.acfp
@text
Will produce file.acfp from file.net.
@break
Following this it is necessary to run the output through Vertical again in order to
set up properties on nets (power and ground being made not routable for instance) using the
delete routable command. Alternatively the acfp file can be edited to set the net routing
flags for these nets.
@break
Netlist is commonly seen with a '.NET' file suffix. Lots of exclamation marks '!' in the
netlist file.I believe this format comes from Mentor Graphics.
@end
*/
#if defined HAS_TCL
#include "tcl_l.h"
#endif
#include "expression.h"
#include "generic.h"
#include "database.h"
#include "printout.h"
#include "routing.h"
#include "cmdparse.h"
#include "cmdlog.h"
#ident "@(#)$Header: c:\\cygwin\\cvsroot/Vert03/net_src/net_main.c,v 1.1.1.1 2003/11/04 23:34:59 mjames Exp $"
#if defined YYDEBUG
extern int yydebug;
#else
int yydebug = 0;
#endif
extern FILE * yyin;
int main(int argc , char * argv[])
{
InitialiseData();
ExecuteString("echo running \\$(VERTICAL_INIT) file name = $(VERTICAL_INIT) ", argc-1, (argv+1));
ExecuteString("do $(VERTICAL_INIT) ", argc-2, (argv+2));
Log(LOG_GENERAL,
"# Finished initialisation script\n");
print_header(stdout,"'netread': From .net file");
yydebug = 0;
if (argc>2 && argv[2][0]=='d')
yydebug = 1;
if (argc>1)
yyin
= fopen(argv
[1],"r");
else
yyin = stdin;
if(!yyin)
printf("cannot open input file (%s)\n",argv
[1]);
else
while(yyparse()==0);
perform_routing(Free);
list_database(stdout,0); /*no jumpers so flatten jumpers arg=0 */
list_devices(stdout,
PRINT_TYPE|PRINT_EXPAND_BUS|
PRINT_GENERIC|PRINT_GROUP|
PRINT_ROUTE_FLAGS | PRINT_EQUIVALENT_PINS);
}