156 ch = (x & 0x7f) | 0x80;
184 ch = (x & 0x7f) | 0x80;
240 int Pos = 0, Lit, LitPrev, Diff, i;
246 Diff = Lit - LitPrev;
247 Diff = (Lit < LitPrev)? -Diff : Diff;
248 Diff = (Diff << 1) | (
int)(Lit < LitPrev);
251 if ( Pos + 10 > vBinary->
nCap )
290 int nNodes, i, uLit, uLit0, uLit1;
412 printf(
"AIG cannot be written because it has no POs.\n" );
416 pFile = fopen( pFileName,
"wb" );
419 fprintf( stdout,
"Ioa_WriteAiger(): Cannot open the output file \"%s\".\n", pFileName );
424 fwrite( pBuffer, 1, nSize, pFile );
430 fprintf( pFile,
"\nThis file was produced by the IOA package in ABC on %s\n",
Ioa_TimeStamp() );
431 fprintf( pFile,
"For information about AIGER format, refer to %s\n",
"http://fmv.jku.at/aiger" );
451 int i, nNodes, nBufferSize,
Pos;
452 unsigned char * pBuffer;
453 unsigned uLit0, uLit1, uLit;
457 printf(
"AIG cannot be written because it has no POs.\n" );
463 pFile = fopen( pFileName,
"wb" );
466 fprintf( stdout,
"Ioa_WriteAiger(): Cannot open the output file \"%s\".\n", pFileName );
486 fprintf( pFile,
"aig%s %u %u %u %u %u",
496 fprintf( pFile,
"\n" );
532 pBuffer =
ABC_ALLOC(
unsigned char, nBufferSize );
549 if ( Pos > nBufferSize - 10 )
551 printf(
"Ioa_WriteAiger(): AIGER generation has failed because the allocated buffer is too small.\n" );
556 assert( Pos < nBufferSize );
560 fwrite( pBuffer, 1, Pos, pFile );
585 fprintf( pFile,
"c" );
587 fprintf( pFile,
"n%s%c", pMan->pName,
'\0' );
588 fprintf( pFile,
"\nThis file was produced by the IOA package in ABC on %s\n",
Ioa_TimeStamp() );
589 fprintf( pFile,
"For information about AIGER format, refer to %s\n",
"http://fmv.jku.at/aiger" );
static int Aig_ManConstrNum(Aig_Man_t *p)
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
static char * Vec_StrArray(Vec_Str_t *p)
static int Aig_ManObjNum(Aig_Man_t *p)
static void Vec_StrPrintNum(Vec_Str_t *p, int Num)
static Aig_Obj_t * Aig_ObjFanin0(Aig_Obj_t *pObj)
Vec_Int_t * Ioa_WriteAigerLiterals(Aig_Man_t *pMan)
#define Aig_ManForEachCi(p, pObj, i)
ITERATORS ///.
Vec_Str_t * Ioa_WriteAigerIntoMemoryStr(Aig_Man_t *pMan)
#define ABC_ALLOC(type, num)
int Ioa_WriteAigerEncode(unsigned char *pBuffer, int Pos, unsigned x)
FUNCTION DEFINITIONS ///.
static Vec_Str_t * Vec_StrAlloc(int nCap)
static void Vec_StrPush(Vec_Str_t *p, char Entry)
static Aig_Obj_t * Aig_ObjFanin1(Aig_Obj_t *pObj)
static char * Vec_StrReleaseArray(Vec_Str_t *p)
static int Aig_ManNodeNum(Aig_Man_t *p)
void Ioa_WriteAigerBufferTest(Aig_Man_t *pMan, char *pFileName, int fWriteSymbols, int fCompact)
static int Aig_ManCoNum(Aig_Man_t *p)
static ABC_NAMESPACE_IMPL_START int Ioa_ObjMakeLit(int Var, int fCompl)
DECLARATIONS ///.
static void Vec_StrGrow(Vec_Str_t *p, int nCapMin)
#define Aig_ManForEachNode(p, pObj, i)
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
static int Ioa_ObjAigerNum(Aig_Obj_t *pObj)
static void Vec_StrFree(Vec_Str_t *p)
static int Vec_IntEntry(Vec_Int_t *p, int i)
static int Aig_ManCiNum(Aig_Man_t *p)
void Ioa_WriteAigerEncodeStr(Vec_Str_t *vStr, unsigned x)
#define ABC_NAMESPACE_IMPL_END
char * Ioa_WriteAigerIntoMemory(Aig_Man_t *pMan, int *pnSize)
static void Vec_IntPush(Vec_Int_t *p, int Entry)
#define Vec_IntForEachEntryStart(vVec, Entry, i, Start)
void Aig_ManInvertConstraints(Aig_Man_t *pAig)
static int Aig_ObjFaninC0(Aig_Obj_t *pObj)
static void Ioa_ObjSetAigerNum(Aig_Obj_t *pObj, unsigned Num)
static Aig_Obj_t * Aig_ManConst1(Aig_Man_t *p)
#define ABC_NAMESPACE_IMPL_START
static int Vec_StrSize(Vec_Str_t *p)
static int Aig_ManRegNum(Aig_Man_t *p)
static int Vec_IntSize(Vec_Int_t *p)
void Ioa_WriteAiger(Aig_Man_t *pMan, char *pFileName, int fWriteSymbols, int fCompact)
static int Aig_ObjFaninC1(Aig_Obj_t *pObj)
Vec_Str_t * Ioa_WriteEncodeLiterals(Vec_Int_t *vLits)
#define Aig_ManForEachLiSeq(p, pObj, i)
static void Vec_StrPrintStr(Vec_Str_t *p, const char *pStr)
static void Vec_IntFree(Vec_Int_t *p)
#define Aig_ManForEachPoSeq(p, pObj, i)