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
08d25f39
Commit
08d25f39
authored
Mar 26, 2023
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Various unrelated changes.
parent
41c01e4f
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
18 deletions
+45
-18
src/aig/gia/gia.h
+6
-2
src/aig/gia/giaFanout.c
+16
-3
src/aig/gia/giaMf.c
+1
-1
src/misc/util/utilTruth.h
+22
-12
No files found.
src/aig/gia/gia.h
View file @
08d25f39
...
...
@@ -1108,7 +1108,9 @@ static inline void Gia_ObjSetFanoutInt( Gia_Man_t * p, Gia_Obj_t * pObj,
#define Gia_ObjForEachFanoutStatic( p, pObj, pFanout, i ) \
for ( i = 0; (i < Gia_ObjFanoutNum(p, pObj)) && (((pFanout) = Gia_ObjFanout(p, pObj, i)), 1); i++ )
#define Gia_ObjForEachFanoutStaticId( p, Id, FanId, i ) \
for ( i = 0; (i < Gia_ObjFanoutNumId(p, Id)) && (((FanId) = Gia_ObjFanoutId(p, Id, i)), 1); i++ )
for ( i = 0; (i < Gia_ObjFanoutNumId(p, Id)) && ((FanId = Gia_ObjFanoutId(p, Id, i)), 1); i++ )
#define Gia_ObjForEachFanoutStaticIndex( p, Id, FanId, i, Index ) \
for ( i = 0; (i < Gia_ObjFanoutNumId(p, Id)) && (Index = Vec_IntEntry(p->vFanout, Id)+i) && ((FanId = Vec_IntEntry(p->vFanout, Index)), 1); i++ )
static
inline
int
Gia_ManHasMapping
(
Gia_Man_t
*
p
)
{
return
p
->
vMapping
!=
NULL
;
}
static
inline
int
Gia_ObjIsLut
(
Gia_Man_t
*
p
,
int
Id
)
{
return
Vec_IntEntry
(
p
->
vMapping
,
Id
)
!=
0
;
}
...
...
@@ -1141,6 +1143,8 @@ static inline int Gia_ObjCellId( Gia_Man_t * p, int iLit ) { re
for ( i = Gia_ManObjNum(p) - 1; i > 0; i-- ) if ( !Gia_ObjIsLut(p, i) ) {} else
#define Gia_LutForEachFanin( p, i, iFan, k ) \
for ( k = 0; k < Gia_ObjLutSize(p,i) && ((iFan = Gia_ObjLutFanins(p,i)[k]),1); k++ )
#define Gia_LutForEachFaninIndex( p, i, iFan, k, Index ) \
for ( k = 0; k < Gia_ObjLutSize(p,i) && (Index = Vec_IntEntry(p->vMapping, i)+1+k) && ((iFan = Vec_IntEntry(p->vMapping, Index)),1); k++ )
#define Gia_LutForEachFaninObj( p, i, pFanin, k ) \
for ( k = 0; k < Gia_ObjLutSize(p,i) && ((pFanin = Gia_ManObj(p, Gia_ObjLutFanins(p,i)[k])),1); k++ )
...
...
@@ -1437,7 +1441,7 @@ extern void Gia_ManFanoutStart( Gia_Man_t * p );
extern
void
Gia_ManFanoutStop
(
Gia_Man_t
*
p
);
extern
void
Gia_ManStaticFanoutStart
(
Gia_Man_t
*
p
);
extern
void
Gia_ManStaticFanoutStop
(
Gia_Man_t
*
p
);
extern
void
Gia_ManStaticMappingFanoutStart
(
Gia_Man_t
*
p
);
extern
void
Gia_ManStaticMappingFanoutStart
(
Gia_Man_t
*
p
,
Vec_Int_t
**
pvIndex
);
/*=== giaForce.c =========================================================*/
extern
void
For_ManExperiment
(
Gia_Man_t
*
pGia
,
int
nIters
,
int
fClustered
,
int
fVerbose
);
/*=== giaFrames.c =========================================================*/
...
...
src/aig/gia/giaFanout.c
View file @
08d25f39
...
...
@@ -324,12 +324,20 @@ Vec_Int_t * Gia_ManStartMappingFanoutMap( Gia_Man_t * p, Vec_Int_t * vFanoutNums
SeeAlso []
***********************************************************************/
void
Gia_ManStaticMappingFanoutStart
(
Gia_Man_t
*
p
)
void
Gia_ObjCheckDupMappingFanins
(
Gia_Man_t
*
p
,
int
iObj
)
{
int
*
pFanins
=
Gia_ObjLutFanins
(
p
,
iObj
);
int
i
,
k
,
nFanins
=
Gia_ObjLutSize
(
p
,
iObj
);
for
(
i
=
0
;
i
<
nFanins
;
i
++
)
for
(
k
=
i
+
1
;
k
<
nFanins
;
k
++
)
assert
(
pFanins
[
i
]
!=
pFanins
[
k
]
);
}
void
Gia_ManStaticMappingFanoutStart
(
Gia_Man_t
*
p
,
Vec_Int_t
**
pvIndex
)
{
Vec_Int_t
*
vCounts
;
int
*
pRefsOld
;
Gia_Obj_t
*
pObj
,
*
pFanin
;
int
i
,
k
,
iFan
,
iFanout
;
int
i
,
k
,
iFan
,
iFanout
,
Index
;
assert
(
p
->
vFanoutNums
==
NULL
);
assert
(
p
->
vFanout
==
NULL
);
// recompute reference counters
...
...
@@ -339,17 +347,22 @@ void Gia_ManStaticMappingFanoutStart( Gia_Man_t * p )
p
->
pLutRefs
=
pRefsOld
;
// start the fanout maps
p
->
vFanout
=
Gia_ManStartMappingFanoutMap
(
p
,
p
->
vFanoutNums
);
if
(
pvIndex
)
*
pvIndex
=
Vec_IntStart
(
Vec_IntSize
(
p
->
vFanout
)
);
// incrementally add fanouts
vCounts
=
Vec_IntStart
(
Gia_ManObjNum
(
p
)
);
Gia_ManForEachLut
(
p
,
i
)
{
Gia_ObjCheckDupMappingFanins
(
p
,
i
);
pObj
=
Gia_ManObj
(
p
,
i
);
Gia_LutForEachFanin
(
p
,
i
,
iFan
,
k
)
Gia_LutForEachFanin
Index
(
p
,
i
,
iFan
,
k
,
Index
)
{
pFanin
=
Gia_ManObj
(
p
,
iFan
);
iFanout
=
Vec_IntEntry
(
vCounts
,
iFan
);
Gia_ObjSetFanout
(
p
,
pFanin
,
iFanout
,
pObj
);
Vec_IntAddToEntry
(
vCounts
,
iFan
,
1
);
if
(
pvIndex
)
Vec_IntWriteEntry
(
*
pvIndex
,
Vec_IntEntry
(
p
->
vFanout
,
iFan
)
+
iFanout
,
Index
);
}
}
Gia_ManForEachCo
(
p
,
pObj
,
i
)
...
...
src/aig/gia/giaMf.c
View file @
08d25f39
...
...
@@ -1789,7 +1789,7 @@ void Mf_ManOptimization( Mf_Man_t * p )
Gia_Man_t
*
pGia
=
p
->
pGia0
;
int
i
,
Count
,
nNodes
=
Mf_ManMappingFromMapping
(
p
);
Gia_ManLevelNum
(
pGia
);
Gia_ManStaticMappingFanoutStart
(
pGia
);
Gia_ManStaticMappingFanoutStart
(
pGia
,
NULL
);
Mf_ManPrintFanoutProfile
(
p
,
pGia
->
vFanoutNums
);
printf
(
"
\n
Individual logic cones for mapping with %d nodes:
\n
"
,
nNodes
);
Vec_IntForEachEntry
(
pGia
->
vFanoutNums
,
Count
,
i
)
...
...
src/misc/util/utilTruth.h
View file @
08d25f39
...
...
@@ -162,24 +162,34 @@ static inline int Abc_TtBitCount16( int i ) { return Abc_TtBitCount8[i & 0xFF] +
***********************************************************************/
// read/write/flip i-th bit of a bit string table:
static
inline
int
Abc_TtGetBit
(
word
*
p
,
int
i
)
{
return
(
int
)(
p
[
i
>>
6
]
>>
(
word
)(
i
&
63
))
&
1
;
}
static
inline
void
Abc_TtSetBit
(
word
*
p
,
int
i
)
{
p
[
i
>>
6
]
|=
(
word
)(((
word
)
1
)
<<
(
i
&
63
));
}
static
inline
void
Abc_TtXorBit
(
word
*
p
,
int
i
)
{
p
[
i
>>
6
]
^=
(
word
)(((
word
)
1
)
<<
(
i
&
63
));
}
static
inline
int
Abc_TtGetBit
(
word
*
p
,
int
k
)
{
return
(
int
)(
p
[
k
>>
6
]
>>
(
k
&
63
))
&
1
;
}
static
inline
void
Abc_TtSetBit
(
word
*
p
,
int
k
)
{
p
[
k
>>
6
]
|=
(((
word
)
1
)
<<
(
k
&
63
));
}
static
inline
void
Abc_TtXorBit
(
word
*
p
,
int
k
)
{
p
[
k
>>
6
]
^=
(((
word
)
1
)
<<
(
k
&
63
));
}
// read/write k-th digit d of a quaternary number:
static
inline
int
Abc_TtGetQua
(
word
*
p
,
int
k
)
{
return
(
int
)(
p
[
k
>>
5
]
>>
(
word
)((
k
<<
1
)
&
63
))
&
3
;
}
static
inline
void
Abc_TtSetQua
(
word
*
p
,
int
k
,
int
d
)
{
p
[
k
>>
5
]
|=
(
word
)(((
word
)
d
)
<<
((
k
<<
1
)
&
63
));
}
static
inline
void
Abc_TtXorQua
(
word
*
p
,
int
k
,
int
d
)
{
p
[
k
>>
5
]
^=
(
word
)(((
word
)
d
)
<<
((
k
<<
1
)
&
63
));
}
static
inline
int
Abc_TtGetQua
(
word
*
p
,
int
k
)
{
return
(
int
)(
p
[
k
>>
5
]
>>
((
k
<<
1
)
&
63
))
&
3
;
}
static
inline
void
Abc_TtSetQua
(
word
*
p
,
int
k
,
int
d
)
{
p
[
k
>>
5
]
|=
(((
word
)
d
)
<<
((
k
<<
1
)
&
63
));
}
static
inline
void
Abc_TtXorQua
(
word
*
p
,
int
k
,
int
d
)
{
p
[
k
>>
5
]
^=
(((
word
)
d
)
<<
((
k
<<
1
)
&
63
));
}
// read/write k-th digit d of a hexadecimal number:
static
inline
int
Abc_TtGetHex
(
word
*
p
,
int
k
)
{
return
(
int
)(
p
[
k
>>
4
]
>>
(
word
)((
k
<<
2
)
&
63
))
&
15
;
}
static
inline
void
Abc_TtSetHex
(
word
*
p
,
int
k
,
int
d
)
{
p
[
k
>>
4
]
|=
(
word
)(((
word
)
d
)
<<
((
k
<<
2
)
&
63
));
}
static
inline
void
Abc_TtXorHex
(
word
*
p
,
int
k
,
int
d
)
{
p
[
k
>>
4
]
^=
(
word
)(((
word
)
d
)
<<
((
k
<<
2
)
&
63
));
}
static
inline
int
Abc_TtGetHex
(
word
*
p
,
int
k
)
{
return
(
int
)(
p
[
k
>>
4
]
>>
((
k
<<
2
)
&
63
))
&
15
;
}
static
inline
void
Abc_TtSetHex
(
word
*
p
,
int
k
,
int
d
)
{
p
[
k
>>
4
]
|=
(((
word
)
d
)
<<
((
k
<<
2
)
&
63
));
}
static
inline
void
Abc_TtXorHex
(
word
*
p
,
int
k
,
int
d
)
{
p
[
k
>>
4
]
^=
(((
word
)
d
)
<<
((
k
<<
2
)
&
63
));
}
// read/write k-th digit d of a 256-base number:
static
inline
int
Abc_TtGet256
(
word
*
p
,
int
k
)
{
return
(
int
)(
p
[
k
>>
3
]
>>
(
word
)((
k
<<
3
)
&
63
))
&
255
;
}
static
inline
void
Abc_TtSet256
(
word
*
p
,
int
k
,
int
d
)
{
p
[
k
>>
3
]
|=
(
word
)(((
word
)
d
)
<<
((
k
<<
3
)
&
63
));
}
static
inline
void
Abc_TtXor256
(
word
*
p
,
int
k
,
int
d
)
{
p
[
k
>>
3
]
^=
(
word
)(((
word
)
d
)
<<
((
k
<<
3
)
&
63
));
}
static
inline
int
Abc_TtGet256
(
word
*
p
,
int
k
)
{
return
(
int
)(
p
[
k
>>
3
]
>>
((
k
<<
3
)
&
63
))
&
255
;
}
static
inline
void
Abc_TtSet256
(
word
*
p
,
int
k
,
int
d
)
{
p
[
k
>>
3
]
|=
(((
word
)
d
)
<<
((
k
<<
3
)
&
63
));
}
static
inline
void
Abc_TtXor256
(
word
*
p
,
int
k
,
int
d
)
{
p
[
k
>>
3
]
^=
(((
word
)
d
)
<<
((
k
<<
3
)
&
63
));
}
// read/write k-th digit d of a 2^16-base number:
static
inline
int
Abc_TtGet65536
(
word
*
p
,
int
k
)
{
return
(
int
)(
p
[
k
>>
2
]
>>
((
k
<<
4
)
&
63
))
&
0xFFFF
;
}
static
inline
void
Abc_TtSet65536
(
word
*
p
,
int
k
,
int
d
)
{
p
[
k
>>
2
]
|=
(((
word
)
d
)
<<
((
k
<<
4
)
&
63
));
}
static
inline
void
Abc_TtXor65536
(
word
*
p
,
int
k
,
int
d
)
{
p
[
k
>>
2
]
^=
(((
word
)
d
)
<<
((
k
<<
4
)
&
63
));
}
// read/write k-th digit d of a 2^2^v-base number:
static
inline
int
Abc_TtGetV
(
word
*
p
,
int
v
,
int
k
)
{
return
(
int
)((
p
[
k
>>
(
6
-
v
)]
<<
(
64
-
(
1
<<
v
)
-
((
k
<<
v
)
&
63
)))
>>
(
64
-
(
1
<<
v
)));}
static
inline
void
Abc_TtSetV
(
word
*
p
,
int
v
,
int
k
,
int
d
)
{
p
[
k
>>
(
6
-
v
)]
|=
(((
word
)
d
)
<<
((
k
<<
v
)
&
63
));
}
static
inline
void
Abc_TtXorV
(
word
*
p
,
int
v
,
int
k
,
int
d
)
{
p
[
k
>>
(
6
-
v
)]
^=
(((
word
)
d
)
<<
((
k
<<
v
)
&
63
));
}
/**Function*************************************************************
...
...
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