Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions .github/workflows/build-posix-cmake.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
on: [push]
name: Build Posix CMake

on:
push:
pull_request:

jobs:

build-posix:
build-posix-cmake:
strategy:
matrix:
os: [macos-11, ubuntu-latest]
os: [macos-latest, ubuntu-latest]
use_namespace: [false, true]

runs-on: ${{ matrix.os }}
Expand All @@ -18,7 +22,7 @@ jobs:
steps:

- name: Git Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: recursive

Expand All @@ -40,6 +44,10 @@ jobs:
run: |
cmake --build build

- name: Run Unit Tests
run: |
ctest --output-on-failure

- name: Test Executable
run: |
./build/abc -c "r i10.aig; b; ps; b; rw -l; rw -lz; b; rw -lz; b; ps; cec"
Expand All @@ -56,7 +64,7 @@ jobs:
cp build/abc build/libabc.a staging/

- name: Upload pacakge artifact
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v4
with:
name: package
name: package-cmake-${{ matrix.os }}-${{ matrix.use_namespace }}
path: staging/
12 changes: 8 additions & 4 deletions .github/workflows/build-posix.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
on: [push]
name: Build Posix

on:
push:
pull_request:

jobs:

Expand All @@ -18,7 +22,7 @@ jobs:
steps:

- name: Git Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: recursive

Expand Down Expand Up @@ -56,7 +60,7 @@ jobs:
cp abc libabc.a staging/

- name: Upload pacakge artifact
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v4
with:
name: package
name: package-posix-${{ matrix.os }}-${{ matrix.use_namespace }}
path: staging/
12 changes: 8 additions & 4 deletions .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
on: [push]
name: Build Windows

on:
push:
pull_request:

jobs:

Expand All @@ -9,7 +13,7 @@ jobs:
steps:

- name: Git Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: recursive

Expand Down Expand Up @@ -42,7 +46,7 @@ jobs:
copy UpgradeLog.htm staging/

