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
b0968094
Commit
b0968094
authored
Feb 20, 2013
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Integrating sweeping information.
parent
aa7daf1e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
32 additions
and
52 deletions
+32
-52
src/aig/gia/gia.h
+2
-3
src/aig/gia/giaAiger.c
+0
-12
src/aig/gia/giaDup.c
+1
-1
src/aig/gia/giaIf.c
+3
-5
src/aig/gia/giaSweep.c
+18
-24
src/aig/gia/giaTim.c
+0
-0
src/misc/tim/timMan.c
+8
-7
No files found.
src/aig/gia/gia.h
View file @
b0968094
...
...
@@ -978,9 +978,8 @@ extern float Gia_ManEvaluateSwitching( Gia_Man_t * p );
extern
float
Gia_ManComputeSwitching
(
Gia_Man_t
*
p
,
int
nFrames
,
int
nPref
,
int
fProbOne
);
/*=== giaTim.c ===========================================================*/
extern
Gia_Man_t
*
Gia_ManDupNormalize
(
Gia_Man_t
*
p
);
extern
Gia_Man_t
*
Gia_ManDupUnnomalize
(
Gia_Man_t
*
p
);
extern
Gia_Man_t
*
Gia_ManDupWithHierarchy
(
Gia_Man_t
*
p
,
Vec_Int_t
**
pvNodes
);
extern
Gia_Man_t
*
Gia_ManDupWithBoxes
(
Gia_Man_t
*
p
,
Gia_Man_t
*
pBoxes
);
extern
Gia_Man_t
*
Gia_ManDupUnnormalize
(
Gia_Man_t
*
p
);
extern
Gia_Man_t
*
Gia_ManDupCollapse
(
Gia_Man_t
*
p
,
Gia_Man_t
*
pBoxes
);
extern
int
Gia_ManLevelWithBoxes
(
Gia_Man_t
*
p
);
extern
int
Gia_ManVerifyWithBoxes
(
Gia_Man_t
*
pGia
,
void
*
pParsInit
);
extern
void
*
Gia_ManUpdateTimMan
(
Gia_Man_t
*
p
,
Vec_Int_t
*
vBoxPres
);
...
...
src/aig/gia/giaAiger.c
View file @
b0968094
...
...
@@ -726,22 +726,10 @@ Gia_Man_t * Gia_AigerReadFromMemory( char * pContents, int nFileSize, int fSkipS
if
(
Abc_FrameReadLibBox
()
==
NULL
)
printf
(
"Cannot create TIM manager because box library is not available.
\n
"
);
else
{
Tim_ManCreate
(
(
Tim_Man_t
*
)
pNew
->
pManTime
,
Abc_FrameReadLibBox
(),
pNew
->
vInArrs
,
pNew
->
vOutReqs
);
// Tim_ManPrint( (Tim_Man_t *)pNew->pManTime );
// printf( "Created timing manager using Tim_ManCreate().\n" );
}
}
Vec_FltFreeP
(
&
pNew
->
vInArrs
);
Vec_FltFreeP
(
&
pNew
->
vOutReqs
);
/*
if ( pNew->pManTime )
{
pNew = Gia_ManDupUnnomalize( pTemp = pNew );
Gia_ManStop( pTemp );
}
*/
/*
// check the result
if ( fCheck && !Gia_ManCheck( pNew ) )
...
...
src/aig/gia/giaDup.c
View file @
b0968094
...
...
@@ -245,7 +245,7 @@ Gia_Man_t * Gia_ManDupOutputVec( Gia_Man_t * p, Vec_Int_t * vOutPres )
pObj
->
Value
=
Gia_ManAppendCi
(
pNew
);
Gia_ManForEachPo
(
p
,
pObj
,
i
)
if
(
Vec_IntEntry
(
vOutPres
,
i
)
)
Gia_ManDupOrderDfs_rec
(
pNew
,
p
,
pObj
);
Gia_ManDupOrderDfs_rec
(
pNew
,
p
,
Gia_ObjFanin0
(
pObj
)
);
Gia_ManForEachPo
(
p
,
pObj
,
i
)
if
(
Vec_IntEntry
(
vOutPres
,
i
)
)
pObj
->
Value
=
Gia_ManAppendCo
(
pNew
,
Gia_ObjFanin0Copy
(
pObj
)
);
...
...
src/aig/gia/giaIf.c
View file @
b0968094
...
...
@@ -229,7 +229,7 @@ void Gia_ManPrintMappingStats( Gia_Man_t * p )
LevelMax
=
Abc_MaxInt
(
LevelMax
,
pLevels
[
i
]
);
}
ABC_FREE
(
pLevels
);
Abc_Print
(
1
,
"
m
apping (K=%d) : "
,
nLutSize
);
Abc_Print
(
1
,
"
M
apping (K=%d) : "
,
nLutSize
);
Abc_Print
(
1
,
"lut =%7d "
,
nLuts
);
Abc_Print
(
1
,
"edge =%8d "
,
nFanins
);
Abc_Print
(
1
,
"lev =%5d "
,
LevelMax
);
...
...
@@ -277,7 +277,7 @@ void Gia_ManPrintPackingStats( Gia_Man_t * p )
MaxSize
=
2
;
else
if
(
nNumStr
[
1
]
>
0
)
MaxSize
=
1
;
Abc_Print
(
1
,
"
p
acking (N=%d) : "
,
MaxSize
);
Abc_Print
(
1
,
"
P
acking (N=%d) : "
,
MaxSize
);
for
(
i
=
1
;
i
<=
MaxSize
;
i
++
)
Abc_Print
(
1
,
"%d x LUT = %d "
,
i
,
nNumStr
[
i
]
);
Abc_Print
(
1
,
"Total = %d"
,
nEntries2
);
...
...
@@ -1141,11 +1141,10 @@ Gia_Man_t * Gia_ManPerformMapping( Gia_Man_t * p, void * pp )
Gia_Man_t
*
pNew
;
If_Man_t
*
pIfMan
;
If_Par_t
*
pPars
=
(
If_Par_t
*
)
pp
;
Vec_Int_t
*
vNodes
=
NULL
;
// reconstruct GIA according to the hierarchy manager
if
(
p
->
pManTime
)
{
pNew
=
Gia_ManDup
WithHierarchy
(
p
,
&
vNodes
);
pNew
=
Gia_ManDup
Unnormalize
(
p
);
if
(
pNew
==
NULL
)
return
NULL
;
pNew
->
pManTime
=
p
->
pManTime
;
p
->
pManTime
=
NULL
;
...
...
@@ -1154,7 +1153,6 @@ Gia_Man_t * Gia_ManPerformMapping( Gia_Man_t * p, void * pp )
}
else
p
=
Gia_ManDup
(
p
);
Vec_IntFreeP
(
&
vNodes
);
// set the arrival times
assert
(
pPars
->
pTimesArr
==
NULL
);
pPars
->
pTimesArr
=
ABC_CALLOC
(
float
,
Gia_ManCiNum
(
p
)
);
...
...
src/aig/gia/giaSweep.c
View file @
b0968094
...
...
@@ -24,7 +24,6 @@
ABC_NAMESPACE_IMPL_START
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
...
...
@@ -62,7 +61,10 @@ Gia_Obj_t * Gia_ManFraigMarkCos( Gia_Man_t * p, Gia_Obj_t * pObj, int fMark )
{
for
(
assert
(
Gia_ObjIsCo
(
pObj
)
);
Gia_ObjIsCo
(
pObj
);
pObj
--
)
if
(
fMark
)
{
Gia_ObjSetTravIdCurrent
(
p
,
pObj
);
Gia_ObjSetTravIdCurrent
(
p
,
Gia_ObjFanin0
(
pObj
)
);
}
return
pObj
;
}
Gia_Obj_t
*
Gia_ManFraigMarkAnd
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
)
...
...
@@ -133,6 +135,9 @@ Gia_Man_t * Gia_ManFraigCreateGia( Gia_Man_t * p )
assert
(
pNew
->
pAigExtra
==
NULL
);
pNew
->
pAigExtra
=
Gia_ManUpdateExtraAig
(
p
->
pManTime
,
p
->
pAigExtra
,
vBoxPres
);
Vec_IntFree
(
vBoxPres
);
// assert( Gia_ManPiNum(pNew) == Tim_ManCiNum(pNew->pManTime) );
// assert( Gia_ManPoNum(pNew) == Tim_ManCoNum(pNew->pManTime) );
// assert( Gia_ManPiNum(pNew) == Tim_ManPiNum(pNew->pManTime) + Gia_ManPoNum(pNew->pAigExtra) );
return
pNew
;
}
...
...
@@ -149,19 +154,19 @@ Gia_Man_t * Gia_ManFraigCreateGia( Gia_Man_t * p )
***********************************************************************/
int
Gia_ObjFanin0CopyRepr
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
,
int
*
pReprs
)
{
int
fan
in
Id
=
Gia_ObjFaninId0p
(
p
,
pObj
);
if
(
pReprs
[
fan
in
Id
]
==
-
1
)
int
fanId
=
Gia_ObjFaninId0p
(
p
,
pObj
);
if
(
pReprs
[
fanId
]
==
-
1
)
return
Gia_ObjFanin0Copy
(
pObj
);
assert
(
Abc_Lit2Var
(
pReprs
[
fan
in
Id
])
<
Gia_ObjId
(
p
,
pObj
)
);
return
Abc_LitNotCond
(
Gia_ObjValue
(
Gia_ManObj
(
p
,
Abc_Lit2Var
(
pReprs
[
fan
inId
]))),
Gia_ObjFaninC0
(
pObj
)
^
Abc_LitIsCompl
(
pReprs
[
fani
nId
])
);
assert
(
Abc_Lit2Var
(
pReprs
[
fanId
])
<
Gia_ObjId
(
p
,
pObj
)
);
return
Abc_LitNotCond
(
Gia_ObjValue
(
Gia_ManObj
(
p
,
Abc_Lit2Var
(
pReprs
[
fan
Id
]))),
Gia_ObjFaninC0
(
pObj
)
^
Abc_LitIsCompl
(
pReprs
[
fa
nId
])
);
}
int
Gia_ObjFanin1CopyRepr
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
,
int
*
pReprs
)
{
int
fan
in
Id
=
Gia_ObjFaninId1p
(
p
,
pObj
);
if
(
pReprs
[
fan
in
Id
]
==
-
1
)
int
fanId
=
Gia_ObjFaninId1p
(
p
,
pObj
);
if
(
pReprs
[
fanId
]
==
-
1
)
return
Gia_ObjFanin1Copy
(
pObj
);
assert
(
Abc_Lit2Var
(
pReprs
[
fan
in
Id
])
<
Gia_ObjId
(
p
,
pObj
)
);
return
Abc_LitNotCond
(
Gia_ObjValue
(
Gia_ManObj
(
p
,
Abc_Lit2Var
(
pReprs
[
fan
inId
]))),
Gia_ObjFaninC1
(
pObj
)
^
Abc_LitIsCompl
(
pReprs
[
fani
nId
])
);
assert
(
Abc_Lit2Var
(
pReprs
[
fanId
])
<
Gia_ObjId
(
p
,
pObj
)
);
return
Abc_LitNotCond
(
Gia_ObjValue
(
Gia_ManObj
(
p
,
Abc_Lit2Var
(
pReprs
[
fan
Id
]))),
Gia_ObjFaninC1
(
pObj
)
^
Abc_LitIsCompl
(
pReprs
[
fa
nId
])
);
}
Gia_Man_t
*
Gia_ManFraigReduceGia
(
Gia_Man_t
*
p
,
int
*
pReprs
)
{
...
...
@@ -188,15 +193,6 @@ Gia_Man_t * Gia_ManFraigReduceGia( Gia_Man_t * p, int * pReprs )
else
assert
(
0
);
}
Gia_ManHashStop
(
pNew
);
/*
{
Gia_Man_t * pTemp;
Gia_ManPrintStats( pNew, 0, 0, 0 );
pNew = Gia_ManCleanup( pTemp = pNew );
Gia_ManStop( pTemp );
Gia_ManPrintStats( pNew, 0, 0, 0 );
}
*/
return
pNew
;
}
...
...
@@ -233,23 +229,21 @@ int * Gia_ManFraigSelectReprs( Gia_Man_t * p, Gia_Man_t * pGia, int fVerbose )
pGia2Abc
[
iReprGia
]
=
i
;
else
{
// iLitGia2 = Abc2_ObjCopyId( p, pGia2Abc[iReprGia] );
iLitGia2
=
Gia_ObjValue
(
Gia_ManObj
(
p
,
pGia2Abc
[
iReprGia
])
);
assert
(
Gia_ObjReprSelf
(
pGia
,
Abc_Lit2Var
(
iLitGia
))
==
Gia_ObjReprSelf
(
pGia
,
Abc_Lit2Var
(
iLitGia2
))
);
fCompl
=
Abc_LitIsCompl
(
iLitGia
)
^
Abc_LitIsCompl
(
iLitGia2
);
fCompl
^=
Gia_ManObj
(
pGia
,
Abc_Lit2Var
(
iLitGia
))
->
fPhase
;
fCompl
^=
Gia_ManObj
(
pGia
,
Abc_Lit2Var
(
iLitGia2
))
->
fPhase
;
pReprs
[
i
]
=
Abc_Var2Lit
(
pGia2Abc
[
iReprGia
],
fCompl
);
assert
(
Abc_Lit2Var
(
pReprs
[
i
])
<
i
);
if
(
pGia2Abc
[
iReprGia
]
==
0
)
nConsts
++
;
else
nReprs
++
;
assert
(
Abc_Lit2Var
(
pReprs
[
i
])
<
i
);
// printf( "%d -> %d\n", i, Abc_Lit2Var(pReprs[i]) );
}
}
ABC_FREE
(
pGia2Abc
);
//
if ( fVerbose )
if
(
fVerbose
)
printf
(
"Found %d const reprs and %d other reprs.
\n
"
,
nConsts
,
nReprs
);
return
pReprs
;
}
...
...
@@ -305,12 +299,12 @@ Gia_Man_t * Gia_ManFraigSweep( Gia_Man_t * p, void * pPars )
return
NULL
;
}
// ordering AIG objects
pNew
=
Gia_ManDup
WithHierarchy
(
p
,
NULL
);
pNew
=
Gia_ManDup
Unnormalize
(
p
);
if
(
pNew
==
NULL
)
return
NULL
;
// find global equivalences
pNew
->
pManTime
=
p
->
pManTime
;
pGia
=
Gia_ManDup
WithBoxes
(
pNew
,
p
->
pAigExtra
);
pGia
=
Gia_ManDup
Collapse
(
pNew
,
p
->
pAigExtra
);
pNew
->
pManTime
=
NULL
;
Gia_ManFraigSweepPerform
(
pGia
,
pPars
);
// transfer equivalences
...
...
src/aig/gia/giaTim.c
View file @
b0968094
This diff is collapsed.
Click to expand it.
src/misc/tim/timMan.c
View file @
b0968094
...
...
@@ -168,12 +168,13 @@ Tim_Man_t * Tim_ManTrim( Tim_Man_t * p, Vec_Int_t * vBoxPres )
// count the number of CIs and COs in the trimmed manager
nNewCis
=
Tim_ManPiNum
(
p
);
nNewCos
=
Tim_ManPoNum
(
p
);
Tim_ManForEachBox
(
p
,
pBox
,
i
)
if
(
Vec_IntEntry
(
vBoxPres
,
i
)
)
{
nNewCis
+=
pBox
->
nOutputs
;
nNewCos
+=
pBox
->
nInputs
;
}
if
(
Tim_ManBoxNum
(
p
)
)
Tim_ManForEachBox
(
p
,
pBox
,
i
)
if
(
Vec_IntEntry
(
vBoxPres
,
i
)
)
{
nNewCis
+=
pBox
->
nOutputs
;
nNewCos
+=
pBox
->
nInputs
;
}
if
(
nNewCis
==
Tim_ManCiNum
(
p
)
&&
nNewCos
==
Tim_ManCoNum
(
p
)
)
return
Tim_ManDup
(
p
,
0
);
assert
(
nNewCis
<
Tim_ManCiNum
(
p
)
);
...
...
@@ -494,7 +495,7 @@ void Tim_ManPrintStats( Tim_Man_t * p )
int
i
,
Count
,
IdMax
;
if
(
p
==
NULL
)
return
;
Abc_Print
(
1
,
"
h
ierarchy : "
);
Abc_Print
(
1
,
"
H
ierarchy : "
);
printf
(
"PI/CI = %d/%d PO/CO = %d/%d Box = %d"
,
Tim_ManPiNum
(
p
),
Tim_ManCiNum
(
p
),
Tim_ManPoNum
(
p
),
Tim_ManCoNum
(
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