/* mentor_main*/
/* contains the database functions that store the pin configurations */
/*
* $Header: C:/cvsroot/Vert03/mentor_src/mentor_main.c,v 1.2 2004/06/22 21:44:12 mjames Exp $
*
* $Log: mentor_main.c,v $
* Revision 1.2 2004/06/22 21:44:12 mjames
* Firrst build most files
*
* Revision 1.2 2002/08/22 08:31:19 mjames
* Converted to using #ident as the CVS identifier string place holder.
*
* Amended the comments intended for HTML help.
*
* Revision 1.1 2002/08/14 12:13:01 mjames
* Mentor Board Station reader modified to work with latest .nets file format
*
* Revision 1.1 2002/04/04 14:53:06 mjames
* Added mentor board station reader to the portfolio
*
* Initial revision
*
*
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
/*
@title
PROGRAM mentor_read: Converter for .NET files
@application external
@text
PCB netlist to ACFP converter. If a file comes from Mentor Board station
use this one.
@break
Looks for netlists in ASCII containing tags like:
@listing
NET
@text
Invocation
@listing
mentor_read <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
mentor_read 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
There are some hints in the netlist, where attributes of some nets are given. These will appear as comments
at the top of the .acfp file produced. These may help identify power and
ground pins.
@break
If the attribute is NET_TYPE and the value following is
@listing
POWER
SUPPLY
POWERS
GROUND
HI-CURRENT
@text
Mentor_read will automatically set any nets with any attribute set to be not routable. Use set routable in Vertical
to allow these nets to be routable.
@break
Netlist is commonly seen with a '.NET' or '.NETS' file suffix.
This format comes from Mentor Graphics. It also mentions Board Station in the header of the file.
@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"
#include "yacc_common.h"
#ident "@(#)$Header: C:/cvsroot/Vert03/mentor_src/mentor_main.c,v 1.2 2004/06/22 21:44:12 mjames Exp $"
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,"'mentor_read': 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);
}