- name: Upload pacakge artifact
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v4
with:
name: package
name: package-windows
path: staging/
2 changes: 1 addition & 1 deletion src/aig/aig/aigCuts.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Aig_ManCut_t * Aig_ManCutStart( Aig_Man_t * pMan, int nCutsMax, int nLeafMax, in
// room for temporary truth tables
if ( fTruth )
{
p->puTemp[0] = ABC_ALLOC( unsigned, 4 * p->nTruthWords );
p->puTemp[0] = ABC_ALLOC( unsigned, 4 * (size_t)(p->nTruthWords ));
p->puTemp[1] = p->puTemp[0] + p->nTruthWords;
p->puTemp[2] = p->puTemp[1] + p->nTruthWords;
p->puTemp[3] = p->puTemp[2] + p->nTruthWords;
Expand Down
4 changes: 2 additions & 2 deletions src/aig/aig/aigFanout.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ void Aig_ManFanoutStart( Aig_Man_t * p )
p->nFansAlloc = 2 * Aig_ManObjNumMax(p);
if ( p->nFansAlloc < (1<<12) )
p->nFansAlloc = (1<<12);
p->pFanData = ABC_ALLOC( int, 5 * p->nFansAlloc );
memset( p->pFanData, 0, sizeof(int) * 5 * p->nFansAlloc );
p->pFanData = ABC_ALLOC( int, 5 * (size_t)(p->nFansAlloc ));
memset( p->pFanData, 0, sizeof(int) * 5 * (size_t)(p->nFansAlloc ));
// add fanouts for all objects
Aig_ManForEachObj( p, pObj, i )
{
Expand Down
7 changes: 4 additions & 3 deletions src/aig/aig/aigFrames.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,12 @@ Aig_Man_t * Aig_ManFrames( Aig_Man_t * pAig, int nFs, int fInit, int fOuts, int
int i, f;

// create mapping for the frames nodes
pObjMap = ABC_ALLOC( Aig_Obj_t *, nFs * Aig_ManObjNumMax(pAig) );
memset( pObjMap, 0, sizeof(Aig_Obj_t *) * nFs * Aig_ManObjNumMax(pAig) );
size_t s = (size_t)(nFs) * (size_t)(Aig_ManObjNumMax(pAig));
pObjMap = ABC_ALLOC( Aig_Obj_t *, s );
memset( pObjMap, 0, sizeof(Aig_Obj_t *) * s );

// start the fraig package
pFrames = Aig_ManStart( Aig_ManObjNumMax(pAig) * nFs );
pFrames = Aig_ManStart( s );
pFrames->pName = Abc_UtilStrsav( pAig->pName );
pFrames->pSpec = Abc_UtilStrsav( pAig->pSpec );
// map constant nodes
Expand Down
28 changes: 14 additions & 14 deletions src/aig/aig/aigMem.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,20 @@ struct Aig_MmFixed_t_
{
// information about individual entries
int nEntrySize; // the size of one entry
int nEntriesAlloc; // the total number of entries allocated
int nEntriesUsed; // the number of entries in use
size_t nEntriesAlloc; // the total number of entries allocated
size_t nEntriesUsed; // the number of entries in use
int nEntriesMax; // the max number of entries in use
char * pEntriesFree; // the linked list of free entries

// this is where the memory is stored
int nChunkSize; // the size of one chunk
int nChunksAlloc; // the maximum number of memory chunks
int nChunks; // the current number of memory chunks
size_t nChunksAlloc; // the maximum number of memory chunks
size_t nChunks; // the current number of memory chunks
char ** pChunks; // the allocated memory

// statistics
int nMemoryUsed; // memory used in the allocated entries
int nMemoryAlloc; // memory allocated
size_t nMemoryUsed; // memory used in the allocated entries
size_t nMemoryAlloc; // memory allocated
};

struct Aig_MmFlex_t_
Expand All @@ -56,24 +56,24 @@ struct Aig_MmFlex_t_

// this is where the memory is stored
int nChunkSize; // the size of one chunk
int nChunksAlloc; // the maximum number of memory chunks
int nChunks; // the current number of memory chunks
size_t nChunksAlloc; // the maximum number of memory chunks
size_t nChunks; // the current number of memory chunks
char ** pChunks; // the allocated memory

// statistics
int nMemoryUsed; // memory used in the allocated entries
int nMemoryAlloc; // memory allocated
size_t nMemoryUsed; // memory used in the allocated entries
size_t nMemoryAlloc; // memory allocated
};

struct Aig_MmStep_t_
{
int nMems; // the number of fixed memory managers employed
Aig_MmFixed_t ** pMems; // memory managers: 2^1 words, 2^2 words, etc
int nMapSize; // the size of the memory array
size_t nMapSize; // the size of the memory array
Aig_MmFixed_t ** pMap; // maps the number of bytes into its memory manager
// additional memory chunks
int nChunksAlloc; // the maximum number of memory chunks
int nChunks; // the current number of memory chunks
size_t nChunksAlloc; // the maximum number of memory chunks
size_t nChunks; // the current number of memory chunks
char ** pChunks; // the allocated memory
};

Expand Down Expand Up @@ -172,7 +172,7 @@ char * Aig_MmFixedEntryFetch( Aig_MmFixed_t * p )
p->nChunksAlloc *= 2;
p->pChunks = ABC_REALLOC( char *, p->pChunks, p->nChunksAlloc );
}
p->pEntriesFree = ABC_ALLOC( char, p->nEntrySize * p->nChunkSize );
p->pEntriesFree = ABC_ALLOC( char, (size_t)(p->nEntrySize) * (size_t)(p->nChunkSize));
p->nMemoryAlloc += p->nEntrySize * p->nChunkSize;
// transform these entries into a linked list
pTemp = p->pEntriesFree;
Expand Down
4 changes: 2 additions & 2 deletions src/aig/aig/aigOrder.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ void Aig_ManOrderStart( Aig_Man_t * p )
p->nOrderAlloc = 2 * Aig_ManObjNumMax(p);
if ( p->nOrderAlloc < (1<<12) )
p->nOrderAlloc = (1<<12);
p->pOrderData = ABC_ALLOC( unsigned, 2 * p->nOrderAlloc );
memset( p->pOrderData, 0xFF, sizeof(unsigned) * 2 * p->nOrderAlloc );
p->pOrderData = ABC_ALLOC( unsigned, 2 * (size_t)(p->nOrderAlloc ));
memset( p->pOrderData, 0xFF, sizeof(unsigned) * 2 * (size_t)(p->nOrderAlloc ));
// add the constant node
p->pOrderData[0] = p->pOrderData[1] = 0;
p->iPrev = p->iNext = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/aig/aig/aigRet.c
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ Aig_Man_t * Rtm_ManToAig( Rtm_Man_t * pRtm )
Rtm_Edg_t * pEdge;
int i, k, m, Val, nLatches, * pLatches;
// count latches and mark the first latch on each edge
pLatches = ABC_ALLOC( int, 2 * Vec_PtrSize(pRtm->vObjs) );
pLatches = ABC_ALLOC( int, 2 * (size_t)(Vec_PtrSize(pRtm->vObjs)) );
nLatches = 0;
Rtm_ManForEachObj( pRtm, pObjRtm, i )
Rtm_ObjForEachFaninEdge( pObjRtm, pEdge, k )
Expand Down
10 changes: 5 additions & 5 deletions src/aig/gia/giaAigerExt.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ unsigned char * Gia_WriteEquivClassesInt( Gia_Man_t * p, int * pEquivSize )
Gia_ClassForEachObj( p, iRepr, iNode )
nItems++;
}
pBuffer = ABC_ALLOC( unsigned char, sizeof(int) * (nItems + 10) );
pBuffer = ABC_ALLOC( unsigned char, sizeof(int) * (size_t)(nItems + 10) );
// write constant class
iPos = Gia_AigerWriteUnsignedBuffer( pBuffer, 4, Abc_Var2Lit(0, 1) );
iPrevNode = 0;
Expand Down Expand Up @@ -176,7 +176,7 @@ unsigned char * Gia_AigerWriteMappingInt( Gia_Man_t * p, int * pMapSize )
nItems = 0;
Gia_ManForEachLut( p, i )
nItems += 2 + Gia_ObjLutSize( p, i );
pBuffer = ABC_ALLOC( unsigned char, sizeof(int) * (nItems + 1) );
pBuffer = ABC_ALLOC( unsigned char, sizeof(int) * (size_t)(nItems + 1) );
// write non-constant classes
iPrev = 0;
Gia_ManForEachLut( p, i )
Expand Down Expand Up @@ -225,7 +225,7 @@ int * Gia_AigerReadMappingSimple( unsigned char ** ppPos, int nSize )
}
Vec_Str_t * Gia_AigerWriteMappingSimple( Gia_Man_t * p )
{
unsigned char * pBuffer = ABC_ALLOC( unsigned char, 4*Vec_IntSize(p->vMapping) );
unsigned char * pBuffer = ABC_ALLOC( unsigned char, 4*(size_t)Vec_IntSize(p->vMapping) );
memcpy( pBuffer, Vec_IntArray(p->vMapping), (size_t)4*Vec_IntSize(p->vMapping) );
assert( Vec_IntSize(p->vMapping) >= Gia_ManObjNum(p) );
return Vec_StrAllocArray( (char *)pBuffer, 4*Vec_IntSize(p->vMapping) );
Expand Down Expand Up @@ -274,7 +274,7 @@ Vec_Str_t * Gia_AigerWriteMappingDoc( Gia_Man_t * p )
nSize += Gia_ObjLutSize(p, i) + 2;
LutSize = Abc_MaxInt( LutSize, Gia_ObjLutSize(p, i) );
}
pBuffer = ABC_ALLOC( unsigned char, 4 * nSize );
pBuffer = ABC_ALLOC( unsigned char, 4 * (size_t)nSize );
Gia_AigerWriteInt( pBuffer + 4 * nSize2++, nLuts );
Gia_AigerWriteInt( pBuffer + 4 * nSize2++, LutSize );
Gia_ManForEachLut( p, i )
Expand Down Expand Up @@ -310,7 +310,7 @@ Vec_Int_t * Gia_AigerReadPacking( unsigned char ** ppPos, int nSize )
}
Vec_Str_t * Gia_WritePacking( Vec_Int_t * vPacking )
{
unsigned char * pBuffer = ABC_ALLOC( unsigned char, 4*Vec_IntSize(vPacking) );
unsigned char * pBuffer = ABC_ALLOC( unsigned char, 4*(size_t)Vec_IntSize(vPacking) );
int i, Entry, nSize = 0;
Vec_IntForEachEntry( vPacking, Entry, i )
Gia_AigerWriteInt( pBuffer + 4 * nSize++, Entry );
Expand Down
4 changes: 2 additions & 2 deletions src/aig/gia/giaEmbed.c
Original file line number Diff line number Diff line change
Expand Up @@ -1170,7 +1170,7 @@ void Emb_ManComputeDimensions( Emb_Man_t * p, int nDims )
float ** Emb_ManMatrAlloc( int nDims )
{
int i;
float ** pMatr = (float **)ABC_ALLOC( char, sizeof(float *) * nDims + sizeof(float) * nDims * nDims );
float ** pMatr = (float **)ABC_ALLOC( char, sizeof(float *) * (size_t)nDims + sizeof(float) * (size_t)nDims * (size_t)nDims );
pMatr[0] = (float *)(pMatr + nDims);
for ( i = 1; i < nDims; i++ )
pMatr[i] = pMatr[i-1] + nDims;
Expand Down Expand Up @@ -1464,7 +1464,7 @@ void Emb_ManDerivePlacement( Emb_Man_t * p, int nSols )
pPerm1 = Gia_SortFloats( pY1, NULL, p->nObjs );

// average solutions and project them into square [0;GIA_PLACE_SIZE] x [0;GIA_PLACE_SIZE]
p->pPlacement = ABC_ALLOC( unsigned short, 2 * p->nObjs );
p->pPlacement = ABC_ALLOC( unsigned short, 2 * (size_t)p->nObjs );
for ( k = 0; k < p->nObjs; k++ )
{
p->pPlacement[2*pPerm0[k]+0] = (unsigned short)(int)(1.0 * k * GIA_PLACE_SIZE / p->nObjs);
Expand Down
2 changes: 1 addition & 1 deletion src/aig/gia/giaEra.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Gia_ManEra_t * Gia_ManEraCreate( Gia_Man_t * pAig )
p->pAig = pAig;
p->nWordsSim = Abc_TruthWordNum( Gia_ManPiNum(pAig) );
p->nWordsDat = Abc_BitWordNum( Gia_ManRegNum(pAig) );
p->pDataSim = ABC_ALLOC( unsigned, p->nWordsSim*Gia_ManObjNum(pAig) );
p->pDataSim = ABC_ALLOC( unsigned, (size_t)p->nWordsSim*(size_t)Gia_ManObjNum(pAig) );
p->pMemory = Mem_FixedStart( sizeof(Gia_ObjEra_t) + sizeof(unsigned) * p->nWordsDat );
p->vStates = Vec_PtrAlloc( 100000 );
p->nBins = Abc_PrimeCudd( 100000 );
Expand Down
4 changes: 2 additions & 2 deletions src/aig/gia/giaFanout.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ void Gia_ManFanoutStart( Gia_Man_t * p )
p->nFansAlloc = 2 * Gia_ManObjNum(p);
if ( p->nFansAlloc < (1<<12) )
p->nFansAlloc = (1<<12);
p->pFanData = ABC_ALLOC( int, 5 * p->nFansAlloc );
memset( p->pFanData, 0, sizeof(int) * 5 * p->nFansAlloc );
p->pFanData = ABC_ALLOC( int, 5 * (size_t)p->nFansAlloc );
memset( p->pFanData, 0, sizeof(int) * 5 * (size_t)p->nFansAlloc );
// add fanouts for all objects
Gia_ManForEachObj( p, pObj, i )
{
Expand Down
2 changes: 1 addition & 1 deletion src/aig/gia/giaMem.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ char * Gia_MmFixedEntryFetch( Gia_MmFixed_t * p )
p->nChunksAlloc *= 2;
p->pChunks = ABC_REALLOC( char *, p->pChunks, p->nChunksAlloc );
}
p->pEntriesFree = ABC_ALLOC( char, p->nEntrySize * p->nChunkSize );
p->pEntriesFree = ABC_ALLOC( char, (size_t)p->nEntrySize * (size_t)p->nChunkSize );
p->nMemoryAlloc += p->nEntrySize * p->nChunkSize;
// transform these entries into a linked list
pTemp = p->pEntriesFree;
Expand Down
10 changes: 5 additions & 5 deletions src/aig/gia/giaMinLut2.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ void Gia_ManPermStats( int nIns, int * pIPerm, int * pTried )
int Gia_ManPermuteTreeOne( word * pTruths, int nIns, int nOuts, int nWords, int fRandom, int * pIPermOut, int fVeryVerbose, int fVerbose )
{
extern void Gia_ManDumpMuxes( Tree_Sto_t * p, char * pFileName, int * pIPerm );
word * pStore = ABC_ALLOC( word, nIns*nOuts*nWords );
word * pStore = ABC_ALLOC( word, (size_t)nIns*(size_t)nOuts*(size_t)nWords );
int pTried[TREE_MAX_VARS] = {0};
int pIPerm[TREE_MAX_VARS] = {0};
int v, r, Pos, nNodesPrev = -1, nNodesMin = 0, nNoChange = 0;
Expand Down Expand Up @@ -475,7 +475,7 @@ word * Abc_TtMin( word * pF, word * pR, int nVars, Vec_Wrd_t * vMemory, Vec_Wrd_
word * Abc_TtMinArray( word * p, int nOuts, int nVars, int * pnNodes, int fVerbose )
{
int o, i, nWords = Abc_TtWordNum(nVars);
word * pRes, * pResult = ABC_ALLOC( word, nOuts*nWords/2 );
word * pRes, * pResult = ABC_ALLOC( word, (size_t)nOuts*(size_t)nWords/2 );
Vec_Wrd_t * vMemory = Vec_WrdAlloc( 100 );
Vec_Wrd_t * vNodes = Vec_WrdAlloc( 100 );
Vec_Wec_t * vNodes2 = Vec_WecStart( nVars+1 );
Expand Down Expand Up @@ -900,7 +900,7 @@ Gia_Man_t * Abc_TtGiaMinArray( word * p, int nVars, int nOuts, int * pnNodes, in
{
Gia_Man_t * pNew, * pTemp;
int o, i, iLit, nWords = Abc_TtWordNum(nVars);
word * pRes, * pResult = ABC_ALLOC( word, nOuts*nWords/2 );
word * pRes, * pResult = ABC_ALLOC( word, (size_t)nOuts*(size_t)nWords/2 );
Vec_Wrd_t * vMemory = Vec_WrdAlloc( 100 );
Vec_Wrd_t * vNodes = Vec_WrdAlloc( 100 );
Vec_Wec_t * vNodes2 = Vec_WecStart( nVars+1 );
Expand Down Expand Up @@ -1145,7 +1145,7 @@ Gia_Man_t * Gia_TryPermOpt2( word * pTruths, int nIns, int nOuts, int nWords, in
abctime clk = Abc_Clock();
Gia_Man_t * pNew;
word * pRes, * pTruthDup = Abc_TtDup( pTruths, nOuts*nWords, 0 );
word * pTruthBest = ABC_ALLOC( word, nOuts*nWords/2 );
word * pTruthBest = ABC_ALLOC( word, (size_t)nOuts*(size_t)nWords/2 );
int pIPermBest[TREE_MAX_VARS] = {0};
int pIPerm[TREE_MAX_VARS] = {0};
int r, rBest = -1, nNodes = -1, nNodesBest = ABC_INFINITY;
Expand Down Expand Up @@ -1301,7 +1301,7 @@ void Abc_Tt6MinTest2( Gia_Man_t * p )
{
int fVerbose = 0;
int i, nWords = Abc_TtWordNum(Gia_ManCiNum(p));
word * pTruth = ABC_ALLOC( word, 3*nWords );
word * pTruth = ABC_ALLOC( word, 3*(size_t)nWords );
word * pRes = NULL, * pTruths[3] = { pTruth, pTruth+nWords, pTruth+2*nWords };

Vec_Int_t * vSupp = Vec_IntAlloc( 100 );
Expand Down
4 changes: 2 additions & 2 deletions src/aig/gia/giaResub2.c
Original file line number Diff line number Diff line change
Expand Up @@ -476,8 +476,8 @@ int Abc_ResubComputeWindow( int * pObjs, int nObjs, int nDivsMax, int nLevelIncr
}
int Abc_ResubComputeWindow2( int * pObjs, int nObjs, int nDivsMax, int nLevelIncrease, int fUseXor, int fUseZeroCost, int fDebug, int fVerbose, int ** ppArray, int * pnResubs )
{
*ppArray = ABC_ALLOC( int, 2*nObjs );
memmove( *ppArray, pObjs, 2*nObjs * sizeof(int) );
*ppArray = ABC_ALLOC( int, 2*(size_t)nObjs );
memmove( *ppArray, pObjs, 2*(size_t)nObjs * sizeof(int) );
if ( pnResubs )
*pnResubs = 0;
return nObjs;
Expand Down
6 changes: 3 additions & 3 deletions src/aig/gia/giaSim.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,9 @@ Gia_ManSim_t * Gia_ManSimCreate( Gia_Man_t * pAig, Gia_ParSim_t * pPars )
p->pAig = Gia_ManFront( pAig );
p->pPars = pPars;
p->nWords = pPars->nWords;
p->pDataSim = ABC_ALLOC( unsigned, p->nWords * p->pAig->nFront );
p->pDataSimCis = ABC_ALLOC( unsigned, p->nWords * Gia_ManCiNum(p->pAig) );
p->pDataSimCos = ABC_ALLOC( unsigned, p->nWords * Gia_ManCoNum(p->pAig) );
p->pDataSim = ABC_ALLOC( unsigned, (size_t)p->nWords * (size_t)p->pAig->nFront );
p->pDataSimCis = ABC_ALLOC( unsigned, (size_t)p->nWords * (size_t)Gia_ManCiNum(p->pAig) );
p->pDataSimCos = ABC_ALLOC( unsigned, (size_t)p->nWords * (size_t)Gia_ManCoNum(p->pAig) );
if ( !p->pDataSim || !p->pDataSimCis || !p->pDataSimCos )
{
Abc_Print( 1, "Simulator could not allocate %.2f GB for simulation info.\n",
Expand Down
Loading