This commit was generated by cvs2svn to track changes on a CVS vendor
branch.
This commit is contained in:
commit
faba79f7fc
|
@ -0,0 +1 @@
|
|||
SUBDIRS = src
|
|
@ -0,0 +1,52 @@
|
|||
dnl
|
||||
dnl This file is part of the Alliance CAD System
|
||||
dnl Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
dnl Universite Pierre et Marie Curie
|
||||
dnl
|
||||
dnl Home page : http://www-asim.lip6.fr/alliance/
|
||||
dnl E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
dnl
|
||||
dnl This library is free software; you can redistribute it and/or modify it
|
||||
dnl under the terms of the GNU Library General Public License as published
|
||||
dnl by the Free Software Foundation; either version 2 of the License, or (at
|
||||
dnl your option) any later version.
|
||||
dnl
|
||||
dnl Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
dnl useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
dnl Public License for more details.
|
||||
dnl
|
||||
dnl You should have received a copy of the GNU General Public License along
|
||||
dnl with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
dnl Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
dnl
|
||||
dnl Purpose : Auto stuffing Alliance
|
||||
dnl Almost ten years since I wrote this stuff, I just can't
|
||||
dnl believe it
|
||||
dnl Date : 01/02/2002
|
||||
dnl Author : Frederic Petrot <Frederic.Petrot@lip6.fr>
|
||||
dnl $Id: configure.in,v 1.1 2002/03/13 10:19:11 fred Exp $
|
||||
dnl
|
||||
dnl
|
||||
AC_INIT(src/alc_pars_l.c)
|
||||
AM_INIT_AUTOMAKE(mbkal, 6.0)
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_CC
|
||||
AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS(strings.h unistd.h)
|
||||
AC_C_CONST
|
||||
AC_PROG_RANLIB
|
||||
|
||||
changequote(,)dnl
|
||||
INCLUDES=-I${ALLIANCE_TOP}/include
|
||||
LDFLAGS=-L${ALLIANCE_TOP}/lib
|
||||
changequote([,])dnl
|
||||
|
||||
AC_SUBST(INCLUDES)
|
||||
AC_SUBST(LDFLAGS)
|
||||
|
||||
|
||||
AC_OUTPUT([
|
||||
Makefile
|
||||
src/Makefile
|
||||
])
|
|
@ -0,0 +1,2 @@
|
|||
lib_LIBRARIES = libMal.a
|
||||
libMal_a_SOURCES = alc_driv_l.c alc_pars_l.c alc_pars_l6.c mal.h
|
|
@ -0,0 +1,297 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Library General Public License as published
|
||||
* by the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* *
|
||||
* Tool : Driver al *
|
||||
* Author(s) : Gregoire AVOT and many others, ... *
|
||||
* Updates : June, 12th 1998 *
|
||||
* $Log: alc_driv_l.c,v $
|
||||
* Revision 1.1 2002/03/13 10:19:11 fred
|
||||
* Initial revision
|
||||
* *
|
||||
*******************************************************************************/
|
||||
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
#include <limits.h>
|
||||
|
||||
#include <mut.h>
|
||||
#include <mlo.h>
|
||||
#include <rcn.h>
|
||||
|
||||
#define TAILLE_CHAINE BUFSIZE
|
||||
|
||||
/************************************************************************
|
||||
* get_date() *
|
||||
************************************************************************/
|
||||
|
||||
static void get_date(date)
|
||||
char * date;
|
||||
{
|
||||
time_t tim;
|
||||
struct tm *rest;
|
||||
|
||||
(void)time(&tim);
|
||||
rest=localtime(&tim);
|
||||
(void)sprintf(date,"%02d/%02d/%04d",rest->tm_mday,rest->tm_mon+1,rest->tm_year+1900);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* alc_decodedirection() *
|
||||
************************************************************************/
|
||||
|
||||
char * alc_decodedirection(dir)
|
||||
char dir;
|
||||
{
|
||||
switch(dir)
|
||||
{
|
||||
case IN :
|
||||
return "IN";
|
||||
case OUT :
|
||||
return "OUT";
|
||||
case INOUT :
|
||||
return "INOUT";
|
||||
case UNKNOWN :
|
||||
return "UNKNOWN";
|
||||
case TRISTATE :
|
||||
return "TRISTATE";
|
||||
case TRANSCV :
|
||||
return "TRANSCV";
|
||||
default :
|
||||
(void)fprintf(stderr,"\n*** mbk error *** savelofig (al) invalid connector direction : %c\n",dir);
|
||||
return "UNKNOWN";
|
||||
}
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* alc_decodetype() *
|
||||
************************************************************************/
|
||||
|
||||
char * alc_decodetype(type)
|
||||
char type;
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
case INTERNAL :
|
||||
return "INTERNAL";
|
||||
case EXTERNAL :
|
||||
return "EXTERNAL";
|
||||
default :
|
||||
(void)fprintf(stderr,"\n*** mbk error *** savelofig (al) invalid connector/signal type : %c\n",type);
|
||||
return "INTERNAL";
|
||||
}
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* rcn_wiretype() *
|
||||
************************************************************************/
|
||||
|
||||
char * rcn_wiretype(type)
|
||||
long type;
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
case RCN_WIRE_UNKNOW :
|
||||
return "X";
|
||||
case RCN_WIRE_POLY :
|
||||
return "PY";
|
||||
case RCN_WIRE_ALU1 :
|
||||
return "A1";
|
||||
case RCN_WIRE_ALU2 :
|
||||
return "A2";
|
||||
case RCN_WIRE_CONT_POLY :
|
||||
return "CY";
|
||||
case RCN_WIRE_CONT_DIF_N :
|
||||
return "CN";
|
||||
case RCN_WIRE_CONT_DIF_P :
|
||||
return "CP";
|
||||
case RCN_WIRE_CONT_VIA :
|
||||
return "CV";
|
||||
case RCN_WIRE_CONT_VIA2 :
|
||||
return "CW";
|
||||
case RCN_WIRE_CAPA :
|
||||
return "CA";
|
||||
case RCN_WIRE_RESI :
|
||||
return "RE";
|
||||
default :
|
||||
(void)fprintf(stderr,"\n*** rcn error *** savelofig (al) invalid node type : %ld\n",type);
|
||||
return "X";
|
||||
}
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* alcsavelofig() *
|
||||
************************************************************************/
|
||||
void alcsavelofig(pfig)
|
||||
lofig_list * pfig;
|
||||
{
|
||||
locon_list * pcon;
|
||||
lotrs_list * ptrs;
|
||||
loins_list * pins;
|
||||
losig_list * psig;
|
||||
lorcnet_list * ptrcnet;
|
||||
lowire_list * ptwire;
|
||||
chain_list * tmp;
|
||||
num_list * num;
|
||||
long index, indexg ,indexd, indexs, indexb;
|
||||
FILE *in;
|
||||
char nomfic[TAILLE_CHAINE];
|
||||
char nomp[TAILLE_CHAINE];
|
||||
num_list *tmpnum;
|
||||
loctc_list *ptctc;
|
||||
chain_list *scanchain;
|
||||
chain_list *headctc;
|
||||
|
||||
(void)sprintf(nomfic,"%s/%s.%s",WORK_LIB,pfig->NAME,OUT_LO);
|
||||
in=mbkfopen(pfig->NAME, OUT_LO, WRITE_TEXT);
|
||||
if(!in)
|
||||
{
|
||||
(void)fprintf(stderr,"\n*** mbk error *** savelofig (al) can't open file : %s\n",nomfic);
|
||||
EXIT(1);
|
||||
}
|
||||
if (TRACE_MODE == 'Y')
|
||||
{
|
||||
(void)printf("\n--- mbk --- writing the file : %s\n",nomfic);
|
||||
}
|
||||
/* reverse connectors, instances, etc. */
|
||||
/* Pourquoi ???
|
||||
pfig->LOCON = (locon_list *)reverse((chain_list *)pfig->LOCON);
|
||||
pfig->LOINS = (loins_list *)reverse((chain_list *)pfig->LOINS);
|
||||
pfig->LOTRS = (lotrs_list *)reverse((chain_list *)pfig->LOTRS);
|
||||
for(pins = pfig->LOINS ; pins ; pins = pins->NEXT)
|
||||
{
|
||||
pins->LOCON = (locon_list *)reverse((chain_list *)pins->LOCON);
|
||||
}
|
||||
*/
|
||||
/* write header */
|
||||
(void)fprintf(in,"V ALLIANCE : 6\n");
|
||||
get_date(nomp);
|
||||
(void)fprintf(in,"H %s,L,%s\n",pfig->NAME,nomp);
|
||||
/* write connectors of the figure */
|
||||
for (pcon = pfig->LOCON; pcon != NULL; pcon = pcon->NEXT)
|
||||
{
|
||||
(void)fprintf(in,"C %s,%s,%s,%ld",pcon->NAME,alc_decodedirection(pcon->DIRECTION),alc_decodetype(pcon->TYPE),pcon->SIG->INDEX);
|
||||
|
||||
for( num = pcon->PNODE ; num ; num=num->NEXT)
|
||||
{
|
||||
index = (long)num->DATA ;
|
||||
(void)fprintf(in,",%ld",index);
|
||||
}
|
||||
(void)fprintf(in,"\n");
|
||||
}
|
||||
/* write transistors */
|
||||
for (ptrs = pfig->LOTRS; ptrs != NULL; ptrs = ptrs->NEXT)
|
||||
{
|
||||
(void)fprintf(in,"T %c,%g,%g,%ld,%ld,%ld,%ld,%g,%g,%g,%g,%g,%g", (ptrs->TYPE == TRANSN)?'N':'P', (float)((float)(ptrs->LENGTH)/(float)SCALE_X), (float)((float)(ptrs->WIDTH)/(float)SCALE_X), ptrs->DRAIN->SIG->INDEX, ptrs->GRID->SIG->INDEX, ptrs->SOURCE->SIG->INDEX,(ptrs->BULK->SIG?ptrs->BULK->SIG->INDEX:0), (float)((float)(ptrs->XS)/(float)SCALE_X), (float)((float)(ptrs->XD)/(float)SCALE_X), (float)((float)(ptrs->PS)/(float)SCALE_X), (float)((float)(ptrs->PD)/(float)SCALE_X), (float)((float)(ptrs->X)/(float)SCALE_X), (float)((float)(ptrs->Y)/(float)SCALE_X));
|
||||
if ( !(tmpnum = ptrs->DRAIN->PNODE) )
|
||||
indexd = 0L;
|
||||
else
|
||||
indexd = tmpnum->DATA ;
|
||||
if ( !(tmpnum = ptrs->GRID->PNODE) )
|
||||
indexg = 0L;
|
||||
else
|
||||
indexg = tmpnum->DATA ;
|
||||
if ( !(tmpnum = ptrs->SOURCE->PNODE) )
|
||||
indexs = 0L;
|
||||
else
|
||||
indexs = tmpnum->DATA ;
|
||||
if ( !(tmpnum = ptrs->BULK->PNODE) )
|
||||
indexb = 0L;
|
||||
else
|
||||
indexb = tmpnum->DATA ;
|
||||
|
||||
if(indexd !=0L || indexg !=0L || indexs !=0L || indexb !=0l)
|
||||
{
|
||||
(void)fprintf(in,",%ld,%ld,%ld,%ld",indexd, indexg, indexs, indexb);
|
||||
}
|
||||
|
||||
(void)fprintf(in,",%s",ptrs->TRNAME?ptrs->TRNAME:"noname");
|
||||
(void)fprintf(in,"\n");
|
||||
}
|
||||
/* write instances */
|
||||
for (pins = pfig->LOINS; pins != NULL; pins = pins->NEXT)
|
||||
{
|
||||
(void)fprintf(in,"I %s,%s\n",pins->FIGNAME,pins->INSNAME);
|
||||
for (pcon = pins->LOCON; pcon != NULL; pcon = pcon->NEXT)
|
||||
{
|
||||
(void)fprintf(in,"C %s,%s,%s,%ld",pcon->NAME,alc_decodedirection(pcon->DIRECTION),alc_decodetype(pcon->TYPE),pcon->SIG->INDEX);
|
||||
for( num=pcon->PNODE ; num ; num = num->NEXT)
|
||||
{
|
||||
index = (long)((num_list *)num->DATA);
|
||||
(void)fprintf(in,",%ld",index);
|
||||
}
|
||||
(void)fprintf(in,"\n");
|
||||
}
|
||||
}
|
||||
/* write signals */
|
||||
for (psig = pfig->LOSIG; psig != NULL; psig = psig->NEXT)
|
||||
{
|
||||
(void)fprintf(in,"S %ld,%s",psig->INDEX,alc_decodetype(psig->TYPE) );
|
||||
for (tmp = psig->NAMECHAIN; tmp; tmp = tmp->NEXT)
|
||||
{
|
||||
(void)fprintf(in,",%s",(char *)(tmp->DATA));
|
||||
}
|
||||
(void)fprintf(in,"\n");
|
||||
|
||||
|
||||
if( psig->PRCN )
|
||||
{
|
||||
ptrcnet = psig->PRCN;
|
||||
if( ptrcnet->CAPA >= 0.0 )
|
||||
(void)fprintf(in,"Q %g\n",ptrcnet->CAPA);
|
||||
|
||||
|
||||
for (ptwire = ptrcnet->PWIRE; ptwire != NULL ; ptwire = ptwire->NEXT)
|
||||
(void)fprintf(in,"W %ld,%ld,%s,%g,%g,%g,%g,%g,%g\n",ptwire->NODE1, ptwire->NODE2, rcn_wiretype(ptwire->LAYER), ptwire->RESI, ptwire->CAPA, (float)((float)(ptwire->X)/(float)SCALE_X), (float)((float)(ptwire->Y)/(float)SCALE_X), (float)((float)(ptwire->DX)/(float)SCALE_X), (float)((float)(ptwire->DY)/(float)SCALE_X));
|
||||
}
|
||||
}
|
||||
|
||||
headctc = getallctc( pfig );
|
||||
for( scanchain = headctc ; scanchain ; scanchain = scanchain->NEXT )
|
||||
{
|
||||
ptctc = (loctc_list*)scanchain->DATA;
|
||||
(void)fprintf( in,"K %g,%ld,%ld,%ld,%ld\n", ptctc->CAPA, ptctc->SIG1->INDEX, ptctc->NODE1, ptctc->SIG2->INDEX, ptctc->NODE2 );
|
||||
}
|
||||
freechain( headctc );
|
||||
|
||||
(void)fputs("EOF\n",in);
|
||||
if (fclose(in) != 0)
|
||||
{
|
||||
(void)fprintf(stderr,"\n*** mbk error *** can't close file : %s\n",nomfic);
|
||||
EXIT(1);
|
||||
}
|
||||
|
||||
/* reverse back connectors, instances, etc. */
|
||||
/* iouqruoP ????
|
||||
pfig->LOCON = (locon_list *)reverse((chain_list *)pfig->LOCON);
|
||||
pfig->LOINS = (loins_list *)reverse((chain_list *)pfig->LOINS);
|
||||
pfig->LOTRS = (lotrs_list *)reverse((chain_list *)pfig->LOTRS);
|
||||
for(pins = pfig->LOINS ; pins ; pins = pins->NEXT)
|
||||
{
|
||||
pins->LOCON = (locon_list *)reverse((chain_list *)pins->LOCON);
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
|
@ -0,0 +1,119 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Library General Public License as published
|
||||
* by the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* *
|
||||
* Tool : Parser al *
|
||||
* Author(s) : Gregoire AVOT *
|
||||
* Updates : June, 12th 1998 *
|
||||
* $Log: alc_pars_l.c,v $
|
||||
* Revision 1.1 2002/03/13 10:19:11 fred
|
||||
* Initial revision
|
||||
*
|
||||
* *
|
||||
*******************************************************************************/
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <mut.h>
|
||||
#include <mlo.h>
|
||||
#include <rcn.h>
|
||||
#include <mlu.h>
|
||||
|
||||
#ident "@(#)Parser alliance logic v6 27 March 1999 by Gregoire AVOT"
|
||||
|
||||
#define TAILLE_CHAINE BUFSIZE
|
||||
|
||||
extern void alcloadlofig6 (lofig_list*, char*, char, FILE*, int );
|
||||
|
||||
/************************************************************************
|
||||
* alc_directiondecode() *
|
||||
************************************************************************/
|
||||
char alc_directiondecode(dir)
|
||||
char * dir;
|
||||
{
|
||||
switch (dir[2])
|
||||
{
|
||||
case 'O' :
|
||||
return 'B';
|
||||
case 'K' :
|
||||
return 'X';
|
||||
case 'I' :
|
||||
return 'Z';
|
||||
case 'A' :
|
||||
return 'T';
|
||||
default :
|
||||
return dir[0];
|
||||
}
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* alcloadlofig() *
|
||||
************************************************************************/
|
||||
|
||||
void alcloadlofig(pfig,fname,mode)
|
||||
lofig_list * pfig;
|
||||
char * fname;
|
||||
char mode;
|
||||
{
|
||||
FILE *in;
|
||||
char ligne[50];
|
||||
char nomfic[TAILLE_CHAINE];
|
||||
long i;
|
||||
|
||||
(void)sprintf(nomfic,"%s/%s.%s",WORK_LIB,fname,IN_LO);
|
||||
if ((in=mbkfopen(fname, IN_LO ,READ_TEXT)) == NULL)
|
||||
{
|
||||
(void)fprintf(stderr,"\n*** mbk error *** Unable to open file : %s\n",nomfic);
|
||||
EXIT(1);
|
||||
}
|
||||
if (TRACE_MODE == 'Y')
|
||||
{
|
||||
(void)printf("\n--- mbk --- parsing file : %s\n",nomfic);
|
||||
}
|
||||
(void)fgets(ligne,50,in);
|
||||
(void)sscanf(ligne,"V ALLIANCE : %ld", &i);
|
||||
if( i== 4 )
|
||||
alcloadlofig6( pfig, fname, mode, in, 4 );
|
||||
else
|
||||
if( i == 5 )
|
||||
alcloadlofig6( pfig, fname, mode, in, 5 );
|
||||
else
|
||||
if( i == 6 )
|
||||
alcloadlofig6( pfig, fname, mode, in, 6 );
|
||||
else
|
||||
{
|
||||
(void)fprintf(stderr,"\n*** mbk error *** unable to load file %s, too old version\n", fname);
|
||||
EXIT(1);
|
||||
}
|
||||
if (fclose(in) != 0)
|
||||
{
|
||||
(void)fprintf(stderr,"\n*** mbk error *** can't close file : %s\n",nomfic);
|
||||
EXIT(1);
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,67 @@
|
|||
#include <stdio.h>
|
||||
|
||||
#include <mut.h>
|
||||
#include <mlo.h>
|
||||
#include <rcn.h>
|
||||
|
||||
void Syntax( Name )
|
||||
|
||||
char *Name;
|
||||
{
|
||||
fprintf( stdout, "%s [options] in out\n", Name );
|
||||
|
||||
exit( 1 );
|
||||
}
|
||||
|
||||
int main( argc, argv )
|
||||
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
lofig_list *FigureMbk;
|
||||
|
||||
char *InputName;
|
||||
char *OutputName;
|
||||
int Number;
|
||||
|
||||
if ( argc < 2 )
|
||||
{
|
||||
Syntax( argv[ 0 ] );
|
||||
}
|
||||
|
||||
mbkenv();
|
||||
|
||||
if ( argc < 2 )
|
||||
{
|
||||
Syntax( argv[ 0 ] );
|
||||
}
|
||||
|
||||
InputName = (char *)NULL;
|
||||
OutputName = (char *)NULL;
|
||||
|
||||
for ( Number = 1;
|
||||
Number < argc;
|
||||
Number++ )
|
||||
{
|
||||
if ( InputName == NULL ) InputName = argv[ Number ];
|
||||
else
|
||||
if ( OutputName == NULL ) OutputName = argv[ Number ];
|
||||
}
|
||||
|
||||
if ( InputName == NULL )
|
||||
{
|
||||
Syntax( argv[ 0 ] );
|
||||
}
|
||||
|
||||
if ( OutputName == NULL )
|
||||
{
|
||||
OutputName = InputName;
|
||||
}
|
||||
|
||||
FigureMbk = getlofig( InputName, 'A' );
|
||||
FigureMbk->NAME = namealloc( OutputName );
|
||||
|
||||
savelofig( FigureMbk );
|
||||
|
||||
return( 0 );
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
/* Headers for mbkal v6.00 */
|
Loading…
Reference in New Issue