/**Function************************************************************* Synopsis [Creates a new manager.] Description [] SideEffects [] SeeAlso [] ***********************************************************************/ ABC_Manager ABC_InitManager() { ABC_Manager_t * mng; Abc_Start(); mng = ABC_ALLOC( ABC_Manager_t, 1 ); memset( mng, 0, sizeof(ABC_Manager_t) ); mng->pNtk = Abc_NtkAlloc( ABC_NTK_LOGIC, ABC_FUNC_SOP, 1 ); mng->pNtk->pName = Extra_UtilStrsav("csat_network"); mng->tName2Node = stmm_init_table(strcmp, stmm_strhash); mng->tNode2Name = stmm_init_table(stmm_ptrcmp, stmm_ptrhash); mng->pMmNames = Mem_FlexStart(); mng->vNodes = Vec_PtrAlloc( 100 ); mng->vValues = Vec_IntAlloc( 100 ); mng->mode = 0; // set "resource-aware integration" as the default mode // set default parameters for CEC Prove_ParamsSetDefault( &mng->Params ); // set infinite resource limit for the final mitering // mng->Params.nMiteringLimitLast = ABC_INFINITY; return mng; }
/**Function************************************************************* Synopsis [The main() procedure.] Description [This procedure compiles into a stand-alone program for DAG-aware rewriting of the AIGs. A BLIF or PLA file to be considered for rewriting should be given as a command-line argument. Implementation of the rewriting is inspired by the paper: Per Bjesse, Arne Boralv, "DAG-aware circuit compression for formal verification", Proc. ICCAD 2004.] SideEffects [] SeeAlso [] ***********************************************************************/ int main( int argc, char * argv[] ) { // parameters int fUseResyn2 = 0; int fPrintStats = 1; int fVerify = 1; // variables void * pAbc; char * pFileName; char Command[1000]; clock_t clkRead, clkResyn, clkVer, clk; ////////////////////////////////////////////////////////////////////////// // get the input file name if ( argc != 2 ) { printf( "Wrong number of command-line arguments.\n" ); return 1; } pFileName = argv[1]; ////////////////////////////////////////////////////////////////////////// // start the ABC framework Abc_Start(); pAbc = Abc_FrameGetGlobalFrame(); // if ( Cmd_CommandExecute( pAbc, Command ) ) printf( "Reading = %6.2f sec ", (float)(clkRead)/(float)(CLOCKS_PER_SEC) ); printf( "Rewriting = %6.2f sec ", (float)(clkResyn)/(float)(CLOCKS_PER_SEC) ); printf( "Verification = %6.2f sec\n", (float)(clkVer)/(float)(CLOCKS_PER_SEC) ); ////////////////////////////////////////////////////////////////////////// // stop the ABC framework Abc_Stop(); return 0; }
/**Function************************************************************* Synopsis [The main() procedure.] Description [This procedure compiles into a stand-alone program for DAG-aware rewriting of the AIGs. A BLIF or PLA file to be considered for rewriting should be given as a command-line argument. Implementation of the rewriting is inspired by the paper: Per Bjesse, Arne Boralv, "DAG-aware circuit compression for formal verification", Proc. ICCAD 2004.] SideEffects [] SeeAlso [] ***********************************************************************/ int main( int argc, char * argv[] ) { // parameters int fUseResyn2 = 0; int fPrintStats = 1; int fVerify = 1; // variables void * pAbc; char * pFileName; char Command[1000]; int clkRead, clkResyn, clkVer, clk; ////////////////////////////////////////////////////////////////////////// // get the input file name if ( argc != 2 ) { printf( "Wrong number of command-line arguments.\n" ); return 1; } pFileName = argv[1]; ////////////////////////////////////////////////////////////////////////// // start the ABC framework Abc_Start(); pAbc = Abc_FrameGetGlobalFrame(); clk = clock(); ////////////////////////////////////////////////////////////////////////// // read the file sprintf( Command, "read %s", pFileName ); if ( Cmd_CommandExecute( pAbc, Command ) ) { fprintf( stdout, "Cannot execute command \"%s\".\n", Command ); return 1; } ////////////////////////////////////////////////////////////////////////// // balance sprintf( Command, "balance" ); if ( Cmd_CommandExecute( pAbc, Command ) ) { fprintf( stdout, "Cannot execute command \"%s\".\n", Command ); return 1; } clkRead = clock() - clk; ////////////////////////////////////////////////////////////////////////// // print stats if ( fPrintStats ) { sprintf( Command, "print_stats" ); if ( Cmd_CommandExecute( pAbc, Command ) ) { fprintf( stdout, "Cannot execute command \"%s\".\n", Command ); return 1; } } clk = clock(); ////////////////////////////////////////////////////////////////////////// // synthesize if ( fUseResyn2 ) { sprintf( Command, "balance; rewrite -l; refactor -l; balance; rewrite -l; rewrite -lz; balance; refactor -lz; rewrite -lz; balance" ); if ( Cmd_CommandExecute( pAbc, Command ) ) { fprintf( stdout, "Cannot execute command \"%s\".\n", Command ); return 1; } } else { sprintf( Command, "balance; rewrite -l; rewrite -lz; balance; rewrite -lz; balance" ); if ( Cmd_CommandExecute( pAbc, Command ) ) { fprintf( stdout, "Cannot execute command \"%s\".\n", Command ); return 1; } } clkResyn = clock() - clk; ////////////////////////////////////////////////////////////////////////// // print stats if ( fPrintStats ) { sprintf( Command, "print_stats" ); if ( Cmd_CommandExecute( pAbc, Command ) ) { fprintf( stdout, "Cannot execute command \"%s\".\n", Command ); return 1; } } ////////////////////////////////////////////////////////////////////////// // write the result in blif sprintf( Command, "write_blif result.blif" ); if ( Cmd_CommandExecute( pAbc, Command ) ) { fprintf( stdout, "Cannot execute command \"%s\".\n", Command ); return 1; } ////////////////////////////////////////////////////////////////////////// // perform verification clk = clock(); if ( fVerify ) { sprintf( Command, "cec %s result.blif", pFileName ); if ( Cmd_CommandExecute( pAbc, Command ) ) { fprintf( stdout, "Cannot execute command \"%s\".\n", Command ); return 1; } } clkVer = clock() - clk; printf( "Reading = %6.2f sec ", (float)(clkRead)/(float)(CLOCKS_PER_SEC) ); printf( "Rewriting = %6.2f sec ", (float)(clkResyn)/(float)(CLOCKS_PER_SEC) ); printf( "Verification = %6.2f sec\n", (float)(clkVer)/(float)(CLOCKS_PER_SEC) ); ////////////////////////////////////////////////////////////////////////// // stop the ABC framework Abc_Stop(); return 0; }