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
1a525c57
Commit
1a525c57
authored
Aug 29, 2023
by
wjrforcyber
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'upstream/master' into typo
parents
b8f5708e
3309ccab
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
65 additions
and
6 deletions
+65
-6
src/aig/gia/giaMan.c
+51
-1
src/base/abc/abcNetlist.c
+1
-1
src/base/abci/abcGen.c
+1
-1
src/base/io/ioWriteEqn.c
+6
-2
src/sat/cnf/cnfUtil.c
+6
-1
No files found.
src/aig/gia/giaMan.c
View file @
1a525c57
...
@@ -803,7 +803,7 @@ void Gia_ManPrintNpnClasses( Gia_Man_t * p )
...
@@ -803,7 +803,7 @@ void Gia_ManPrintNpnClasses( Gia_Man_t * p )
Vec_Int_t
*
vLeaves
,
*
vTruth
,
*
vVisited
;
Vec_Int_t
*
vLeaves
,
*
vTruth
,
*
vVisited
;
int
*
pLutClass
,
ClassCounts
[
222
]
=
{
0
};
int
*
pLutClass
,
ClassCounts
[
222
]
=
{
0
};
int
i
,
k
,
iFan
,
Class
,
OtherClasses
,
OtherClasses2
,
nTotal
,
Counter
,
Counter2
;
int
i
,
k
,
iFan
,
Class
,
OtherClasses
,
OtherClasses2
,
nTotal
,
Counter
,
Counter2
;
unsigned
*
pTruth
;
unsigned
*
pTruth
;
int
nLutSize
=
0
;
assert
(
Gia_ManHasMapping
(
p
)
);
assert
(
Gia_ManHasMapping
(
p
)
);
assert
(
Gia_ManLutSizeMax
(
p
)
<=
4
);
assert
(
Gia_ManLutSizeMax
(
p
)
<=
4
);
vLeaves
=
Vec_IntAlloc
(
100
);
vLeaves
=
Vec_IntAlloc
(
100
);
...
@@ -813,6 +813,7 @@ void Gia_ManPrintNpnClasses( Gia_Man_t * p )
...
@@ -813,6 +813,7 @@ void Gia_ManPrintNpnClasses( Gia_Man_t * p )
Gia_ManCleanTruth
(
p
);
Gia_ManCleanTruth
(
p
);
Gia_ManForEachLut
(
p
,
i
)
Gia_ManForEachLut
(
p
,
i
)
{
{
nLutSize
=
Abc_MaxInt
(
nLutSize
,
Gia_ObjLutSize
(
p
,
i
)
);
if
(
Gia_ObjLutSize
(
p
,
i
)
>
4
)
if
(
Gia_ObjLutSize
(
p
,
i
)
>
4
)
continue
;
continue
;
Vec_IntClear
(
vLeaves
);
Vec_IntClear
(
vLeaves
);
...
@@ -872,6 +873,55 @@ void Gia_ManPrintNpnClasses( Gia_Man_t * p )
...
@@ -872,6 +873,55 @@ void Gia_ManPrintNpnClasses( Gia_Man_t * p )
Abc_Print
(
1
,
"Approximate number of 4:1 MUX structures: All = %6d (%7.2f %%) MFFC = %6d (%7.2f %%)
\n
"
,
Abc_Print
(
1
,
"Approximate number of 4:1 MUX structures: All = %6d (%7.2f %%) MFFC = %6d (%7.2f %%)
\n
"
,
OtherClasses
,
100
.
0
*
OtherClasses
/
(
nTotal
+
1
),
OtherClasses
,
100
.
0
*
OtherClasses
/
(
nTotal
+
1
),
OtherClasses2
,
100
.
0
*
OtherClasses2
/
(
nTotal
+
1
)
);
OtherClasses2
,
100
.
0
*
OtherClasses2
/
(
nTotal
+
1
)
);
// print information about LUT pairs
if
(
nLutSize
<=
4
)
{
int
nTopPairs
=
100
,
nTopShow
=
30
;
int
i
,
j
,
k
,
iFan
,
*
pVec
=
NULL
;
Vec_Int_t
*
vPairs
=
Vec_IntAlloc
(
3
*
nTopPairs
);
Gia_ManForEachLut
(
p
,
j
)
{
Gia_LutForEachFanin
(
p
,
j
,
iFan
,
k
)
{
int
Num1
=
pLutClass
[
iFan
];
int
Num2
=
pLutClass
[
j
];
assert
(
Vec_IntSize
(
vPairs
)
%
3
==
0
);
for
(
i
=
0
;
i
<
Vec_IntSize
(
vPairs
);
i
+=
3
)
if
(
Vec_IntEntry
(
vPairs
,
i
+
0
)
==
Num1
&&
Vec_IntEntry
(
vPairs
,
i
+
1
)
==
Num2
)
break
;
if
(
i
==
Vec_IntSize
(
vPairs
)
)
{
if
(
Vec_IntSize
(
vPairs
)
<
3
*
nTopPairs
)
{
Vec_IntPush
(
vPairs
,
Num1
);
Vec_IntPush
(
vPairs
,
Num2
);
Vec_IntPush
(
vPairs
,
1
);
}
continue
;
}
// found this pair
assert
(
Vec_IntEntry
(
vPairs
,
i
+
0
)
==
Num1
);
assert
(
Vec_IntEntry
(
vPairs
,
i
+
1
)
==
Num2
);
Vec_IntAddToEntry
(
vPairs
,
i
+
2
,
1
);
// sort
pVec
=
Vec_IntArray
(
vPairs
);
while
(
i
>
0
&&
pVec
[
i
+
2
]
>
pVec
[
i
-
1
]
)
{
ABC_SWAP
(
int
,
pVec
[
i
+
0
],
pVec
[
i
-
3
]
)
ABC_SWAP
(
int
,
pVec
[
i
+
1
],
pVec
[
i
-
2
]
)
ABC_SWAP
(
int
,
pVec
[
i
+
2
],
pVec
[
i
-
1
]
)
i
-=
3
;
}
while
(
i
<
Vec_IntSize
(
vPairs
)
-
3
&&
pVec
[
i
+
2
]
<
pVec
[
i
+
5
]
)
{
ABC_SWAP
(
int
,
pVec
[
i
+
0
],
pVec
[
i
+
3
]
)
ABC_SWAP
(
int
,
pVec
[
i
+
1
],
pVec
[
i
+
4
]
)
ABC_SWAP
(
int
,
pVec
[
i
+
2
],
pVec
[
i
+
5
]
)
i
+=
3
;
assert
(
0
);
}
}
}
pVec
=
Vec_IntArray
(
vPairs
);
nTopShow
=
Abc_MinInt
(
nTopShow
,
Vec_IntSize
(
vPairs
)
/
3
);
for
(
i
=
0
;
i
<
3
*
nTopShow
;
i
+=
3
)
printf
(
"%3d : (%3d %3d) x %3d
\n
"
,
i
/
3
,
pVec
[
i
+
0
],
pVec
[
i
+
1
],
pVec
[
i
+
2
]
);
Vec_IntFree
(
vPairs
);
}
ABC_FREE
(
pLutClass
);
ABC_FREE
(
pLutClass
);
}
}
...
...
src/base/abc/abcNetlist.c
View file @
1a525c57
...
@@ -220,7 +220,7 @@ Abc_Ntk_t * Abc_NtkLogicToNetlist( Abc_Ntk_t * pNtk )
...
@@ -220,7 +220,7 @@ Abc_Ntk_t * Abc_NtkLogicToNetlist( Abc_Ntk_t * pNtk )
if
(
pObj
->
pCopy
->
pCopy
)
// the net of the new object is already created
if
(
pObj
->
pCopy
->
pCopy
)
// the net of the new object is already created
continue
;
continue
;
// create the new net
// create the new net
sprintf
(
Buffer
,
"new_%s
_
"
,
Abc_ObjName
(
pObj
)
);
sprintf
(
Buffer
,
"new_%s"
,
Abc_ObjName
(
pObj
)
);
//pNet = Abc_NtkFindOrCreateNet( pNtkNew, Abc_ObjName(pObj) ); // here we create net names such as "n48", where 48 is the ID of the node
//pNet = Abc_NtkFindOrCreateNet( pNtkNew, Abc_ObjName(pObj) ); // here we create net names such as "n48", where 48 is the ID of the node
pNet
=
Abc_NtkFindOrCreateNet
(
pNtkNew
,
Buffer
);
pNet
=
Abc_NtkFindOrCreateNet
(
pNtkNew
,
Buffer
);
Abc_ObjAddFanin
(
pNet
,
pObj
->
pCopy
);
Abc_ObjAddFanin
(
pNet
,
pObj
->
pCopy
);
...
...
src/base/abci/abcGen.c
View file @
1a525c57
...
@@ -706,7 +706,7 @@ void Abc_GenRandom( char * pFileName, int nPis )
...
@@ -706,7 +706,7 @@ void Abc_GenRandom( char * pFileName, int nPis )
unsigned
*
pTruth
;
unsigned
*
pTruth
;
int
i
,
b
,
w
,
nWords
=
Abc_TruthWordNum
(
nPis
);
int
i
,
b
,
w
,
nWords
=
Abc_TruthWordNum
(
nPis
);
int
nDigitsIn
;
int
nDigitsIn
;
Aig_ManRandom
(
1
);
//
Aig_ManRandom( 1 );
pTruth
=
ABC_ALLOC
(
unsigned
,
nWords
);
pTruth
=
ABC_ALLOC
(
unsigned
,
nWords
);
for
(
w
=
0
;
w
<
nWords
;
w
++
)
for
(
w
=
0
;
w
<
nWords
;
w
++
)
pTruth
[
w
]
=
Aig_ManRandom
(
0
);
pTruth
[
w
]
=
Aig_ManRandom
(
0
);
...
...
src/base/io/ioWriteEqn.c
View file @
1a525c57
...
@@ -85,6 +85,10 @@ void Io_WriteEqn( Abc_Ntk_t * pNtk, char * pFileName )
...
@@ -85,6 +85,10 @@ void Io_WriteEqn( Abc_Ntk_t * pNtk, char * pFileName )
SeeAlso []
SeeAlso []
***********************************************************************/
***********************************************************************/
char
*
Io_NamePrepro
(
char
*
pName
)
{
return
strncmp
(
pName
,
"new_"
,
4
)
?
pName
:
pName
+
4
;
}
void
Io_NtkWriteEqnOne
(
FILE
*
pFile
,
Abc_Ntk_t
*
pNtk
)
void
Io_NtkWriteEqnOne
(
FILE
*
pFile
,
Abc_Ntk_t
*
pNtk
)
{
{
Vec_Vec_t
*
vLevels
;
Vec_Vec_t
*
vLevels
;
...
@@ -108,10 +112,10 @@ void Io_NtkWriteEqnOne( FILE * pFile, Abc_Ntk_t * pNtk )
...
@@ -108,10 +112,10 @@ void Io_NtkWriteEqnOne( FILE * pFile, Abc_Ntk_t * pNtk )
Abc_NtkForEachNode
(
pNtk
,
pNode
,
i
)
Abc_NtkForEachNode
(
pNtk
,
pNode
,
i
)
{
{
Extra_ProgressBarUpdate
(
pProgress
,
i
,
NULL
);
Extra_ProgressBarUpdate
(
pProgress
,
i
,
NULL
);
fprintf
(
pFile
,
"%s = "
,
Abc_ObjName
(
Abc_ObjFanout0
(
pNode
)
)
);
fprintf
(
pFile
,
"%s = "
,
Io_NamePrepro
(
Abc_ObjName
(
Abc_ObjFanout0
(
pNode
))
)
);
// set the input names
// set the input names
Abc_ObjForEachFanin
(
pNode
,
pFanin
,
k
)
Abc_ObjForEachFanin
(
pNode
,
pFanin
,
k
)
Hop_IthVar
((
Hop_Man_t
*
)
pNtk
->
pManFunc
,
k
)
->
pData
=
Abc_ObjName
(
pFanin
);
Hop_IthVar
((
Hop_Man_t
*
)
pNtk
->
pManFunc
,
k
)
->
pData
=
Io_NamePrepro
(
Abc_ObjName
(
pFanin
)
);
// write the formula
// write the formula
Hop_ObjPrintEqn
(
pFile
,
(
Hop_Obj_t
*
)
pNode
->
pData
,
vLevels
,
0
);
Hop_ObjPrintEqn
(
pFile
,
(
Hop_Obj_t
*
)
pNode
->
pData
,
vLevels
,
0
);
fprintf
(
pFile
,
";
\n
"
);
fprintf
(
pFile
,
";
\n
"
);
...
...
src/sat/cnf/cnfUtil.c
View file @
1a525c57
...
@@ -23,13 +23,18 @@
...
@@ -23,13 +23,18 @@
ABC_NAMESPACE_IMPL_START
ABC_NAMESPACE_IMPL_START
#ifdef _MSC_VER
#define unlink _unlink
#else
#include <unistd.h>
#endif
#ifdef ABC_USE_PTHREADS
#ifdef ABC_USE_PTHREADS
#ifdef _WIN32
#ifdef _WIN32
#include "../lib/pthread.h"
#include "../lib/pthread.h"
#else
#else
#include <pthread.h>
#include <pthread.h>
#include <unistd.h>
#endif
#endif
#endif
#endif
...
...
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