From 472fb39f1602e8764275b32aa0220a1e64467df9 Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Sat, 19 Apr 2014 17:53:40 -0700 Subject: Adding color to mapping stats. --- src/aig/gia/giaIf.c | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) (limited to 'src/aig/gia/giaIf.c') diff --git a/src/aig/gia/giaIf.c b/src/aig/gia/giaIf.c index 9958a63c..c11fa841 100644 --- a/src/aig/gia/giaIf.c +++ b/src/aig/gia/giaIf.c @@ -25,6 +25,10 @@ #include "base/main/main.h" #include "sat/bsat/satSolver.h" +#ifdef WIN32 +#include +#endif + ABC_NAMESPACE_IMPL_START @@ -325,14 +329,34 @@ void Gia_ManPrintMappingStats( Gia_Man_t * p, char * pDumpFile ) Gia_ManForEachCo( p, pObj, i ) Ave += pLevels[Gia_ObjFaninId0p(p, pObj)]; ABC_FREE( pLevels ); + +#ifdef WIN32 + { + HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE); Abc_Print( 1, "Mapping (K=%d) : ", nLutSize ); - Abc_Print( 1, "lut =%7d ", nLuts ); + SetConsoleTextAttribute( hConsole, 14 ); // yellow + Abc_Print( 1, "lut =%7d ", nLuts ); + SetConsoleTextAttribute( hConsole, 10 ); // green Abc_Print( 1, "edge =%8d ", nFanins ); - Abc_Print( 1, "lev =%5d ", LevelMax ); - Abc_Print( 1, "(%.2f) ", (float)Ave / Gia_ManCoNum(p) ); + SetConsoleTextAttribute( hConsole, 11 ); // blue + Abc_Print( 1, "lev =%5d ", LevelMax ); + Abc_Print( 1, "(%.2f) ", (float)Ave / Gia_ManCoNum(p) ); + SetConsoleTextAttribute( hConsole, 7 ); // normal Abc_Print( 1, "over =%5.1f %% ", 100.0 * Gia_ManComputeOverlap(p) / Gia_ManAndNum(p) ); Abc_Print( 1, "mem =%5.2f MB", 4.0*(Gia_ManObjNum(p) + 2*nLuts + nFanins)/(1<<20) ); Abc_Print( 1, "\n" ); + } +#else + Abc_Print( 1, "Mapping (K=%d) : ", nLutSize ); + Abc_Print( 1, "%slut =%7d%s ", "\033[1;33m", nLuts, "\033[0m" ); // yellow + Abc_Print( 1, "%sedge =%8d%s ", "\033[1;32m", nFanins, "\033[0m" ); // green + Abc_Print( 1, "%slev =%5d%s ", "\033[1;36m", LevelMax, "\033[0m" ); // blue + Abc_Print( 1, "%s(%.2f)%s ", "\033[1;36m", (float)Ave / Gia_ManCoNum(p), "\033[0m" ); + Abc_Print( 1, "over =%5.1f %% ", 100.0 * Gia_ManComputeOverlap(p) / Gia_ManAndNum(p) ); + Abc_Print( 1, "mem =%5.2f MB", 4.0*(Gia_ManObjNum(p) + 2*nLuts + nFanins)/(1<<20) ); + Abc_Print( 1, "\n" ); +#endif + if ( pDumpFile ) { -- cgit v1.2.3