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
846da1d2
Commit
846da1d2
authored
Sep 30, 2013
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changing default values.
parent
3d5744f8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
6 deletions
+57
-6
src/aig/gia/giaBalance.c
+4
-3
src/base/abci/abcFx.c
+53
-3
No files found.
src/aig/gia/giaBalance.c
View file @
846da1d2
...
@@ -470,7 +470,8 @@ int Dam_ManDivSlack( Dam_Man_t * p, int iLit0, int iLit1, int LevR )
...
@@ -470,7 +470,8 @@ int Dam_ManDivSlack( Dam_Man_t * p, int iLit0, int iLit1, int LevR )
{
{
int
Lev0
=
Gia_ObjLevel
(
p
->
pGia
,
Gia_ManObj
(
p
->
pGia
,
Abc_Lit2Var
(
iLit0
)));
int
Lev0
=
Gia_ObjLevel
(
p
->
pGia
,
Gia_ManObj
(
p
->
pGia
,
Abc_Lit2Var
(
iLit0
)));
int
Lev1
=
Gia_ObjLevel
(
p
->
pGia
,
Gia_ManObj
(
p
->
pGia
,
Abc_Lit2Var
(
iLit1
)));
int
Lev1
=
Gia_ObjLevel
(
p
->
pGia
,
Gia_ManObj
(
p
->
pGia
,
Abc_Lit2Var
(
iLit1
)));
return
p
->
nLevelMax
-
LevR
-
Abc_MaxInt
(
Lev0
,
Lev1
)
-
1
-
(
int
)(
iLit0
>
iLit1
);
int
Slack
=
p
->
nLevelMax
-
LevR
-
Abc_MaxInt
(
Lev0
,
Lev1
)
-
1
-
(
int
)(
iLit0
>
iLit1
);
return
Abc_MinInt
(
Slack
,
100
);
}
}
void
Dam_ManCreateMultiRefs
(
Dam_Man_t
*
p
,
Vec_Int_t
**
pvRefsAnd
,
Vec_Int_t
**
pvRefsXor
)
void
Dam_ManCreateMultiRefs
(
Dam_Man_t
*
p
,
Vec_Int_t
**
pvRefsAnd
,
Vec_Int_t
**
pvRefsXor
)
{
{
...
@@ -583,7 +584,7 @@ void Dam_ManCreatePairs( Dam_Man_t * p, int fVerbose )
...
@@ -583,7 +584,7 @@ void Dam_ManCreatePairs( Dam_Man_t * p, int fVerbose )
Num
=
Hash_Int2ManInsert
(
p
->
vHash
,
Hash_IntObjData0
(
vHash
,
i
),
Hash_IntObjData1
(
vHash
,
i
),
0
);
Num
=
Hash_Int2ManInsert
(
p
->
vHash
,
Hash_IntObjData0
(
vHash
,
i
),
Hash_IntObjData1
(
vHash
,
i
),
0
);
assert
(
Num
==
Hash_IntManEntryNum
(
p
->
vHash
)
);
assert
(
Num
==
Hash_IntManEntryNum
(
p
->
vHash
)
);
assert
(
Num
==
Vec_FltSize
(
p
->
vCounts
)
);
assert
(
Num
==
Vec_FltSize
(
p
->
vCounts
)
);
Vec_FltPush
(
p
->
vCounts
,
nRefs
+
0
.
00
1
*
Dam_ManDivSlack
(
p
,
Hash_IntObjData0
(
vHash
,
i
),
Hash_IntObjData1
(
vHash
,
i
),
Vec_IntEntry
(
vLevRMax
,
i
))
);
Vec_FltPush
(
p
->
vCounts
,
nRefs
+
0
.
00
5
*
Dam_ManDivSlack
(
p
,
Hash_IntObjData0
(
vHash
,
i
),
Hash_IntObjData1
(
vHash
,
i
),
Vec_IntEntry
(
vLevRMax
,
i
))
);
Vec_QuePush
(
p
->
vQue
,
Num
);
Vec_QuePush
(
p
->
vQue
,
Num
);
// remember divisors
// remember divisors
assert
(
Num
==
Vec_IntSize
(
p
->
vDiv2Nod
)
);
assert
(
Num
==
Vec_IntSize
(
p
->
vDiv2Nod
)
);
...
@@ -853,7 +854,7 @@ void Dam_ManUpdate( Dam_Man_t * p, int iDiv )
...
@@ -853,7 +854,7 @@ void Dam_ManUpdate( Dam_Man_t * p, int iDiv )
nRefs
=
Hash_IntObjData2
(
p
->
vHash
,
i
);
nRefs
=
Hash_IntObjData2
(
p
->
vHash
,
i
);
if
(
nRefs
<
2
)
if
(
nRefs
<
2
)
continue
;
continue
;
Vec_FltWriteEntry
(
p
->
vCounts
,
i
,
nRefs
+
0
.
00
0
1
*
Dam_ManDivSlack
(
p
,
Hash_IntObjData0
(
p
->
vHash
,
i
),
Hash_IntObjData1
(
p
->
vHash
,
i
),
Vec_IntEntry
(
p
->
vDivLevR
,
i
))
);
Vec_FltWriteEntry
(
p
->
vCounts
,
i
,
nRefs
+
0
.
001
*
Dam_ManDivSlack
(
p
,
Hash_IntObjData0
(
p
->
vHash
,
i
),
Hash_IntObjData1
(
p
->
vHash
,
i
),
Vec_IntEntry
(
p
->
vDivLevR
,
i
))
);
Vec_QuePush
(
p
->
vQue
,
i
);
Vec_QuePush
(
p
->
vQue
,
i
);
// remember divisors
// remember divisors
Vec_IntWriteEntry
(
p
->
vDiv2Nod
,
i
,
Vec_IntSize
(
p
->
vNodStore
)
);
Vec_IntWriteEntry
(
p
->
vDiv2Nod
,
i
,
Vec_IntSize
(
p
->
vNodStore
)
);
...
...
src/base/abci/abcFx.c
View file @
846da1d2
...
@@ -95,6 +95,7 @@ struct Fx_Man_t_
...
@@ -95,6 +95,7 @@ struct Fx_Man_t_
Vec_Flt_t
*
vWeights
;
// divisor weights
Vec_Flt_t
*
vWeights
;
// divisor weights
Vec_Que_t
*
vPrio
;
// priority queue for divisors by weight
Vec_Que_t
*
vPrio
;
// priority queue for divisors by weight
Vec_Int_t
*
vVarCube
;
// mapping ObjId into its first cube
Vec_Int_t
*
vVarCube
;
// mapping ObjId into its first cube
Vec_Int_t
*
vLevels
;
// variable levels
// temporary data to update the data-structure when a divisor is extracted
// temporary data to update the data-structure when a divisor is extracted
Vec_Int_t
*
vCubesS
;
// single cubes for the given divisor
Vec_Int_t
*
vCubesS
;
// single cubes for the given divisor
Vec_Int_t
*
vCubesD
;
// cube pairs for the given divisor
Vec_Int_t
*
vCubesD
;
// cube pairs for the given divisor
...
@@ -368,6 +369,7 @@ void Fx_ManStop( Fx_Man_t * p )
...
@@ -368,6 +369,7 @@ void Fx_ManStop( Fx_Man_t * p )
Vec_FltFree
(
p
->
vWeights
);
Vec_FltFree
(
p
->
vWeights
);
Vec_QueFree
(
p
->
vPrio
);
Vec_QueFree
(
p
->
vPrio
);
Vec_IntFree
(
p
->
vVarCube
);
Vec_IntFree
(
p
->
vVarCube
);
Vec_IntFree
(
p
->
vLevels
);
// temporary data
// temporary data
Vec_IntFree
(
p
->
vCubesS
);
Vec_IntFree
(
p
->
vCubesS
);
Vec_IntFree
(
p
->
vCubesD
);
Vec_IntFree
(
p
->
vCubesD
);
...
@@ -379,6 +381,49 @@ void Fx_ManStop( Fx_Man_t * p )
...
@@ -379,6 +381,49 @@ void Fx_ManStop( Fx_Man_t * p )
/**Function*************************************************************
/**Function*************************************************************
Synopsis [Compute levels of the nodes.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
static
inline
int
Fx_ManComputeLevelDiv
(
Fx_Man_t
*
p
,
Vec_Int_t
*
vCubeFree
)
{
int
i
,
Lit
,
Level
=
0
;
Vec_IntForEachEntry
(
vCubeFree
,
Lit
,
i
)
Level
=
Abc_MaxInt
(
Level
,
Vec_IntEntry
(
p
->
vLevels
,
Abc_Lit2Var
(
Abc_Lit2Var
(
Lit
)))
);
return
Abc_MinInt
(
Level
,
200
);
}
static
inline
int
Fx_ManComputeLevelCube
(
Fx_Man_t
*
p
,
Vec_Int_t
*
vCube
)
{
int
k
,
Lit
,
Level
=
0
;
Vec_IntForEachEntryStart
(
vCube
,
Lit
,
k
,
1
)
Level
=
Abc_MaxInt
(
Level
,
Vec_IntEntry
(
p
->
vLevels
,
Abc_Lit2Var
(
Lit
))
);
return
Level
;
}
void
Fx_ManComputeLevel
(
Fx_Man_t
*
p
)
{
Vec_Int_t
*
vCube
;
int
i
,
iVar
,
iFirst
=
0
;
iVar
=
Vec_IntEntry
(
Vec_WecEntry
(
p
->
vCubes
,
0
),
0
);
p
->
vLevels
=
Vec_IntStart
(
p
->
nVars
);
Vec_WecForEachLevel
(
p
->
vCubes
,
vCube
,
i
)
{
Vec_IntUpdateEntry
(
p
->
vLevels
,
Vec_IntEntry
(
vCube
,
0
),
Fx_ManComputeLevelCube
(
p
,
vCube
)
);
if
(
iVar
==
Vec_IntEntry
(
vCube
,
0
)
)
continue
;
// add the number of cubes
Vec_IntAddToEntry
(
p
->
vLevels
,
iVar
,
i
-
iFirst
);
iVar
=
Vec_IntEntry
(
vCube
,
0
);
iFirst
=
i
;
}
}
/**Function*************************************************************
Synopsis [Printing procedures.]
Synopsis [Printing procedures.]
Description []
Description []
...
@@ -748,7 +793,7 @@ int Fx_ManCubeSingleCubeDivisors( Fx_Man_t * p, Vec_Int_t * vPivot, int fRemove,
...
@@ -748,7 +793,7 @@ int Fx_ManCubeSingleCubeDivisors( Fx_Man_t * p, Vec_Int_t * vPivot, int fRemove,
{
{
if
(
Vec_FltSize
(
p
->
vWeights
)
==
iDiv
)
if
(
Vec_FltSize
(
p
->
vWeights
)
==
iDiv
)
{
{
Vec_FltPush
(
p
->
vWeights
,
-
2
);
Vec_FltPush
(
p
->
vWeights
,
-
2
-
0
.
001
*
Fx_ManComputeLevelDiv
(
p
,
p
->
vCubeFree
)
);
p
->
nDivsS
++
;
p
->
nDivsS
++
;
}
}
assert
(
iDiv
<
Vec_FltSize
(
p
->
vWeights
)
);
assert
(
iDiv
<
Vec_FltSize
(
p
->
vWeights
)
);
...
@@ -800,7 +845,7 @@ void Fx_ManCubeDoubleCubeDivisors( Fx_Man_t * p, int iFirst, Vec_Int_t * vPivot,
...
@@ -800,7 +845,7 @@ void Fx_ManCubeDoubleCubeDivisors( Fx_Man_t * p, int iFirst, Vec_Int_t * vPivot,
if
(
!
fRemove
)
if
(
!
fRemove
)
{
{
if
(
iDiv
==
Vec_FltSize
(
p
->
vWeights
)
)
if
(
iDiv
==
Vec_FltSize
(
p
->
vWeights
)
)
Vec_FltPush
(
p
->
vWeights
,
-
Vec_IntSize
(
p
->
vCubeFree
));
Vec_FltPush
(
p
->
vWeights
,
-
Vec_IntSize
(
p
->
vCubeFree
)
-
0
.
001
*
Fx_ManComputeLevelDiv
(
p
,
p
->
vCubeFree
)
);
assert
(
iDiv
<
Vec_FltSize
(
p
->
vWeights
)
);
assert
(
iDiv
<
Vec_FltSize
(
p
->
vWeights
)
);
Vec_FltAddToEntry
(
p
->
vWeights
,
iDiv
,
Base
+
Vec_IntSize
(
p
->
vCubeFree
)
-
1
);
Vec_FltAddToEntry
(
p
->
vWeights
,
iDiv
,
Base
+
Vec_IntSize
(
p
->
vCubeFree
)
-
1
);
p
->
nPairsD
++
;
p
->
nPairsD
++
;
...
@@ -938,7 +983,7 @@ void Fx_ManUpdate( Fx_Man_t * p, int iDiv )
...
@@ -938,7 +983,7 @@ void Fx_ManUpdate( Fx_Man_t * p, int iDiv )
Vec_Int_t
*
vCube
,
*
vCube2
,
*
vLitP
,
*
vLitN
;
Vec_Int_t
*
vCube
,
*
vCube2
,
*
vLitP
,
*
vLitN
;
Vec_Int_t
*
vDiv
=
p
->
vDiv
;
Vec_Int_t
*
vDiv
=
p
->
vDiv
;
int
nLitsNew
=
p
->
nLits
-
(
int
)
Vec_FltEntry
(
p
->
vWeights
,
iDiv
);
int
nLitsNew
=
p
->
nLits
-
(
int
)
Vec_FltEntry
(
p
->
vWeights
,
iDiv
);
int
i
,
k
,
Lit0
,
Lit1
,
iVarNew
,
RetValue
;
int
i
,
k
,
Lit0
,
Lit1
,
iVarNew
,
RetValue
,
Level
;
// get the divisor and select pivot variables
// get the divisor and select pivot variables
p
->
nDivs
++
;
p
->
nDivs
++
;
...
@@ -996,6 +1041,7 @@ void Fx_ManUpdate( Fx_Man_t * p, int iDiv )
...
@@ -996,6 +1041,7 @@ void Fx_ManUpdate( Fx_Man_t * p, int iDiv )
{
{
Vec_IntPush
(
vCube
,
Abc_LitNot
(
Lit0
)
);
Vec_IntPush
(
vCube
,
Abc_LitNot
(
Lit0
)
);
Vec_IntPush
(
vCube
,
Abc_LitNot
(
Lit1
)
);
Vec_IntPush
(
vCube
,
Abc_LitNot
(
Lit1
)
);
Level
=
1
+
Fx_ManComputeLevelCube
(
p
,
vCube
);
}
}
else
else
{
{
...
@@ -1003,7 +1049,10 @@ void Fx_ManUpdate( Fx_Man_t * p, int iDiv )
...
@@ -1003,7 +1049,10 @@ void Fx_ManUpdate( Fx_Man_t * p, int iDiv )
vCube
=
Vec_WecEntry
(
p
->
vCubes
,
Vec_WecSize
(
p
->
vCubes
)
-
2
);
vCube
=
Vec_WecEntry
(
p
->
vCubes
,
Vec_WecSize
(
p
->
vCubes
)
-
2
);
Vec_IntPush
(
vCube2
,
iVarNew
);
Vec_IntPush
(
vCube2
,
iVarNew
);
Fx_ManDivAddLits
(
vCube
,
vCube2
,
vDiv
);
Fx_ManDivAddLits
(
vCube
,
vCube2
,
vDiv
);
Level
=
2
+
Abc_MaxInt
(
Fx_ManComputeLevelCube
(
p
,
vCube
),
Fx_ManComputeLevelCube
(
p
,
vCube2
)
);
}
}
assert
(
Vec_IntSize
(
p
->
vLevels
)
==
iVarNew
);
Vec_IntPush
(
p
->
vLevels
,
Level
);
// do not add new cubes to the matrix
// do not add new cubes to the matrix
p
->
nLits
+=
Vec_IntSize
(
vDiv
);
p
->
nLits
+=
Vec_IntSize
(
vDiv
);
// create new literals
// create new literals
...
@@ -1121,6 +1170,7 @@ int Fx_FastExtract( Vec_Wec_t * vCubes, int ObjIdMax, int nNewNodesMax, int LitC
...
@@ -1121,6 +1170,7 @@ int Fx_FastExtract( Vec_Wec_t * vCubes, int ObjIdMax, int nNewNodesMax, int LitC
p
=
Fx_ManStart
(
vCubes
);
p
=
Fx_ManStart
(
vCubes
);
p
->
LitCountMax
=
LitCountMax
;
p
->
LitCountMax
=
LitCountMax
;
Fx_ManCreateLiterals
(
p
,
ObjIdMax
);
Fx_ManCreateLiterals
(
p
,
ObjIdMax
);
Fx_ManComputeLevel
(
p
);
Fx_ManCreateDivisors
(
p
);
Fx_ManCreateDivisors
(
p
);
if
(
fVeryVerbose
)
if
(
fVeryVerbose
)
Fx_PrintMatrix
(
p
);
Fx_PrintMatrix
(
p
);
...
...
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