Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
abc
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
abc
Commits
56d3d7cd
Commit
56d3d7cd
authored
Oct 03, 2012
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
C++ portability changes.
parent
63c95405
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
57 additions
and
51 deletions
+57
-51
src/aig/gia/giaAiger.c
+2
-2
src/aig/gia/giaDup.c
+1
-1
src/aig/saig/saigConstr.c
+2
-2
src/base/abci/abcMap.c
+3
-3
src/base/abci/abcRec2.c
+2
-2
src/base/abci/abcTim.c
+2
-2
src/base/io/ioReadBlif.c
+1
-1
src/bool/lucky/luckyInt.h
+16
-12
src/bool/lucky/luckySwapIJ.c
+1
-1
src/map/mapper/mapperTree.c
+2
-2
src/map/scl/scl.c
+7
-7
src/map/scl/sclBuff.c
+1
-1
src/map/scl/sclInt.h
+2
-2
src/map/scl/sclUtil.c
+2
-2
src/misc/util/abc_global.h
+6
-5
src/proof/abs/absGla.c
+4
-4
src/sat/bsat/satSolver2.c
+3
-1
src/sat/bsat/satSolver2.h
+0
-1
No files found.
src/aig/gia/giaAiger.c
View file @
56d3d7cd
...
@@ -1063,7 +1063,7 @@ Gia_Man_t * Gia_ReadAigerFromMemory( char * pContents, int nFileSize, int fSkipS
...
@@ -1063,7 +1063,7 @@ Gia_Man_t * Gia_ReadAigerFromMemory( char * pContents, int nFileSize, int fSkipS
vFlopMap
=
pNew
->
vFlopClasses
;
pNew
->
vFlopClasses
=
NULL
;
vFlopMap
=
pNew
->
vFlopClasses
;
pNew
->
vFlopClasses
=
NULL
;
vGateMap
=
pNew
->
vGateClasses
;
pNew
->
vGateClasses
=
NULL
;
vGateMap
=
pNew
->
vGateClasses
;
pNew
->
vGateClasses
=
NULL
;
vObjMap
=
pNew
->
vObjClasses
;
pNew
->
vObjClasses
=
NULL
;
vObjMap
=
pNew
->
vObjClasses
;
pNew
->
vObjClasses
=
NULL
;
pManTime
=
pNew
->
pManTime
;
pNew
->
pManTime
=
NULL
;
pManTime
=
(
Tim_Man_t
*
)
pNew
->
pManTime
;
pNew
->
pManTime
=
NULL
;
pNew
=
Gia_ManCleanup
(
pTemp
=
pNew
);
pNew
=
Gia_ManCleanup
(
pTemp
=
pNew
);
if
(
(
vGateMap
||
vObjMap
)
&&
(
Gia_ManObjNum
(
pNew
)
<
Gia_ManObjNum
(
pTemp
))
)
if
(
(
vGateMap
||
vObjMap
)
&&
(
Gia_ManObjNum
(
pNew
)
<
Gia_ManObjNum
(
pTemp
))
)
printf
(
"Cleanup removed objects after reading. Old gate/object abstraction maps are invalid!
\n
"
);
printf
(
"Cleanup removed objects after reading. Old gate/object abstraction maps are invalid!
\n
"
);
...
@@ -1555,7 +1555,7 @@ void Gia_WriteAiger( Gia_Man_t * pInit, char * pFileName, int fWriteSymbols, int
...
@@ -1555,7 +1555,7 @@ void Gia_WriteAiger( Gia_Man_t * pInit, char * pFileName, int fWriteSymbols, int
// write timing information
// write timing information
if
(
p
->
pManTime
)
if
(
p
->
pManTime
)
{
{
Vec_Str_t
*
vStr
=
Tim_ManSave
(
p
->
pManTime
);
Vec_Str_t
*
vStr
=
Tim_ManSave
(
(
Tim_Man_t
*
)
p
->
pManTime
);
unsigned
char
Buffer
[
10
];
unsigned
char
Buffer
[
10
];
int
nSize
=
Vec_StrSize
(
vStr
);
int
nSize
=
Vec_StrSize
(
vStr
);
Gia_WriteInt
(
Buffer
,
nSize
);
Gia_WriteInt
(
Buffer
,
nSize
);
...
...
src/aig/gia/giaDup.c
View file @
56d3d7cd
...
@@ -923,7 +923,7 @@ Gia_Man_t * Gia_ManDupNormalize( Gia_Man_t * p )
...
@@ -923,7 +923,7 @@ Gia_Man_t * Gia_ManDupNormalize( Gia_Man_t * p )
***********************************************************************/
***********************************************************************/
Gia_Man_t
*
Gia_ManDupUnnomalize
(
Gia_Man_t
*
p
)
Gia_Man_t
*
Gia_ManDupUnnomalize
(
Gia_Man_t
*
p
)
{
{
Tim_Man_t
*
pTime
=
p
->
pManTime
;
Tim_Man_t
*
pTime
=
(
Tim_Man_t
*
)
p
->
pManTime
;
Gia_Man_t
*
pNew
;
Gia_Man_t
*
pNew
;
Gia_Obj_t
*
pObj
;
Gia_Obj_t
*
pObj
;
int
i
,
k
,
curCi
,
curCo
,
curNo
,
nodeLim
;
int
i
,
k
,
curCi
,
curCo
,
curNo
,
nodeLim
;
...
...
src/aig/saig/saigConstr.c
View file @
56d3d7cd
...
@@ -292,8 +292,8 @@ Aig_Man_t * Saig_ManDupUnfoldConstrs( Aig_Man_t * pAig )
...
@@ -292,8 +292,8 @@ Aig_Man_t * Saig_ManDupUnfoldConstrs( Aig_Man_t * pAig )
Vec_VecFree
(
(
Vec_Vec_t
*
)
vConsAll
);
Vec_VecFree
(
(
Vec_Vec_t
*
)
vConsAll
);
return
Aig_ManDupDfs
(
pAig
);
return
Aig_ManDupDfs
(
pAig
);
}
}
Vec_PtrSort
(
vOuts
,
Saig_ManDupCompare
);
Vec_PtrSort
(
vOuts
,
(
int
(
*
)(
void
))
Saig_ManDupCompare
);
Vec_PtrSort
(
vCons
,
Saig_ManDupCompare
);
Vec_PtrSort
(
vCons
,
(
int
(
*
)(
void
))
Saig_ManDupCompare
);
Vec_PtrPush
(
vOutsAll
,
vOuts
);
Vec_PtrPush
(
vOutsAll
,
vOuts
);
Vec_PtrPush
(
vConsAll
,
vCons
);
Vec_PtrPush
(
vConsAll
,
vCons
);
}
}
...
...
src/base/abci/abcMap.c
View file @
56d3d7cd
...
@@ -66,7 +66,7 @@ Abc_Ntk_t * Abc_NtkMap( Abc_Ntk_t * pNtk, double DelayTarget, double AreaMulti,
...
@@ -66,7 +66,7 @@ Abc_Ntk_t * Abc_NtkMap( Abc_Ntk_t * pNtk, double DelayTarget, double AreaMulti,
Vec_Int_t
*
vSwitching
=
NULL
;
Vec_Int_t
*
vSwitching
=
NULL
;
float
*
pSwitching
=
NULL
;
float
*
pSwitching
=
NULL
;
clock_t
clk
,
clkTotal
=
clock
();
clock_t
clk
,
clkTotal
=
clock
();
Mio_Library_t
*
pLib
=
Abc_FrameReadLibGen
();
Mio_Library_t
*
pLib
=
(
Mio_Library_t
*
)
Abc_FrameReadLibGen
();
assert
(
Abc_NtkIsStrash
(
pNtk
)
);
assert
(
Abc_NtkIsStrash
(
pNtk
)
);
...
@@ -102,9 +102,9 @@ Abc_Ntk_t * Abc_NtkMap( Abc_Ntk_t * pNtk, double DelayTarget, double AreaMulti,
...
@@ -102,9 +102,9 @@ Abc_Ntk_t * Abc_NtkMap( Abc_Ntk_t * pNtk, double DelayTarget, double AreaMulti,
// return the library to normal
// return the library to normal
if
(
AreaMulti
!=
0
.
0
)
if
(
AreaMulti
!=
0
.
0
)
Mio_LibraryMultiArea
(
Abc_FrameReadLibGen
(),
-
AreaMulti
);
Mio_LibraryMultiArea
(
(
Mio_Library_t
*
)
Abc_FrameReadLibGen
(),
-
AreaMulti
);
if
(
DelayMulti
!=
0
.
0
)
if
(
DelayMulti
!=
0
.
0
)
Mio_LibraryMultiDelay
(
Abc_FrameReadLibGen
(),
-
DelayMulti
);
Mio_LibraryMultiDelay
(
(
Mio_Library_t
*
)
Abc_FrameReadLibGen
(),
-
DelayMulti
);
// print a warning about choice nodes
// print a warning about choice nodes
if
(
Abc_NtkGetChoiceNum
(
pNtk
)
)
if
(
Abc_NtkGetChoiceNum
(
pNtk
)
)
...
...
src/base/abci/abcRec2.c
View file @
56d3d7cd
...
@@ -163,7 +163,7 @@ static inline int Rec_AppendObj( Abc_ManRec_t2 * p, Rec_Obj_t2 ** pObj )
...
@@ -163,7 +163,7 @@ static inline int Rec_AppendObj( Abc_ManRec_t2 * p, Rec_Obj_t2 ** pObj )
if
(
p
->
nRecObjs
==
p
->
nRecObjsAlloc
)
if
(
p
->
nRecObjs
==
p
->
nRecObjsAlloc
)
{
{
assert
(
p
->
nRecObjs
>
0
);
assert
(
p
->
nRecObjs
>
0
);
p
->
pRecObjs
=
realloc
(
p
->
pRecObjs
,
2
*
p
->
nRecObjsAlloc
*
p
->
recObjSize
);
p
->
pRecObjs
=
ABC_REALLOC
(
char
,
p
->
pRecObjs
,
2
*
p
->
nRecObjsAlloc
*
p
->
recObjSize
);
memset
(
p
->
pRecObjs
+
p
->
nRecObjsAlloc
*
p
->
recObjSize
,
0
,
p
->
recObjSize
*
p
->
nRecObjsAlloc
);
memset
(
p
->
pRecObjs
+
p
->
nRecObjsAlloc
*
p
->
recObjSize
,
0
,
p
->
recObjSize
*
p
->
nRecObjsAlloc
);
p
->
nRecObjsAlloc
*=
2
;
p
->
nRecObjsAlloc
*=
2
;
hasRealloced
=
1
;
hasRealloced
=
1
;
...
@@ -2177,7 +2177,7 @@ void Abc_NtkRecCutTruthFromLib2( Gia_Man_t * pGia2, Vec_Ptr_t * vNodes, int nLea
...
@@ -2177,7 +2177,7 @@ void Abc_NtkRecCutTruthFromLib2( Gia_Man_t * pGia2, Vec_Ptr_t * vNodes, int nLea
Vec_PtrForEachEntry
(
Gia_Obj_t
*
,
vNodes
,
pObj
,
i
)
Vec_PtrForEachEntry
(
Gia_Obj_t
*
,
vNodes
,
pObj
,
i
)
{
{
Gia_ObjSetCopyF
(
pGia2
,
0
,
pObj
,
i
);
Gia_ObjSetCopyF
(
pGia2
,
0
,
pObj
,
i
);
pSims
=
Vec_PtrEntry
(
vTtTemps
,
i
);
pSims
=
(
unsigned
*
)
Vec_PtrEntry
(
vTtTemps
,
i
);
if
(
i
<
nLeaves
)
if
(
i
<
nLeaves
)
{
{
Kit_TruthCopy
(
pSims
,
(
unsigned
*
)
Vec_PtrEntry
(
vTtElems
,
i
),
nInputs
);
Kit_TruthCopy
(
pSims
,
(
unsigned
*
)
Vec_PtrEntry
(
vTtElems
,
i
),
nInputs
);
...
...
src/base/abci/abcTim.c
View file @
56d3d7cd
...
@@ -385,11 +385,11 @@ void Abc_NtkTestTim( Abc_Ntk_t * pNtk, int fVerbose )
...
@@ -385,11 +385,11 @@ void Abc_NtkTestTim( Abc_Ntk_t * pNtk, int fVerbose )
// create GIA manager (pGia) with hierarhy/timing manager attached (pGia->pManTime)
// create GIA manager (pGia) with hierarhy/timing manager attached (pGia->pManTime)
// while assuming that some nodes are white boxes (see Abc_NodeIsWhiteBox)
// while assuming that some nodes are white boxes (see Abc_NodeIsWhiteBox)
pGia
=
Abc_NtkTestTimDeriveGia
(
pNtk
,
fVerbose
);
pGia
=
Abc_NtkTestTimDeriveGia
(
pNtk
,
fVerbose
);
printf
(
"Created GIA manager for network with %d white boxes.
\n
"
,
Tim_ManBoxNum
(
pGia
->
pManTime
)
);
printf
(
"Created GIA manager for network with %d white boxes.
\n
"
,
Tim_ManBoxNum
(
(
Tim_Man_t
*
)
pGia
->
pManTime
)
);
// print the timing manager
// print the timing manager
if
(
fVerbose
)
if
(
fVerbose
)
Tim_ManPrint
(
pGia
->
pManTime
);
Tim_ManPrint
(
(
Tim_Man_t
*
)
pGia
->
pManTime
);
// test writing both managers into a file and reading them back
// test writing both managers into a file and reading them back
Abc_NtkTestTimByWritingFile
(
pGia
,
"test1.aig"
);
Abc_NtkTestTimByWritingFile
(
pGia
,
"test1.aig"
);
...
...
src/base/io/ioReadBlif.c
View file @
56d3d7cd
...
@@ -607,7 +607,7 @@ int Io_ReadBlifReorderFormalNames( Vec_Ptr_t * vTokens, Mio_Gate_t * pGate, Mio_
...
@@ -607,7 +607,7 @@ int Io_ReadBlifReorderFormalNames( Vec_Ptr_t * vTokens, Mio_Gate_t * pGate, Mio_
pName
=
(
char
*
)
Vec_PtrEntry
(
vTokens
,
nSize
-
1
);
pName
=
(
char
*
)
Vec_PtrEntry
(
vTokens
,
nSize
-
1
);
if
(
!
strncmp
(
pNamePin
,
pName
,
Length
)
&&
pName
[
Length
]
==
'='
)
// the last entry is pTwin
if
(
!
strncmp
(
pNamePin
,
pName
,
Length
)
&&
pName
[
Length
]
==
'='
)
// the last entry is pTwin
{
{
pName
=
Vec_PtrPop
(
vTokens
);
pName
=
(
char
*
)
Vec_PtrPop
(
vTokens
);
Vec_PtrPush
(
vTokens
,
NULL
);
Vec_PtrPush
(
vTokens
,
NULL
);
Vec_PtrPush
(
vTokens
,
pName
);
Vec_PtrPush
(
vTokens
,
pName
);
return
1
;
return
1
;
...
...
src/bool/lucky/luckyInt.h
View file @
56d3d7cd
...
@@ -24,13 +24,16 @@
...
@@ -24,13 +24,16 @@
#include <math.h>
#include <math.h>
#include <time.h>
#include <time.h>
// comment out this line to run Lucky Code outside of ABC
// comment out this line to run Lucky Code outside of ABC
#define _RUNNING_ABC_
#define _RUNNING_ABC_
#ifdef _RUNNING_ABC_
#ifdef _RUNNING_ABC_
#include "misc/util/abc_global.h"
#include "misc/util/abc_global.h"
#include "lucky.h"
#else
#else
#define ABC_NAMESPACE_HEADER_START
#define ABC_NAMESPACE_HEADER_START
#define ABC_NAMESPACE_HEADER_END
#define ABC_NAMESPACE_HEADER_END
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_START
...
@@ -42,6 +45,18 @@ typedef unsigned __int64 word;
...
@@ -42,6 +45,18 @@ typedef unsigned __int64 word;
#define inline __inline // compatible with MS VS 6.0
#define inline __inline // compatible with MS VS 6.0
#define ABC_ALLOC(type, num) ((type *) malloc(sizeof(type) * (num)))
#define ABC_ALLOC(type, num) ((type *) malloc(sizeof(type) * (num)))
// #define LUCKY_VERIFY
// #define LUCKY_VERIFY
typedef
struct
{
int
varN
;
int
*
swapArray
;
int
swapCtr
;
int
totalSwaps
;
int
*
flipArray
;
int
flipCtr
;
int
totalFlips
;
}
permInfo
;
#endif
#endif
...
@@ -71,17 +86,6 @@ typedef struct
...
@@ -71,17 +86,6 @@ typedef struct
int
positionToSwap2
;
int
positionToSwap2
;
}
swapInfo
;
}
swapInfo
;
typedef
struct
{
int
varN
;
int
*
swapArray
;
int
swapCtr
;
int
totalSwaps
;
int
*
flipArray
;
int
flipCtr
;
int
totalFlips
;
}
permInfo
;
static
inline
void
TimePrint
(
char
*
Message
)
static
inline
void
TimePrint
(
char
*
Message
)
{
{
...
...
src/bool/lucky/luckySwapIJ.c
View file @
56d3d7cd
...
@@ -76,7 +76,7 @@ void swap_ij_case3( word* f,int totalVars, int i, int j)
...
@@ -76,7 +76,7 @@ void swap_ij_case3( word* f,int totalVars, int i, int j)
shift
=
(
wwj
-
wwi
)
/
2
;
shift
=
(
wwj
-
wwi
)
/
2
;
WORDS_IN_TT
=
Kit_TruthWordNum_64bit
(
totalVars
);
WORDS_IN_TT
=
Kit_TruthWordNum_64bit
(
totalVars
);
SizeOfBlock
=
sizeof
(
word
)
*
wwi
/
2
;
SizeOfBlock
=
sizeof
(
word
)
*
wwi
/
2
;
temp
=
malloc
(
SizeOfBlock
);
temp
=
(
word
*
)
malloc
(
SizeOfBlock
);
for
(
y
=
wwj
/
2
;
y
<
WORDS_IN_TT
;
y
+=
wwj
)
for
(
y
=
wwj
/
2
;
y
<
WORDS_IN_TT
;
y
+=
wwj
)
for
(
x
=
y
-
shift
;
x
<
y
;
x
+=
wwi
)
for
(
x
=
y
-
shift
;
x
<
y
;
x
+=
wwi
)
{
{
...
...
src/map/mapper/mapperTree.c
View file @
56d3d7cd
...
@@ -162,7 +162,7 @@ int Map_LibraryReadFileTree( Map_SuperLib_t * pLib, FILE * pFile, char *pFileNam
...
@@ -162,7 +162,7 @@ int Map_LibraryReadFileTree( Map_SuperLib_t * pLib, FILE * pFile, char *pFileNam
}
}
pLibName
=
strtok
(
pTemp
,
"
\t\r\n
"
);
pLibName
=
strtok
(
pTemp
,
"
\t\r\n
"
);
pLib
->
pGenlib
=
Abc_FrameReadLibGen
();
pLib
->
pGenlib
=
(
Mio_Library_t
*
)
Abc_FrameReadLibGen
();
if
(
pLib
->
pGenlib
==
NULL
||
strcmp
(
Mio_LibraryReadName
(
pLib
->
pGenlib
),
pLibName
)
)
if
(
pLib
->
pGenlib
==
NULL
||
strcmp
(
Mio_LibraryReadName
(
pLib
->
pGenlib
),
pLibName
)
)
{
{
printf
(
"Supergate library
\"
%s
\"
requires the use of genlib library
\"
%s
\"
.
\n
"
,
pFileName
,
pLibName
);
printf
(
"Supergate library
\"
%s
\"
requires the use of genlib library
\"
%s
\"
.
\n
"
,
pFileName
,
pLibName
);
...
@@ -410,7 +410,7 @@ int Map_LibraryReadFileTreeStr( Map_SuperLib_t * pLib, Vec_Str_t * vStr, char *
...
@@ -410,7 +410,7 @@ int Map_LibraryReadFileTreeStr( Map_SuperLib_t * pLib, Vec_Str_t * vStr, char *
}
}
pLibName
=
strtok
(
pTemp
,
"
\t\r\n
"
);
pLibName
=
strtok
(
pTemp
,
"
\t\r\n
"
);
pLib
->
pGenlib
=
Abc_FrameReadLibGen
();
pLib
->
pGenlib
=
(
Mio_Library_t
*
)
Abc_FrameReadLibGen
();
// if ( pLib->pGenlib == NULL || strcmp( , pLibName ) )
// if ( pLib->pGenlib == NULL || strcmp( , pLibName ) )
if
(
pLib
->
pGenlib
==
NULL
||
Map_LibraryCompareLibNames
(
Mio_LibraryReadName
(
pLib
->
pGenlib
),
pLibName
)
)
if
(
pLib
->
pGenlib
==
NULL
||
Map_LibraryCompareLibNames
(
Mio_LibraryReadName
(
pLib
->
pGenlib
),
pLibName
)
)
{
{
...
...
src/map/scl/scl.c
View file @
56d3d7cd
...
@@ -120,7 +120,7 @@ int Scl_CommandRead( Abc_Frame_t * pAbc, int argc, char ** argv )
...
@@ -120,7 +120,7 @@ int Scl_CommandRead( Abc_Frame_t * pAbc, int argc, char ** argv )
// read new library
// read new library
Abc_SclLoad
(
pFileName
,
(
SC_Lib
**
)
&
pAbc
->
pLibScl
);
Abc_SclLoad
(
pFileName
,
(
SC_Lib
**
)
&
pAbc
->
pLibScl
);
if
(
fVerbose
)
if
(
fVerbose
)
Abc_SclWriteText
(
"scl_out.txt"
,
pAbc
->
pLibScl
);
Abc_SclWriteText
(
"scl_out.txt"
,
(
SC_Lib
*
)
pAbc
->
pLibScl
);
return
0
;
return
0
;
usage:
usage:
...
@@ -221,7 +221,7 @@ int Scl_CommandPrint( Abc_Frame_t * pAbc, int argc, char **argv )
...
@@ -221,7 +221,7 @@ int Scl_CommandPrint( Abc_Frame_t * pAbc, int argc, char **argv )
}
}
// save current library
// save current library
Abc_SclPrintCells
(
pAbc
->
pLibScl
);
Abc_SclPrintCells
(
(
SC_Lib
*
)
pAbc
->
pLibScl
);
return
0
;
return
0
;
usage:
usage:
...
@@ -274,7 +274,7 @@ int Scl_CommandPrintGS( Abc_Frame_t * pAbc, int argc, char **argv )
...
@@ -274,7 +274,7 @@ int Scl_CommandPrintGS( Abc_Frame_t * pAbc, int argc, char **argv )
}
}
// save current library
// save current library
Abc_SclPrintGateSizes
(
pAbc
->
pLibScl
,
Abc_FrameReadNtk
(
pAbc
)
);
Abc_SclPrintGateSizes
(
(
SC_Lib
*
)
pAbc
->
pLibScl
,
Abc_FrameReadNtk
(
pAbc
)
);
return
0
;
return
0
;
usage:
usage:
...
@@ -344,7 +344,7 @@ int Scl_CommandStime( Abc_Frame_t * pAbc, int argc, char **argv )
...
@@ -344,7 +344,7 @@ int Scl_CommandStime( Abc_Frame_t * pAbc, int argc, char **argv )
return
1
;
return
1
;
}
}
Abc_SclTimePerform
(
pAbc
->
pLibScl
,
Abc_FrameReadNtk
(
pAbc
),
fUseWireLoads
,
fShowAll
,
fShort
);
Abc_SclTimePerform
(
(
SC_Lib
*
)
pAbc
->
pLibScl
,
Abc_FrameReadNtk
(
pAbc
),
fUseWireLoads
,
fShowAll
,
fShort
);
return
0
;
return
0
;
usage:
usage:
...
@@ -611,7 +611,7 @@ int Scl_CommandGsize( Abc_Frame_t * pAbc, int argc, char **argv )
...
@@ -611,7 +611,7 @@ int Scl_CommandGsize( Abc_Frame_t * pAbc, int argc, char **argv )
return
1
;
return
1
;
}
}
Abc_SclSizingPerform
(
pAbc
->
pLibScl
,
Abc_FrameReadNtk
(
pAbc
),
pPars
);
Abc_SclSizingPerform
(
(
SC_Lib
*
)
pAbc
->
pLibScl
,
Abc_FrameReadNtk
(
pAbc
),
pPars
);
return
0
;
return
0
;
usage:
usage:
...
@@ -717,7 +717,7 @@ int Scl_CommandUpsize( Abc_Frame_t * pAbc, int argc, char **argv )
...
@@ -717,7 +717,7 @@ int Scl_CommandUpsize( Abc_Frame_t * pAbc, int argc, char **argv )
return
1
;
return
1
;
}
}
Abc_SclUpsizePerform
(
pAbc
->
pLibScl
,
pNtk
,
Window
,
Ratio
,
nIters
,
fVerbose
);
Abc_SclUpsizePerform
(
(
SC_Lib
*
)
pAbc
->
pLibScl
,
pNtk
,
Window
,
Ratio
,
nIters
,
fVerbose
);
return
0
;
return
0
;
usage:
usage:
...
@@ -782,7 +782,7 @@ int Scl_CommandMinsize( Abc_Frame_t * pAbc, int argc, char **argv )
...
@@ -782,7 +782,7 @@ int Scl_CommandMinsize( Abc_Frame_t * pAbc, int argc, char **argv )
return
1
;
return
1
;
}
}
Abc_SclMinsizePerform
(
pAbc
->
pLibScl
,
pNtk
,
fVerbose
);
Abc_SclMinsizePerform
(
(
SC_Lib
*
)
pAbc
->
pLibScl
,
pNtk
,
fVerbose
);
return
0
;
return
0
;
usage:
usage:
...
...
src/map/scl/sclBuff.c
View file @
56d3d7cd
...
@@ -136,7 +136,7 @@ Abc_Obj_t * Abc_SclPerformBufferingOne( Abc_Obj_t * pObj, int Degree, int fVerbo
...
@@ -136,7 +136,7 @@ Abc_Obj_t * Abc_SclPerformBufferingOne( Abc_Obj_t * pObj, int Degree, int fVerbo
// collect fanouts and sort by reverse level
// collect fanouts and sort by reverse level
vFanouts
=
Vec_PtrAlloc
(
Abc_ObjFanoutNum
(
pObj
)
);
vFanouts
=
Vec_PtrAlloc
(
Abc_ObjFanoutNum
(
pObj
)
);
Abc_NodeCollectFanouts
(
pObj
,
vFanouts
);
Abc_NodeCollectFanouts
(
pObj
,
vFanouts
);
Vec_PtrSort
(
vFanouts
,
Abc_NodeCompareLevels
);
Vec_PtrSort
(
vFanouts
,
(
int
(
*
)(
void
))
Abc_NodeCompareLevels
);
// select the first Degree fanouts
// select the first Degree fanouts
pBuffer
=
Abc_NtkCreateNodeBuf
(
pObj
->
pNtk
,
NULL
);
pBuffer
=
Abc_NtkCreateNodeBuf
(
pObj
->
pNtk
,
NULL
);
// check if it is possible to not increase level
// check if it is possible to not increase level
...
...
src/map/scl/sclInt.h
View file @
56d3d7cd
...
@@ -198,8 +198,8 @@ static inline SC_Cell * SC_LibCell( SC_Lib * p, int i ) { return (SC_
...
@@ -198,8 +198,8 @@ static inline SC_Cell * SC_LibCell( SC_Lib * p, int i ) { return (SC_
static
inline
SC_Pin
*
SC_CellPin
(
SC_Cell
*
p
,
int
i
)
{
return
(
SC_Pin
*
)
Vec_PtrEntry
(
p
->
vPins
,
i
);
}
static
inline
SC_Pin
*
SC_CellPin
(
SC_Cell
*
p
,
int
i
)
{
return
(
SC_Pin
*
)
Vec_PtrEntry
(
p
->
vPins
,
i
);
}
static
inline
Vec_Wrd_t
*
SC_CellFunc
(
SC_Cell
*
p
)
{
return
SC_CellPin
(
p
,
p
->
n_inputs
)
->
vFunc
;
}
static
inline
Vec_Wrd_t
*
SC_CellFunc
(
SC_Cell
*
p
)
{
return
SC_CellPin
(
p
,
p
->
n_inputs
)
->
vFunc
;
}
static
inline
double
SC_LibCapFf
(
SC_Lib
*
p
,
double
cap
)
{
return
cap
*
p
->
unit_cap_fst
*
pow
(
10
,
15
-
p
->
unit_cap_snd
);
}
static
inline
double
SC_LibCapFf
(
SC_Lib
*
p
,
double
cap
)
{
return
cap
*
p
->
unit_cap_fst
*
pow
(
10
.
0
,
15
-
p
->
unit_cap_snd
);
}
static
inline
double
SC_LibTimePs
(
SC_Lib
*
p
,
double
time
)
{
return
time
*
pow
(
10
,
12
-
p
->
unit_time
);
}
static
inline
double
SC_LibTimePs
(
SC_Lib
*
p
,
double
time
)
{
return
time
*
pow
(
10
.
0
,
12
-
p
->
unit_time
);
}
#define SC_LibForEachCell( p, pCell, i ) Vec_PtrForEachEntry( SC_Cell *, p->vCells, pCell, i )
#define SC_LibForEachCell( p, pCell, i ) Vec_PtrForEachEntry( SC_Cell *, p->vCells, pCell, i )
#define SC_LibForEachCellClass( p, pCell, i ) Vec_PtrForEachEntry( SC_Cell *, p->vCellClasses, pCell, i )
#define SC_LibForEachCellClass( p, pCell, i ) Vec_PtrForEachEntry( SC_Cell *, p->vCellClasses, pCell, i )
...
...
src/map/scl/sclUtil.c
View file @
56d3d7cd
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
#include "sclInt.h"
#include "sclInt.h"
#include "map/mio/mio.h"
#include "map/mio/mio.h"
#include "bool/kit/kit.h"
ABC_NAMESPACE_IMPL_START
ABC_NAMESPACE_IMPL_START
...
@@ -135,7 +136,7 @@ void Abc_SclLinkCells( SC_Lib * p )
...
@@ -135,7 +136,7 @@ void Abc_SclLinkCells( SC_Lib * p )
Vec_PtrPush
(
vList
,
pCell
);
Vec_PtrPush
(
vList
,
pCell
);
qsort
(
(
void
*
)
Vec_PtrArray
(
vList
),
Vec_PtrSize
(
vList
),
sizeof
(
void
*
),
(
int
(
*
)(
const
void
*
,
const
void
*
))
Abc_SclCompareCells
);
qsort
(
(
void
*
)
Vec_PtrArray
(
vList
),
Vec_PtrSize
(
vList
),
sizeof
(
void
*
),
(
int
(
*
)(
const
void
*
,
const
void
*
))
Abc_SclCompareCells
);
// create new representative
// create new representative
pRepr
=
Vec_PtrEntry
(
vList
,
0
);
pRepr
=
(
SC_Cell
*
)
Vec_PtrEntry
(
vList
,
0
);
pRepr
->
pNext
=
pRepr
->
pPrev
=
pRepr
;
pRepr
->
pNext
=
pRepr
->
pPrev
=
pRepr
;
pRepr
->
Order
=
0
;
pRepr
->
Order
=
0
;
// relink cells
// relink cells
...
@@ -152,7 +153,6 @@ void Abc_SclLinkCells( SC_Lib * p )
...
@@ -152,7 +153,6 @@ void Abc_SclLinkCells( SC_Lib * p )
}
}
void
Abc_SclPrintCells
(
SC_Lib
*
p
)
void
Abc_SclPrintCells
(
SC_Lib
*
p
)
{
{
extern
void
Kit_DsdPrintFromTruth
(
unsigned
*
pTruth
,
int
nVars
);
SC_Cell
*
pCell
,
*
pRepr
;
SC_Cell
*
pCell
,
*
pRepr
;
int
i
,
k
,
j
,
nLength
=
0
;
int
i
,
k
,
j
,
nLength
=
0
;
assert
(
Vec_PtrSize
(
p
->
vCellClasses
)
>
0
);
assert
(
Vec_PtrSize
(
p
->
vCellClasses
)
>
0
);
...
...
src/misc/util/abc_global.h
View file @
56d3d7cd
...
@@ -264,6 +264,12 @@ enum Abc_VerbLevel
...
@@ -264,6 +264,12 @@ enum Abc_VerbLevel
ABC_VERBOSE
=
2
ABC_VERBOSE
=
2
};
};
// string printing
extern
char
*
vnsprintf
(
const
char
*
format
,
va_list
args
);
extern
char
*
nsprintf
(
const
char
*
format
,
...);
extern
int
Gia_ManToBridgeText
(
FILE
*
pFile
,
int
Size
,
unsigned
char
*
pBuffer
);
// misc printing procedures
static
inline
void
Abc_Print
(
int
level
,
const
char
*
format
,
...
)
static
inline
void
Abc_Print
(
int
level
,
const
char
*
format
,
...
)
{
{
extern
ABC_DLL
int
Abc_FrameIsBridgeMode
();
extern
ABC_DLL
int
Abc_FrameIsBridgeMode
();
...
@@ -275,8 +281,6 @@ static inline void Abc_Print( int level, const char * format, ... )
...
@@ -275,8 +281,6 @@ static inline void Abc_Print( int level, const char * format, ... )
va_start
(
args
,
format
);
va_start
(
args
,
format
);
if
(
Abc_FrameIsBridgeMode
()
)
if
(
Abc_FrameIsBridgeMode
()
)
{
{
extern
int
Gia_ManToBridgeText
(
FILE
*
pFile
,
int
Size
,
unsigned
char
*
pBuffer
);
extern
char
*
vnsprintf
(
const
char
*
format
,
va_list
args
);
char
*
tmp
=
vnsprintf
(
format
,
args
);
char
*
tmp
=
vnsprintf
(
format
,
args
);
Gia_ManToBridgeText
(
stdout
,
strlen
(
tmp
),
(
unsigned
char
*
)
tmp
);
Gia_ManToBridgeText
(
stdout
,
strlen
(
tmp
),
(
unsigned
char
*
)
tmp
);
free
(
tmp
);
free
(
tmp
);
...
@@ -362,9 +366,6 @@ extern void Abc_QuickSort3( word * pData, int nSize, int fDecrease );
...
@@ -362,9 +366,6 @@ extern void Abc_QuickSort3( word * pData, int nSize, int fDecrease );
extern
void
Abc_QuickSortCostData
(
int
*
pCosts
,
int
nSize
,
int
fDecrease
,
word
*
pData
,
int
*
pResult
);
extern
void
Abc_QuickSortCostData
(
int
*
pCosts
,
int
nSize
,
int
fDecrease
,
word
*
pData
,
int
*
pResult
);
extern
int
*
Abc_QuickSortCost
(
int
*
pCosts
,
int
nSize
,
int
fDecrease
);
extern
int
*
Abc_QuickSortCost
(
int
*
pCosts
,
int
nSize
,
int
fDecrease
);
// string printing
extern
char
*
vnsprintf
(
const
char
*
format
,
va_list
args
);
extern
char
*
nsprintf
(
const
char
*
format
,
...);
ABC_NAMESPACE_HEADER_END
ABC_NAMESPACE_HEADER_END
...
...
src/proof/abs/absGla.c
View file @
56d3d7cd
...
@@ -18,9 +18,10 @@
...
@@ -18,9 +18,10 @@
***********************************************************************/
***********************************************************************/
#include "base/main/main.h"
#include "sat/cnf/cnf.h"
#include "sat/cnf/cnf.h"
#include "sat/bsat/satSolver2.h"
#include "sat/bsat/satSolver2.h"
#include "b
ase/main/main
.h"
#include "b
ool/kit/kit
.h"
#include "abs.h"
#include "abs.h"
#include "absRef.h"
#include "absRef.h"
//#include "absRef2.h"
//#include "absRef2.h"
...
@@ -83,8 +84,8 @@ struct Ga2_Man_t_
...
@@ -83,8 +84,8 @@ struct Ga2_Man_t_
static
inline
int
Ga2_ObjId
(
Ga2_Man_t
*
p
,
Gia_Obj_t
*
pObj
)
{
return
Vec_IntEntry
(
p
->
vIds
,
Gia_ObjId
(
p
->
pGia
,
pObj
));
}
static
inline
int
Ga2_ObjId
(
Ga2_Man_t
*
p
,
Gia_Obj_t
*
pObj
)
{
return
Vec_IntEntry
(
p
->
vIds
,
Gia_ObjId
(
p
->
pGia
,
pObj
));
}
static
inline
void
Ga2_ObjSetId
(
Ga2_Man_t
*
p
,
Gia_Obj_t
*
pObj
,
int
i
)
{
Vec_IntWriteEntry
(
p
->
vIds
,
Gia_ObjId
(
p
->
pGia
,
pObj
),
i
);
}
static
inline
void
Ga2_ObjSetId
(
Ga2_Man_t
*
p
,
Gia_Obj_t
*
pObj
,
int
i
)
{
Vec_IntWriteEntry
(
p
->
vIds
,
Gia_ObjId
(
p
->
pGia
,
pObj
),
i
);
}
static
inline
Vec_Int_t
*
Ga2_ObjCnf0
(
Ga2_Man_t
*
p
,
Gia_Obj_t
*
pObj
)
{
assert
(
Ga2_ObjId
(
p
,
pObj
)
>=
0
);
return
Vec_PtrEntry
(
p
->
vCnfs
,
2
*
Ga2_ObjId
(
p
,
pObj
)
);
}
static
inline
Vec_Int_t
*
Ga2_ObjCnf0
(
Ga2_Man_t
*
p
,
Gia_Obj_t
*
pObj
)
{
assert
(
Ga2_ObjId
(
p
,
pObj
)
>=
0
);
return
(
Vec_Int_t
*
)
Vec_PtrEntry
(
p
->
vCnfs
,
2
*
Ga2_ObjId
(
p
,
pObj
)
);
}
static
inline
Vec_Int_t
*
Ga2_ObjCnf1
(
Ga2_Man_t
*
p
,
Gia_Obj_t
*
pObj
)
{
assert
(
Ga2_ObjId
(
p
,
pObj
)
>=
0
);
return
Vec_PtrEntry
(
p
->
vCnfs
,
2
*
Ga2_ObjId
(
p
,
pObj
)
+
1
);
}
static
inline
Vec_Int_t
*
Ga2_ObjCnf1
(
Ga2_Man_t
*
p
,
Gia_Obj_t
*
pObj
)
{
assert
(
Ga2_ObjId
(
p
,
pObj
)
>=
0
);
return
(
Vec_Int_t
*
)
Vec_PtrEntry
(
p
->
vCnfs
,
2
*
Ga2_ObjId
(
p
,
pObj
)
+
1
);
}
static
inline
int
Ga2_ObjIsAbs0
(
Ga2_Man_t
*
p
,
Gia_Obj_t
*
pObj
)
{
assert
(
Ga2_ObjId
(
p
,
pObj
)
>=
0
);
return
Ga2_ObjId
(
p
,
pObj
)
>=
0
&&
Ga2_ObjId
(
p
,
pObj
)
<
p
->
LimAbs
;
}
static
inline
int
Ga2_ObjIsAbs0
(
Ga2_Man_t
*
p
,
Gia_Obj_t
*
pObj
)
{
assert
(
Ga2_ObjId
(
p
,
pObj
)
>=
0
);
return
Ga2_ObjId
(
p
,
pObj
)
>=
0
&&
Ga2_ObjId
(
p
,
pObj
)
<
p
->
LimAbs
;
}
static
inline
int
Ga2_ObjIsLeaf0
(
Ga2_Man_t
*
p
,
Gia_Obj_t
*
pObj
)
{
assert
(
Ga2_ObjId
(
p
,
pObj
)
>=
0
);
return
Ga2_ObjId
(
p
,
pObj
)
>=
p
->
LimAbs
&&
Ga2_ObjId
(
p
,
pObj
)
<
p
->
LimPpi
;
}
static
inline
int
Ga2_ObjIsLeaf0
(
Ga2_Man_t
*
p
,
Gia_Obj_t
*
pObj
)
{
assert
(
Ga2_ObjId
(
p
,
pObj
)
>=
0
);
return
Ga2_ObjId
(
p
,
pObj
)
>=
p
->
LimAbs
&&
Ga2_ObjId
(
p
,
pObj
)
<
p
->
LimPpi
;
}
...
@@ -628,7 +629,6 @@ if ( fVerbose )
...
@@ -628,7 +629,6 @@ if ( fVerbose )
***********************************************************************/
***********************************************************************/
Vec_Int_t
*
Ga2_ManCnfCompute
(
unsigned
uTruth
,
int
nVars
,
Vec_Int_t
*
vCover
)
Vec_Int_t
*
Ga2_ManCnfCompute
(
unsigned
uTruth
,
int
nVars
,
Vec_Int_t
*
vCover
)
{
{
extern
int
Kit_TruthIsop
(
unsigned
*
puTruth
,
int
nVars
,
Vec_Int_t
*
vMemory
,
int
fTryBoth
);
int
RetValue
;
int
RetValue
;
assert
(
nVars
<=
5
);
assert
(
nVars
<=
5
);
// transform truth table into the SOP
// transform truth table into the SOP
...
...
src/sat/bsat/satSolver2.c
View file @
56d3d7cd
...
@@ -1552,8 +1552,10 @@ void sat_solver2_reducedb(sat_solver2* s)
...
@@ -1552,8 +1552,10 @@ void sat_solver2_reducedb(sat_solver2* s)
// compact proof (compacts 'proofs' and update 'claProofs')
// compact proof (compacts 'proofs' and update 'claProofs')
if
(
s
->
pPrf1
)
if
(
s
->
pPrf1
)
{
extern
int
Sat_ProofReduce
(
Vec_Set_t
*
vProof
,
void
*
pRoots
,
int
hProofPivot
);
s
->
hProofPivot
=
Sat_ProofReduce
(
s
->
pPrf1
,
&
s
->
claProofs
,
s
->
hProofPivot
);
s
->
hProofPivot
=
Sat_ProofReduce
(
s
->
pPrf1
,
&
s
->
claProofs
,
s
->
hProofPivot
);
}
// report the results
// report the results
TimeTotal
+=
clock
()
-
clk
;
TimeTotal
+=
clock
()
-
clk
;
...
...
src/sat/bsat/satSolver2.h
View file @
56d3d7cd
...
@@ -70,7 +70,6 @@ extern void var_set_partA (sat_solver2* s, int v, int partA);
...
@@ -70,7 +70,6 @@ extern void var_set_partA (sat_solver2* s, int v, int partA);
extern
void
*
Sat_ProofCore
(
sat_solver2
*
s
);
extern
void
*
Sat_ProofCore
(
sat_solver2
*
s
);
extern
void
*
Sat_ProofInterpolant
(
sat_solver2
*
s
,
void
*
pGloVars
);
extern
void
*
Sat_ProofInterpolant
(
sat_solver2
*
s
,
void
*
pGloVars
);
extern
word
*
Sat_ProofInterpolantTruth
(
sat_solver2
*
s
,
void
*
pGloVars
);
extern
word
*
Sat_ProofInterpolantTruth
(
sat_solver2
*
s
,
void
*
pGloVars
);
extern
int
Sat_ProofReduce
(
Vec_Set_t
*
vProof
,
void
*
pRoots
,
int
hProofPivot
);
extern
void
Sat_ProofCheck
(
sat_solver2
*
s
);
extern
void
Sat_ProofCheck
(
sat_solver2
*
s
);
//=================================================================================================
//=================================================================================================
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment