diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2014-04-10 23:43:20 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2014-04-10 23:43:20 -0700 |
commit | 116c35a02190c427a0a2aeea729915f0e05ab90b (patch) | |
tree | 5d8f1cb0fb6d724fbc7cd557b2da5ea7362e8412 /src/misc/extra | |
parent | 17c382c33a168aadb86d76ed6200dbbd8098229f (diff) | |
download | abc-116c35a02190c427a0a2aeea729915f0e05ab90b.tar.gz abc-116c35a02190c427a0a2aeea729915f0e05ab90b.tar.bz2 abc-116c35a02190c427a0a2aeea729915f0e05ab90b.zip |
Improving K-map printout.
Diffstat (limited to 'src/misc/extra')
-rw-r--r-- | src/misc/extra/extraBddKmap.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/misc/extra/extraBddKmap.c b/src/misc/extra/extraBddKmap.c index 23bf2224..e91172bb 100644 --- a/src/misc/extra/extraBddKmap.c +++ b/src/misc/extra/extraBddKmap.c @@ -22,6 +22,10 @@ #include "extraBdd.h" +#ifdef WIN32 +#include <windows.h> +#endif + ABC_NAMESPACE_IMPL_START @@ -119,7 +123,11 @@ ABC_NAMESPACE_IMPL_START #define UNDERSCORE (char)95 //#define SYMBOL_ZERO (char)248 // degree sign //#define SYMBOL_ZERO (char)'o' +#ifdef WIN32 +#define SYMBOL_ZERO (char)'0' +#else #define SYMBOL_ZERO (char)' ' +#endif #define SYMBOL_ONE (char)'1' #define SYMBOL_DC (char)'-' #define SYMBOL_OVERLAP (char)'?' @@ -418,6 +426,26 @@ void Extra_PrintKMap( ValueOffSet = Cudd_Cofactor( dd, OffSet, Prod ); Cudd_Ref( ValueOffSet ); Cudd_RecursiveDeref( dd, Prod ); +#ifdef WIN32 + { + HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE); + char Symb = 0, Color = 0; + if ( ValueOnSet == b1 && ValueOffSet == b0 ) + Symb = SYMBOL_ONE, Color = 14; // yellow + else if ( ValueOnSet == b0 && ValueOffSet == b1 ) + Symb = SYMBOL_ZERO, Color = 11; // blue + else if ( ValueOnSet == b0 && ValueOffSet == b0 ) + Symb = SYMBOL_DC, Color = 10; // green + else if ( ValueOnSet == b1 && ValueOffSet == b1 ) + Symb = SYMBOL_OVERLAP, Color = 12; // red + else + assert(0); + SetConsoleTextAttribute( hConsole, Color ); + fprintf( Output, "%c", Symb ); + SetConsoleTextAttribute( hConsole, 7 ); + } +#else + { if ( ValueOnSet == b1 && ValueOffSet == b0 ) fprintf( Output, "%c", SYMBOL_ONE ); else if ( ValueOnSet == b0 && ValueOffSet == b1 ) @@ -428,6 +456,8 @@ void Extra_PrintKMap( fprintf( Output, "%c", SYMBOL_OVERLAP ); else assert(0); + } +#endif Cudd_RecursiveDeref( dd, ValueOnSet ); Cudd_RecursiveDeref( dd, ValueOffSet ); |