/**Function************************************************************* Synopsis [Converts GIA into MiniAIG.] Description [] SideEffects [] SeeAlso [] ***********************************************************************/ Mini_Aig_t * Gia_ManToMiniAig( Gia_Man_t * pGia ) { Mini_Aig_t * p; Gia_Obj_t * pObj; int i; // create the manager p = Mini_AigStart(); Gia_ManConst0(pGia)->Value = Mini_AigLitConst0(); // create primary inputs Gia_ManForEachCi( pGia, pObj, i ) pObj->Value = Mini_AigCreatePi(p); // create internal nodes Gia_ManForEachAnd( pGia, pObj, i ) pObj->Value = Mini_AigAnd( p, Gia_ObjFanin0Copy(pObj), Gia_ObjFanin1Copy(pObj) ); // create primary outputs Gia_ManForEachCo( pGia, pObj, i ) pObj->Value = Mini_AigCreatePo( p, Gia_ObjFanin0Copy(pObj) ); // set registers Mini_AigSetRegNum( p, Gia_ManRegNum(pGia) ); return p; }
Mini_Aig_t * Abc_NtkToMiniAig( Abc_Ntk_t * pNtk ) { Mini_Aig_t * p; Abc_Obj_t * pObj; int i; assert( Abc_NtkIsStrash(pNtk) ); // create the manager p = Mini_AigStart(); // create mapping from MiniAIG into ABC objects Abc_NtkCleanCopy( pNtk ); Abc_AigConst1(pNtk)->iTemp = Mini_AigLitConst1(); // create primary inputs Abc_NtkForEachCi( pNtk, pObj, i ) pObj->iTemp = Mini_AigCreatePi(p); // create internal nodes Abc_NtkForEachNode( pNtk, pObj, i ) pObj->iTemp = Mini_AigAnd( p, Abc_NodeFanin0Copy2(pObj), Abc_NodeFanin1Copy2(pObj) ); // create primary outputs Abc_NtkForEachCo( pNtk, pObj, i ) pObj->iTemp = Mini_AigCreatePo( p, Abc_NodeFanin0Copy2(pObj) ); // set registers Mini_AigSetRegNum( p, Abc_NtkLatchNum(pNtk) ); return p; }