1 /**CFile****************************************************************
2 
3   FileName    [mainInit.c]
4 
5   SystemName  [ABC: Logic synthesis and verification system.]
6 
7   PackageName [The main package.]
8 
9   Synopsis    [Initialization procedures.]
10 
11   Author      [Alan Mishchenko]
12 
13   Affiliation [UC Berkeley]
14 
15   Date        [Ver. 1.0. Started - June 20, 2005.]
16 
17   Revision    [$Id: mainInit.c,v 1.3 2005/09/14 22:53:37 casem Exp $]
18 
19 ***********************************************************************/
20 
21 #include "base/abc/abc.h"
22 #include "mainInt.h"
23 
24 ABC_NAMESPACE_IMPL_START
25 
26 ////////////////////////////////////////////////////////////////////////
27 ///                        DECLARATIONS                              ///
28 ////////////////////////////////////////////////////////////////////////
29 
30 extern void Abc_Init( Abc_Frame_t * pAbc );
31 extern void Abc_End ( Abc_Frame_t * pAbc );
32 extern void Io_Init( Abc_Frame_t * pAbc );
33 extern void Io_End ( Abc_Frame_t * pAbc );
34 extern void Cmd_Init( Abc_Frame_t * pAbc );
35 extern void Cmd_End ( Abc_Frame_t * pAbc );
36 extern void If_Init( Abc_Frame_t * pAbc );
37 extern void If_End ( Abc_Frame_t * pAbc );
38 extern void Map_Init( Abc_Frame_t * pAbc );
39 extern void Map_End ( Abc_Frame_t * pAbc );
40 extern void Mio_Init( Abc_Frame_t * pAbc );
41 extern void Mio_End ( Abc_Frame_t * pAbc );
42 extern void Super_Init( Abc_Frame_t * pAbc );
43 extern void Super_End ( Abc_Frame_t * pAbc );
44 extern void Libs_Init( Abc_Frame_t * pAbc );
45 extern void Libs_End( Abc_Frame_t * pAbc );
46 extern void Load_Init( Abc_Frame_t * pAbc );
47 extern void Load_End( Abc_Frame_t * pAbc );
48 extern void Scl_Init( Abc_Frame_t * pAbc );
49 extern void Scl_End( Abc_Frame_t * pAbc );
50 extern void Wlc_Init( Abc_Frame_t * pAbc );
51 extern void Wlc_End( Abc_Frame_t * pAbc );
52 extern void Bac_Init( Abc_Frame_t * pAbc );
53 extern void Bac_End( Abc_Frame_t * pAbc );
54 extern void Cba_Init( Abc_Frame_t * pAbc );
55 extern void Cba_End( Abc_Frame_t * pAbc );
56 extern void Pla_Init( Abc_Frame_t * pAbc );
57 extern void Pla_End( Abc_Frame_t * pAbc );
58 extern void Sim_Init( Abc_Frame_t * pAbc );
59 extern void Sim_End( Abc_Frame_t * pAbc );
60 extern void Test_Init( Abc_Frame_t * pAbc );
61 extern void Test_End( Abc_Frame_t * pAbc );
62 extern void Abc2_Init( Abc_Frame_t * pAbc );
63 extern void Abc2_End ( Abc_Frame_t * pAbc );
64 extern void Abc85_Init( Abc_Frame_t * pAbc );
65 extern void Abc85_End( Abc_Frame_t * pAbc );
66 extern void Glucose_Init( Abc_Frame_t *pAbc );
67 extern void Glucose_End( Abc_Frame_t * pAbc );
68 
69 static Abc_FrameInitializer_t* s_InitializerStart = NULL;
70 static Abc_FrameInitializer_t* s_InitializerEnd = NULL;
71 
Abc_FrameAddInitializer(Abc_FrameInitializer_t * p)72 void Abc_FrameAddInitializer( Abc_FrameInitializer_t* p )
73 {
74     if( ! s_InitializerStart )
75         s_InitializerStart = p;
76 
77     p->next = NULL;
78     p->prev = s_InitializerEnd;
79 
80     if ( s_InitializerEnd )
81         s_InitializerEnd->next = p;
82 
83     s_InitializerEnd = p;
84 
85 }
86 
87 ////////////////////////////////////////////////////////////////////////
88 ///                     FUNCTION DEFINITIONS                         ///
89 ////////////////////////////////////////////////////////////////////////
90 
91 /**Function*************************************************************
92 
93   Synopsis    [Starts all the packages.]
94 
95   Description []
96 
97   SideEffects []
98 
99   SeeAlso     []
100 
101 ***********************************************************************/
Abc_FrameInit(Abc_Frame_t * pAbc)102 void Abc_FrameInit( Abc_Frame_t * pAbc )
103 {
104     Abc_FrameInitializer_t* p;
105     Cmd_Init( pAbc );
106     Cmd_CommandExecute( pAbc, "set checkread" );
107     Io_Init( pAbc );
108     Abc_Init( pAbc );
109     If_Init( pAbc );
110     Map_Init( pAbc );
111     Mio_Init( pAbc );
112     Super_Init( pAbc );
113     Libs_Init( pAbc );
114     Load_Init( pAbc );
115     Scl_Init( pAbc );
116     Wlc_Init( pAbc );
117     Bac_Init( pAbc );
118     Cba_Init( pAbc );
119     Pla_Init( pAbc );
120     Sim_Init( pAbc );
121     Test_Init( pAbc );
122     Glucose_Init( pAbc );
123     for( p = s_InitializerStart ; p ; p = p->next )
124         if(p->init)
125             p->init(pAbc);
126 }
127 
128 
129 /**Function*************************************************************
130 
131   Synopsis    [Stops all the packages.]
132 
133   Description []
134 
135   SideEffects []
136 
137   SeeAlso     []
138 
139 ***********************************************************************/
Abc_FrameEnd(Abc_Frame_t * pAbc)140 void Abc_FrameEnd( Abc_Frame_t * pAbc )
141 {
142     Abc_FrameInitializer_t* p;
143     for( p = s_InitializerEnd ; p ; p = p->prev )
144         if ( p->destroy )
145             p->destroy(pAbc);
146     Abc_End( pAbc );
147     Io_End( pAbc );
148     Cmd_End( pAbc );
149     If_End( pAbc );
150     Map_End( pAbc );
151     Mio_End( pAbc );
152     Super_End( pAbc );
153     Libs_End( pAbc );
154     Load_End( pAbc );
155     Scl_End( pAbc );
156     Wlc_End( pAbc );
157     Bac_End( pAbc );
158     Cba_End( pAbc );
159     Pla_End( pAbc );
160     Sim_End( pAbc );
161     Test_End( pAbc );
162     Glucose_End( pAbc );
163 }
164 
165 
166 ////////////////////////////////////////////////////////////////////////
167 ///                       END OF FILE                                ///
168 ////////////////////////////////////////////////////////////////////////
169 
170 
171 ABC_NAMESPACE_IMPL_END
172 
173