51 char FileNameDot[200];
55 sprintf( FileNameDot,
"temp%02d.dot", Counter++ );
57 if ( (pFile = fopen( FileNameDot,
"w" )) == NULL )
59 fprintf( stdout,
"Cannot open the intermediate file \"%s\".\n", FileNameDot );
85 int LevelMax, Level, i;
89 fprintf( stdout,
"Cannot visualize AIG with more than 200 nodes.\n" );
92 if ( (pFile = fopen( pFileName,
"w" )) == NULL )
94 fprintf( stdout,
"Cannot open the intermediate file \"%s\".\n", pFileName );
107 fprintf( pFile,
"# %s\n",
"AIG structure generated by IVY package" );
108 fprintf( pFile,
"\n" );
109 fprintf( pFile,
"digraph AIG {\n" );
110 fprintf( pFile,
"size = \"7.5,10\";\n" );
113 fprintf( pFile,
"center = true;\n" );
117 fprintf( pFile,
"edge [dir = back];\n" );
118 fprintf( pFile,
"\n" );
121 fprintf( pFile,
"{\n" );
122 fprintf( pFile,
" node [shape = plaintext];\n" );
123 fprintf( pFile,
" edge [style = invis];\n" );
124 fprintf( pFile,
" LevelTitle1 [label=\"\"];\n" );
125 fprintf( pFile,
" LevelTitle2 [label=\"\"];\n" );
127 for ( Level = LevelMax; Level >= 0; Level-- )
130 fprintf( pFile,
" Level%d", Level );
131 fprintf( pFile,
" [label = " );
133 fprintf( pFile,
"\"" );
134 fprintf( pFile,
"\"" );
135 fprintf( pFile,
"];\n" );
139 fprintf( pFile,
" LevelTitle1 -> LevelTitle2 ->" );
140 for ( Level = LevelMax; Level >= 0; Level-- )
143 fprintf( pFile,
" Level%d", Level );
146 fprintf( pFile,
" ->" );
148 fprintf( pFile,
";" );
150 fprintf( pFile,
"\n" );
151 fprintf( pFile,
"}" );
152 fprintf( pFile,
"\n" );
153 fprintf( pFile,
"\n" );
156 fprintf( pFile,
"{\n" );
157 fprintf( pFile,
" rank = same;\n" );
158 fprintf( pFile,
" LevelTitle1;\n" );
159 fprintf( pFile,
" title1 [shape=plaintext,\n" );
160 fprintf( pFile,
" fontsize=20,\n" );
161 fprintf( pFile,
" fontname = \"Times-Roman\",\n" );
162 fprintf( pFile,
" label=\"" );
163 fprintf( pFile,
"%s",
"AIG structure visualized by ABC" );
164 fprintf( pFile,
"\\n" );
165 fprintf( pFile,
"Benchmark \\\"%s\\\". ",
"aig" );
167 fprintf( pFile,
"\"\n" );
168 fprintf( pFile,
" ];\n" );
169 fprintf( pFile,
"}" );
170 fprintf( pFile,
"\n" );
171 fprintf( pFile,
"\n" );
174 fprintf( pFile,
"{\n" );
175 fprintf( pFile,
" rank = same;\n" );
176 fprintf( pFile,
" LevelTitle2;\n" );
177 fprintf( pFile,
" title2 [shape=plaintext,\n" );
178 fprintf( pFile,
" fontsize=18,\n" );
179 fprintf( pFile,
" fontname = \"Times-Roman\",\n" );
180 fprintf( pFile,
" label=\"" );
181 fprintf( pFile,
"The set contains %d logic nodes and spans %d levels.",
Ivy_ManNodeNum(pMan), LevelMax );
182 fprintf( pFile,
"\\n" );
183 fprintf( pFile,
"\"\n" );
184 fprintf( pFile,
" ];\n" );
185 fprintf( pFile,
"}" );
186 fprintf( pFile,
"\n" );
187 fprintf( pFile,
"\n" );
190 fprintf( pFile,
"{\n" );
191 fprintf( pFile,
" rank = same;\n" );
193 fprintf( pFile,
" Level%d;\n", LevelMax );
197 if ( fHaig || pNode->
pEquiv == NULL )
198 fprintf( pFile,
" Node%d%s [label = \"%d%s\"", pNode->
Id,
201 fprintf( pFile,
" Node%d%s [label = \"%d%s(%d%s)\"", pNode->
Id,
204 fprintf( pFile,
", shape = %s", (
Ivy_ObjIsLatch(pNode)?
"box":
"invtriangle") );
205 fprintf( pFile,
", color = coral, fillcolor = coral" );
206 fprintf( pFile,
"];\n" );
208 fprintf( pFile,
"}" );
209 fprintf( pFile,
"\n" );
210 fprintf( pFile,
"\n" );
213 for ( Level = LevelMax - 1; Level > 0; Level-- )
215 fprintf( pFile,
"{\n" );
216 fprintf( pFile,
" rank = same;\n" );
218 fprintf( pFile,
" Level%d;\n", Level );
221 if ( (
int)pNode->
Level != Level )
223 if ( fHaig || pNode->
pEquiv == NULL )
224 fprintf( pFile,
" Node%d [label = \"%d\"", pNode->
Id, pNode->
Id );
226 fprintf( pFile,
" Node%d [label = \"%d(%d%s)\"", pNode->
Id, pNode->
Id,
228 fprintf( pFile,
", shape = ellipse" );
229 if ( vBold && pNode->
fMarkB )
230 fprintf( pFile,
", style = filled" );
231 fprintf( pFile,
"];\n" );
233 fprintf( pFile,
"}" );
234 fprintf( pFile,
"\n" );
235 fprintf( pFile,
"\n" );
239 fprintf( pFile,
"{\n" );
240 fprintf( pFile,
" rank = same;\n" );
242 fprintf( pFile,
" Level%d;\n", 0 );
248 fprintf( pFile,
" Node%d [label = \"Const1\"", pNode->
Id );
249 fprintf( pFile,
", shape = ellipse" );
250 fprintf( pFile,
", color = coral, fillcolor = coral" );
251 fprintf( pFile,
"];\n" );
256 if ( fHaig || pNode->
pEquiv == NULL )
257 fprintf( pFile,
" Node%d%s [label = \"%d%s\"", pNode->
Id,
260 fprintf( pFile,
" Node%d%s [label = \"%d%s(%d%s)\"", pNode->
Id,
263 fprintf( pFile,
", shape = %s", (
Ivy_ObjIsLatch(pNode)?
"box":
"triangle") );
264 fprintf( pFile,
", color = coral, fillcolor = coral" );
265 fprintf( pFile,
"];\n" );
267 fprintf( pFile,
"}" );
268 fprintf( pFile,
"\n" );
269 fprintf( pFile,
"\n" );
272 fprintf( pFile,
"title1 -> title2 [style = invis];\n" );
274 fprintf( pFile,
"title2 -> Node%d%s [style = invis];\n", pNode->
Id, (
Ivy_ObjIsLatch(pNode)?
"_in":
"") );
283 fprintf( pFile,
" -> " );
285 fprintf( pFile,
" [" );
286 fprintf( pFile,
"style = %s",
Ivy_ObjFaninC0(pNode)?
"dotted" :
"bold" );
289 fprintf( pFile,
"]" );
290 fprintf( pFile,
";\n" );
294 fprintf( pFile,
"Node%d", pNode->
Id );
295 fprintf( pFile,
" -> " );
297 fprintf( pFile,
" [" );
298 fprintf( pFile,
"style = %s",
Ivy_ObjFaninC1(pNode)?
"dotted" :
"bold" );
301 fprintf( pFile,
"]" );
302 fprintf( pFile,
";\n" );
309 fprintf( pFile,
"Node%d", pPrev->
Id );
310 fprintf( pFile,
" -> " );
311 fprintf( pFile,
"Node%d", pTemp->
Id );
313 fprintf( pFile,
";\n" );
317 fprintf( pFile,
"Node%d", pPrev->
Id );
318 fprintf( pFile,
" -> " );
319 fprintf( pFile,
"Node%d", pNode->
Id );
321 fprintf( pFile,
";\n" );
325 fprintf( pFile,
"}" );
326 fprintf( pFile,
"\n" );
327 fprintf( pFile,
"\n" );
static int Ivy_IsComplement(Ivy_Obj_t *p)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
static Ivy_Obj_t * Ivy_ManConst1(Ivy_Man_t *p)
int Ivy_ManSetLevels(Ivy_Man_t *p, int fHaig)
static ABC_NAMESPACE_IMPL_START void Ivy_WriteDotAig(Ivy_Man_t *pMan, char *pFileName, int fHaig, Vec_Ptr_t *vBold)
DECLARATIONS ///.
static int Ivy_ObjFaninId1(Ivy_Obj_t *pObj)
static int Ivy_ObjIsLatch(Ivy_Obj_t *pObj)
static Ivy_Obj_t * Ivy_ObjFanin1(Ivy_Obj_t *pObj)
static Ivy_Obj_t * Ivy_ObjFanin0(Ivy_Obj_t *pObj)
static int Ivy_ObjFaninId0(Ivy_Obj_t *pObj)
#define Ivy_ManForEachCo(p, pObj, i)
static int Ivy_ObjFaninC1(Ivy_Obj_t *pObj)
static int Ivy_ObjRefs(Ivy_Obj_t *pObj)
#define ABC_NAMESPACE_IMPL_END
ABC_NAMESPACE_IMPL_START void Abc_ShowFile(char *FileNameDot)
DECLARATIONS ///.
static Ivy_Obj_t * Ivy_Regular(Ivy_Obj_t *p)
static int Ivy_ObjIsCo(Ivy_Obj_t *pObj)
static int Ivy_ObjIsNode(Ivy_Obj_t *pObj)
#define Ivy_ManForEachCi(p, pObj, i)
void Ivy_ManShow(Ivy_Man_t *pMan, int fHaig, Vec_Ptr_t *vBold)
FUNCTION DEFINITIONS ///.
typedefABC_NAMESPACE_HEADER_START struct Ivy_Man_t_ Ivy_Man_t
INCLUDES ///.
#define ABC_NAMESPACE_IMPL_START
static int Ivy_ObjIsBuf(Ivy_Obj_t *pObj)
static int Ivy_ManNodeNum(Ivy_Man_t *p)
#define Ivy_ManForEachObj(p, pObj, i)
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
static int Ivy_ObjFaninC0(Ivy_Obj_t *pObj)