Commit f34029dd by Alan Mishchenko

Improvements in AIG visualization.

parent 8b6de217
...@@ -290,7 +290,7 @@ void Gia_ShowPath( Gia_Man_t * p, char * pFileName ) ...@@ -290,7 +290,7 @@ void Gia_ShowPath( Gia_Man_t * p, char * pFileName )
fprintf( pFile, " -> " ); fprintf( pFile, " -> " );
fprintf( pFile, "Node%d", Gia_ObjFaninId0p(p, pNode) ); fprintf( pFile, "Node%d", Gia_ObjFaninId0p(p, pNode) );
fprintf( pFile, " [" ); fprintf( pFile, " [" );
fprintf( pFile, "style = %s", "bold" ); fprintf( pFile, "style = %s", "solid" );
fprintf( pFile, "]" ); fprintf( pFile, "]" );
fprintf( pFile, ";\n" ); fprintf( pFile, ";\n" );
} }
...@@ -308,7 +308,7 @@ void Gia_ShowPath( Gia_Man_t * p, char * pFileName ) ...@@ -308,7 +308,7 @@ void Gia_ShowPath( Gia_Man_t * p, char * pFileName )
fprintf( pFile, " -> " ); fprintf( pFile, " -> " );
fprintf( pFile, "Node%d", iFan ); fprintf( pFile, "Node%d", iFan );
fprintf( pFile, " [" ); fprintf( pFile, " [" );
fprintf( pFile, "style = %s", "bold" ); fprintf( pFile, "style = %s", "solid" );
fprintf( pFile, "]" ); fprintf( pFile, "]" );
fprintf( pFile, ";\n" ); fprintf( pFile, ";\n" );
} }
...@@ -583,7 +583,7 @@ void Gia_WriteDotAigSimple( Gia_Man_t * p, char * pFileName, Vec_Int_t * vBold ) ...@@ -583,7 +583,7 @@ void Gia_WriteDotAigSimple( Gia_Man_t * p, char * pFileName, Vec_Int_t * vBold )
fprintf( pFile, " -> " ); fprintf( pFile, " -> " );
fprintf( pFile, "Node%d", Gia_ObjFaninId0(pNode, i) ); fprintf( pFile, "Node%d", Gia_ObjFaninId0(pNode, i) );
fprintf( pFile, " [" ); fprintf( pFile, " [" );
fprintf( pFile, "style = %s", Gia_ObjFaninC0(pNode)? "dotted" : "bold" ); fprintf( pFile, "style = %s", Gia_ObjFaninC0(pNode)? "dotted" : "solid" );
// if ( Gia_NtkIsSeq(pNode->p) && Seq_ObjFaninL0(pNode) > 0 ) // if ( Gia_NtkIsSeq(pNode->p) && Seq_ObjFaninL0(pNode) > 0 )
// fprintf( pFile, ", label = \"%s\"", Seq_ObjFaninGetInitPrintable(pNode,0) ); // fprintf( pFile, ", label = \"%s\"", Seq_ObjFaninGetInitPrintable(pNode,0) );
fprintf( pFile, "]" ); fprintf( pFile, "]" );
...@@ -595,7 +595,7 @@ void Gia_WriteDotAigSimple( Gia_Man_t * p, char * pFileName, Vec_Int_t * vBold ) ...@@ -595,7 +595,7 @@ void Gia_WriteDotAigSimple( Gia_Man_t * p, char * pFileName, Vec_Int_t * vBold )
fprintf( pFile, " -> " ); fprintf( pFile, " -> " );
fprintf( pFile, "Node%d", Gia_ObjFaninId1(pNode, i) ); fprintf( pFile, "Node%d", Gia_ObjFaninId1(pNode, i) );
fprintf( pFile, " [" ); fprintf( pFile, " [" );
fprintf( pFile, "style = %s", Gia_ObjFaninC1(pNode)? "dotted" : "bold" ); fprintf( pFile, "style = %s", Gia_ObjFaninC1(pNode)? "dotted" : "solid" );
// if ( Gia_NtkIsSeq(pNode->p) && Seq_ObjFaninL1(pNode) > 0 ) // if ( Gia_NtkIsSeq(pNode->p) && Seq_ObjFaninL1(pNode) > 0 )
// fprintf( pFile, ", label = \"%s\"", Seq_ObjFaninGetInitPrintable(pNode,1) ); // fprintf( pFile, ", label = \"%s\"", Seq_ObjFaninGetInitPrintable(pNode,1) );
fprintf( pFile, "]" ); fprintf( pFile, "]" );
...@@ -624,7 +624,7 @@ void Gia_WriteDotAigSimple( Gia_Man_t * p, char * pFileName, Vec_Int_t * vBold ) ...@@ -624,7 +624,7 @@ void Gia_WriteDotAigSimple( Gia_Man_t * p, char * pFileName, Vec_Int_t * vBold )
fprintf( pFile, "Node%d", pPrev->Id ); fprintf( pFile, "Node%d", pPrev->Id );
fprintf( pFile, " -> " ); fprintf( pFile, " -> " );
fprintf( pFile, "Node%d", pTemp->Id ); fprintf( pFile, "Node%d", pTemp->Id );
fprintf( pFile, " [style = %s]", Gia_IsComplement(pTemp->pEquiv)? "dotted" : "bold" ); fprintf( pFile, " [style = %s]", Gia_IsComplement(pTemp->pEquiv)? "dotted" : "solid" );
fprintf( pFile, ";\n" ); fprintf( pFile, ";\n" );
pPrev = pTemp; pPrev = pTemp;
} }
...@@ -632,7 +632,7 @@ void Gia_WriteDotAigSimple( Gia_Man_t * p, char * pFileName, Vec_Int_t * vBold ) ...@@ -632,7 +632,7 @@ void Gia_WriteDotAigSimple( Gia_Man_t * p, char * pFileName, Vec_Int_t * vBold )
fprintf( pFile, "Node%d", pPrev->Id ); fprintf( pFile, "Node%d", pPrev->Id );
fprintf( pFile, " -> " ); fprintf( pFile, " -> " );
fprintf( pFile, "Node%d", pNode->Id ); fprintf( pFile, "Node%d", pNode->Id );
fprintf( pFile, " [style = %s]", Gia_IsComplement(pPrev->pEquiv)? "dotted" : "bold" ); fprintf( pFile, " [style = %s]", Gia_IsComplement(pPrev->pEquiv)? "dotted" : "solid" );
fprintf( pFile, ";\n" ); fprintf( pFile, ";\n" );
} }
*/ */
...@@ -920,7 +920,7 @@ void Gia_WriteDotAig( Gia_Man_t * p, char * pFileName, Vec_Int_t * vBold, Vec_In ...@@ -920,7 +920,7 @@ void Gia_WriteDotAig( Gia_Man_t * p, char * pFileName, Vec_Int_t * vBold, Vec_In
fprintf( pFile, " -> " ); fprintf( pFile, " -> " );
fprintf( pFile, "Node%d", Gia_ShowAddOut(vAdds, vMapAdds, Gia_ObjFaninId0(pNode, iNode)) ); fprintf( pFile, "Node%d", Gia_ShowAddOut(vAdds, vMapAdds, Gia_ObjFaninId0(pNode, iNode)) );
fprintf( pFile, " [" ); fprintf( pFile, " [" );
fprintf( pFile, "style = %s", Gia_ObjFaninC0(pNode)? "dotted" : "bold" ); fprintf( pFile, "style = %s", Gia_ObjFaninC0(pNode)? "dotted" : "solid" );
fprintf( pFile, "]" ); fprintf( pFile, "]" );
fprintf( pFile, ";\n" ); fprintf( pFile, ";\n" );
} }
...@@ -933,11 +933,13 @@ void Gia_WriteDotAig( Gia_Man_t * p, char * pFileName, Vec_Int_t * vBold, Vec_In ...@@ -933,11 +933,13 @@ void Gia_WriteDotAig( Gia_Man_t * p, char * pFileName, Vec_Int_t * vBold, Vec_In
for ( k = 0; k < 3; k++ ) for ( k = 0; k < 3; k++ )
if ( Vec_IntEntry(vAdds, 6*iBox+k) ) if ( Vec_IntEntry(vAdds, 6*iBox+k) )
{ {
int iBox2 = Vec_IntEntry(vMapAdds, Vec_IntEntry(vAdds, 6*iBox+k));
int fXor2 = iBox2 >= 0 ? (int)(Vec_IntEntry(vAdds, 6*iBox2+3) == Vec_IntEntry(vAdds, 6*iBox+k)) : 0;
fprintf( pFile, "Node%d", Gia_ShowAddOut(vAdds, vMapAdds, iNode) ); fprintf( pFile, "Node%d", Gia_ShowAddOut(vAdds, vMapAdds, iNode) );
fprintf( pFile, " -> " ); fprintf( pFile, " -> " );
fprintf( pFile, "Node%d", Gia_ShowAddOut(vAdds, vMapAdds, Vec_IntEntry(vAdds, 6*iBox+k)) ); fprintf( pFile, "Node%d", Gia_ShowAddOut(vAdds, vMapAdds, Vec_IntEntry(vAdds, 6*iBox+k)) );
fprintf( pFile, " [" ); fprintf( pFile, " [" );
fprintf( pFile, "style = %s", 0? "dotted" : "bold" ); fprintf( pFile, "style = %s", fXor2? "bold" : "solid" );
fprintf( pFile, "]" ); fprintf( pFile, "]" );
fprintf( pFile, ";\n" ); fprintf( pFile, ";\n" );
} }
...@@ -949,11 +951,12 @@ void Gia_WriteDotAig( Gia_Man_t * p, char * pFileName, Vec_Int_t * vBold, Vec_In ...@@ -949,11 +951,12 @@ void Gia_WriteDotAig( Gia_Man_t * p, char * pFileName, Vec_Int_t * vBold, Vec_In
for ( k = 1; k < 4; k++ ) for ( k = 1; k < 4; k++ )
if ( Vec_IntEntry(vXors, 4*iXor+k) ) if ( Vec_IntEntry(vXors, 4*iXor+k) )
{ {
int iXor2 = Vec_IntEntry(vMapXors, Vec_IntEntry(vXors, 4*iXor+k));
fprintf( pFile, "Node%d", iNode ); fprintf( pFile, "Node%d", iNode );
fprintf( pFile, " -> " ); fprintf( pFile, " -> " );
fprintf( pFile, "Node%d", Gia_ShowAddOut(vAdds, vMapAdds, Vec_IntEntry(vXors, 4*iXor+k)) ); fprintf( pFile, "Node%d", Gia_ShowAddOut(vAdds, vMapAdds, Vec_IntEntry(vXors, 4*iXor+k)) );
fprintf( pFile, " [" ); fprintf( pFile, " [" );
fprintf( pFile, "style = %s", 0? "dotted" : "bold" ); fprintf( pFile, "style = %s", iXor2 >= 0? "bold" : "solid" );
fprintf( pFile, "]" ); fprintf( pFile, "]" );
fprintf( pFile, ";\n" ); fprintf( pFile, ";\n" );
} }
...@@ -964,7 +967,7 @@ void Gia_WriteDotAig( Gia_Man_t * p, char * pFileName, Vec_Int_t * vBold, Vec_In ...@@ -964,7 +967,7 @@ void Gia_WriteDotAig( Gia_Man_t * p, char * pFileName, Vec_Int_t * vBold, Vec_In
fprintf( pFile, " -> " ); fprintf( pFile, " -> " );
fprintf( pFile, "Node%d", Gia_ShowAddOut(vAdds, vMapAdds, Gia_ObjFaninId0(pNode, iNode)) ); fprintf( pFile, "Node%d", Gia_ShowAddOut(vAdds, vMapAdds, Gia_ObjFaninId0(pNode, iNode)) );
fprintf( pFile, " [" ); fprintf( pFile, " [" );
fprintf( pFile, "style = %s", Gia_ObjFaninC0(pNode)? "dotted" : "bold" ); fprintf( pFile, "style = %s", Gia_ObjFaninC0(pNode)? "dotted" : "solid" );
fprintf( pFile, "]" ); fprintf( pFile, "]" );
fprintf( pFile, ";\n" ); fprintf( pFile, ";\n" );
if ( !Gia_ObjIsAnd(pNode) ) if ( !Gia_ObjIsAnd(pNode) )
...@@ -974,7 +977,7 @@ void Gia_WriteDotAig( Gia_Man_t * p, char * pFileName, Vec_Int_t * vBold, Vec_In ...@@ -974,7 +977,7 @@ void Gia_WriteDotAig( Gia_Man_t * p, char * pFileName, Vec_Int_t * vBold, Vec_In
fprintf( pFile, " -> " ); fprintf( pFile, " -> " );
fprintf( pFile, "Node%d", Gia_ShowAddOut(vAdds, vMapAdds, Gia_ObjFaninId1(pNode, iNode)) ); fprintf( pFile, "Node%d", Gia_ShowAddOut(vAdds, vMapAdds, Gia_ObjFaninId1(pNode, iNode)) );
fprintf( pFile, " [" ); fprintf( pFile, " [" );
fprintf( pFile, "style = %s", Gia_ObjFaninC1(pNode)? "dotted" : "bold" ); fprintf( pFile, "style = %s", Gia_ObjFaninC1(pNode)? "dotted" : "solid" );
fprintf( pFile, "]" ); fprintf( pFile, "]" );
fprintf( pFile, ";\n" ); fprintf( pFile, ";\n" );
...@@ -985,7 +988,7 @@ void Gia_WriteDotAig( Gia_Man_t * p, char * pFileName, Vec_Int_t * vBold, Vec_In ...@@ -985,7 +988,7 @@ void Gia_WriteDotAig( Gia_Man_t * p, char * pFileName, Vec_Int_t * vBold, Vec_In
fprintf( pFile, " -> " ); fprintf( pFile, " -> " );
fprintf( pFile, "Node%d", Gia_ShowAddOut(vAdds, vMapAdds, Gia_ObjFaninId2(p, iNode)) ); fprintf( pFile, "Node%d", Gia_ShowAddOut(vAdds, vMapAdds, Gia_ObjFaninId2(p, iNode)) );
fprintf( pFile, " [" ); fprintf( pFile, " [" );
fprintf( pFile, "style = %s", Gia_ObjFaninC2(p, pNode)? "dotted" : "bold" ); fprintf( pFile, "style = %s", Gia_ObjFaninC2(p, pNode)? "dotted" : "solid" );
fprintf( pFile, "]" ); fprintf( pFile, "]" );
fprintf( pFile, ";\n" ); fprintf( pFile, ";\n" );
} }
......
...@@ -394,7 +394,7 @@ void Io_WriteDotNtk( Abc_Ntk_t * pNtk, Vec_Ptr_t * vNodes, Vec_Ptr_t * vNodesSho ...@@ -394,7 +394,7 @@ void Io_WriteDotNtk( Abc_Ntk_t * pNtk, Vec_Ptr_t * vNodes, Vec_Ptr_t * vNodesSho
fprintf( pFile, "Node%d", pNode->Id ); fprintf( pFile, "Node%d", pNode->Id );
fprintf( pFile, " -> " ); fprintf( pFile, " -> " );
fprintf( pFile, "Node%d", pFanin->Id ); fprintf( pFile, "Node%d", pFanin->Id );
fprintf( pFile, " [style = %s", fCompl? "dotted" : "bold" ); fprintf( pFile, " [style = %s", fCompl? "dotted" : "solid" );
// fprintf( pFile, ", label = \"%c\"", 'a' + k ); // fprintf( pFile, ", label = \"%c\"", 'a' + k );
fprintf( pFile, "]" ); fprintf( pFile, "]" );
fprintf( pFile, ";\n" ); fprintf( pFile, ";\n" );
...@@ -764,7 +764,7 @@ void Io_WriteDotSeq( Abc_Ntk_t * pNtk, Vec_Ptr_t * vNodes, Vec_Ptr_t * vNodesSho ...@@ -764,7 +764,7 @@ void Io_WriteDotSeq( Abc_Ntk_t * pNtk, Vec_Ptr_t * vNodes, Vec_Ptr_t * vNodesSho
fprintf( pFile, "Node%d", pNode->Id ); fprintf( pFile, "Node%d", pNode->Id );
fprintf( pFile, " -> " ); fprintf( pFile, " -> " );
fprintf( pFile, "Node%d", pFanin->Id ); fprintf( pFile, "Node%d", pFanin->Id );
fprintf( pFile, " [style = %s", fCompl? "dotted" : "bold" ); fprintf( pFile, " [style = %s", fCompl? "dotted" : "solid" );
// fprintf( pFile, ", label = \"%c\"", 'a' + k ); // fprintf( pFile, ", label = \"%c\"", 'a' + k );
fprintf( pFile, "]" ); fprintf( pFile, "]" );
fprintf( pFile, ";\n" ); fprintf( pFile, ";\n" );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment