1 /****************************************************************************/
3 /* Chaine de CAO & VLSI Alliance */
5 /* Produit : GENIUS v1.00 */
6 /* Fichier : genius.c */
8 /* (c) copyright 1999 Laboratoire MASI equipe CAO & VLSI */
9 /* Tous droits reserves */
10 /* Support : e-mail alliance-support@asim.lip6.fr */
12 /* Auteur(s) : Francois DONNET le : 11/08/1999 */
14 /* Modifie par : le : ../../.... */
15 /* Modifie par : le : ../../.... */
16 /* Modifie par : le : ../../.... */
18 /****************************************************************************/
25 #include "gen_tree_utils.h"
27 #include "gen_tree_errors.h"
28 #include "gen_model_utils.h"
29 #include "gen_model_global.h"
30 #include "gen_verif_global.h"
31 #include "gen_execute_C.h"
34 #ifndef GENIUS_VERSION
35 #define GENIUS_VERSION "0.8"
38 #define PRIME 211 /* undivisable number */
40 /* LEX&YACC functions parser */
41 /* from gen_library_parser.yac */
42 extern lib_entry
*Read_Library(char* library
,char* path
);
43 /* from gen_tree_parser.yac */
44 extern tree_list
*Read_All();
48 extern int main(int argc
,char *argv
[]){
50 ptype_list
*p
,*bi_list
;
51 chain_list
*l
,*a
,*fcl
=NULL
,*genius
=NULL
;
54 /* init environment */
61 alliancebanner("genius",GENIUS_VERSION
,"GEneric Netlist Identification for User Specification","98-99","3.2");
63 /* ----> GENIUS_PRIORITY */
64 GENIUS_PRIORITY
= Read_Library(GENIUS_LIB_NAME
,GENIUS_LIB_PATH
);
65 if (!GENIUS_PRIORITY
) EXIT(0);
68 fprintf(stderr
,"\n%d error(s) detected, I can't get farther!!\n",err
);
72 GENIUS_TREE
= Read_All(GENIUS_PRIORITY
); /* ----> GENIUS_TREE */
75 fprintf(stderr
,"\n%d error(s) detected, I can't get farther!!\n",err
);
78 if (!GENIUS_TREE
) EXIT(0);
80 /*get a ptype_list for GENIUS and FCL */
81 bi_list
=Verif_All(GENIUS_TREE
);
82 for (p
=bi_list
; p
; p
=p
->NEXT
) {
83 if (p
->TYPE
==FCL
) fcl
=(chain_list
*)p
->DATA
;
84 if (p
->TYPE
==GENIUS
) genius
=(chain_list
*)p
->DATA
;
89 fprintf(stderr
,"\n%d error(s) detected, I can't get farther!!\n",err
);
92 Build_All_Models(GENIUS_TREE
,fcl
,genius
);
95 Free_Tree(GENIUS_TREE
);
100 for (a
=fcl
; a
; a
=a
->NEXT
) {
101 model_list
* model
=getmodel((char*)a
->DATA
);
103 fprintf(GENIUS_OUTPUT
,
104 "\n*************** Action of %s *****************\n",
106 Exec_C(model
->C
,NULL
);
110 for (a
=genius
; a
; a
=a
->NEXT
) {
111 model_list
* model
=getmodel((char*)a
->DATA
);
114 for (l
=model
->VAR
; l
; l
=l
->NEXT
) env
=addptype(env
,0,l
->DATA
);
115 env
=addptype(env
,(int)vectorradical(model
->NAME
),
116 vectorradical(model
->NAME
));
117 fprintf(GENIUS_OUTPUT
,
118 "\n*************** Action of %s *****************\n",
120 Exec_C(model
->C
,env
);
130 /*close file report .gen*/
131 if (GENIUS_OUTPUT
!=stdout
&& GENIUS_OUTPUT
!=stderr
) fclose(GENIUS_OUTPUT
);
133 /*file names are used for message and idetification in GENIUS*/
134 for (p
=GENIUS_PRIORITY
;p
;p
=p
->NEXT
) mbkfree(p
->DATA
);
135 freeptype(GENIUS_PRIORITY
);
136 GENIUS_PRIORITY
=NULL
;