50 int LevelMax, Prev, Level, i;
54 fprintf( stdout,
"Cannot visualize AIG with more than 200 nodes.\n" );
57 if ( (pFile = fopen( pFileName,
"w" )) == NULL )
59 fprintf( stdout,
"Cannot open the intermediate file \"%s\".\n", pFileName );
72 pNode->
Level = LevelMax;
75 fprintf( pFile,
"# %s\n",
"AIG structure generated by IVY package" );
76 fprintf( pFile,
"\n" );
77 fprintf( pFile,
"digraph AIG {\n" );
78 fprintf( pFile,
"size = \"7.5,10\";\n" );
81 fprintf( pFile,
"center = true;\n" );
85 fprintf( pFile,
"edge [dir = back];\n" );
86 fprintf( pFile,
"\n" );
89 fprintf( pFile,
"{\n" );
90 fprintf( pFile,
" node [shape = plaintext];\n" );
91 fprintf( pFile,
" edge [style = invis];\n" );
92 fprintf( pFile,
" LevelTitle1 [label=\"\"];\n" );
93 fprintf( pFile,
" LevelTitle2 [label=\"\"];\n" );
95 for ( Level = LevelMax; Level >= 0; Level-- )
98 fprintf( pFile,
" Level%d", Level );
99 fprintf( pFile,
" [label = " );
101 fprintf( pFile,
"\"" );
102 fprintf( pFile,
"\"" );
103 fprintf( pFile,
"];\n" );
107 fprintf( pFile,
" LevelTitle1 -> LevelTitle2 ->" );
108 for ( Level = LevelMax; Level >= 0; Level-- )
111 fprintf( pFile,
" Level%d", Level );
114 fprintf( pFile,
" ->" );
116 fprintf( pFile,
";" );
118 fprintf( pFile,
"\n" );
119 fprintf( pFile,
"}" );
120 fprintf( pFile,
"\n" );
121 fprintf( pFile,
"\n" );
124 fprintf( pFile,
"{\n" );
125 fprintf( pFile,
" rank = same;\n" );
126 fprintf( pFile,
" LevelTitle1;\n" );
127 fprintf( pFile,
" title1 [shape=plaintext,\n" );
128 fprintf( pFile,
" fontsize=20,\n" );
129 fprintf( pFile,
" fontname = \"Times-Roman\",\n" );
130 fprintf( pFile,
" label=\"" );
131 fprintf( pFile,
"%s",
"AIG structure visualized by ABC" );
132 fprintf( pFile,
"\\n" );
133 fprintf( pFile,
"Benchmark \\\"%s\\\". ",
"aig" );
135 fprintf( pFile,
"\"\n" );
136 fprintf( pFile,
" ];\n" );
137 fprintf( pFile,
"}" );
138 fprintf( pFile,
"\n" );
139 fprintf( pFile,
"\n" );
142 fprintf( pFile,
"{\n" );
143 fprintf( pFile,
" rank = same;\n" );
144 fprintf( pFile,
" LevelTitle2;\n" );
145 fprintf( pFile,
" title2 [shape=plaintext,\n" );
146 fprintf( pFile,
" fontsize=18,\n" );
147 fprintf( pFile,
" fontname = \"Times-Roman\",\n" );
148 fprintf( pFile,
" label=\"" );
149 fprintf( pFile,
"The set contains %d logic nodes and spans %d levels.",
Aig_ManNodeNum(pMan), LevelMax );
150 fprintf( pFile,
"\\n" );
151 fprintf( pFile,
"\"\n" );
152 fprintf( pFile,
" ];\n" );
153 fprintf( pFile,
"}" );
154 fprintf( pFile,
"\n" );
155 fprintf( pFile,
"\n" );
158 fprintf( pFile,
"{\n" );
159 fprintf( pFile,
" rank = same;\n" );
161 fprintf( pFile,
" Level%d;\n", LevelMax );
174 fprintf( pFile,
" Node%d [label = \"%d\"", pNode->
Id, pNode->
Id );
176 fprintf( pFile,
", shape = %s",
"invtriangle" );
177 fprintf( pFile,
", color = coral, fillcolor = coral" );
178 fprintf( pFile,
"];\n" );
180 fprintf( pFile,
"}" );
181 fprintf( pFile,
"\n" );
182 fprintf( pFile,
"\n" );
185 for ( Level = LevelMax - 1; Level > 0; Level-- )
187 fprintf( pFile,
"{\n" );
188 fprintf( pFile,
" rank = same;\n" );
190 fprintf( pFile,
" Level%d;\n", Level );
193 if ( (
int)pNode->
Level != Level )
202 fprintf( pFile,
" Node%d [label = \"%d\"", pNode->
Id, pNode->
Id );
204 fprintf( pFile,
", shape = ellipse" );
205 if ( vBold && pNode->
fMarkB )
206 fprintf( pFile,
", style = filled" );
207 fprintf( pFile,
"];\n" );
209 fprintf( pFile,
"}" );
210 fprintf( pFile,
"\n" );
211 fprintf( pFile,
"\n" );
215 fprintf( pFile,
"{\n" );
216 fprintf( pFile,
" rank = same;\n" );
218 fprintf( pFile,
" Level%d;\n", 0 );
224 fprintf( pFile,
" Node%d [label = \"Const1\"", pNode->
Id );
225 fprintf( pFile,
", shape = ellipse" );
226 fprintf( pFile,
", color = coral, fillcolor = coral" );
227 fprintf( pFile,
"];\n" );
241 fprintf( pFile,
" Node%d [label = \"%d\"", pNode->
Id, pNode->
Id );
243 fprintf( pFile,
", shape = %s",
"triangle" );
244 fprintf( pFile,
", color = coral, fillcolor = coral" );
245 fprintf( pFile,
"];\n" );
247 fprintf( pFile,
"}" );
248 fprintf( pFile,
"\n" );
249 fprintf( pFile,
"\n" );
252 fprintf( pFile,
"title1 -> title2 [style = invis];\n" );
254 fprintf( pFile,
"title2 -> Node%d [style = invis];\n", pNode->
Id );
260 fprintf( pFile,
"Node%d -> Node%d [style = invis];\n", Prev, pNode->
Id );
270 fprintf( pFile,
"Node%d", pNode->
Id );
271 fprintf( pFile,
" -> " );
273 fprintf( pFile,
" [" );
274 fprintf( pFile,
"style = %s",
Aig_ObjFaninC0(pNode)?
"dotted" :
"bold" );
277 fprintf( pFile,
"]" );
278 fprintf( pFile,
";\n" );
282 fprintf( pFile,
"Node%d", pNode->
Id );
283 fprintf( pFile,
" -> " );
285 fprintf( pFile,
" [" );
286 fprintf( pFile,
"style = %s",
Aig_ObjFaninC1(pNode)?
"dotted" :
"bold" );
289 fprintf( pFile,
"]" );
290 fprintf( pFile,
";\n" );
315 fprintf( pFile,
"}" );
316 fprintf( pFile,
"\n" );
317 fprintf( pFile,
"\n" );
344 char FileNameDot[200];
348 sprintf( FileNameDot,
"temp%02d.dot", Counter++ );
350 if ( (pFile = fopen( FileNameDot,
"w" )) == NULL )
352 fprintf( stdout,
"Cannot open the intermediate file \"%s\".\n", FileNameDot );
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
static int Aig_ObjFaninId0(Aig_Obj_t *pObj)
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
static Aig_Obj_t * Aig_ObjFanin0(Aig_Obj_t *pObj)
#define Aig_ManForEachCi(p, pObj, i)
ITERATORS ///.
#define Aig_ManForEachCo(p, pObj, i)
static int Aig_ObjFaninId1(Aig_Obj_t *pObj)
ABC_NAMESPACE_IMPL_START void Aig_WriteDotAig(Aig_Man_t *pMan, char *pFileName, int fHaig, Vec_Ptr_t *vBold)
DECLARATIONS ///.
static int Aig_ManNodeNum(Aig_Man_t *p)
static int Aig_ObjIsNode(Aig_Obj_t *pObj)
static int Aig_ObjIsBuf(Aig_Obj_t *pObj)
#define ABC_NAMESPACE_IMPL_END
ABC_NAMESPACE_IMPL_START void Abc_ShowFile(char *FileNameDot)
DECLARATIONS ///.
static int Aig_ObjFaninC0(Aig_Obj_t *pObj)
static Aig_Obj_t * Aig_ManConst1(Aig_Man_t *p)
#define ABC_NAMESPACE_IMPL_START
#define Aig_ManForEachObj(p, pObj, i)
static int Aig_ObjFaninC1(Aig_Obj_t *pObj)
void Aig_ManShow(Aig_Man_t *pMan, int fHaig, Vec_Ptr_t *vBold)
static int Aig_ObjRefs(Aig_Obj_t *pObj)
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
int Aig_ManLevels(Aig_Man_t *p)
static int Aig_ObjIsCo(Aig_Obj_t *pObj)