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
6ed334d4
Commit
6ed334d4
authored
Nov 24, 2014
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improvements to handling boxes and flops.
parent
8feac565
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
162 additions
and
61 deletions
+162
-61
src/aig/gia/gia.h
+1
-1
src/aig/gia/giaMan.c
+7
-5
src/aig/gia/giaMfs.c
+1
-1
src/aig/gia/giaSweep.c
+104
-41
src/aig/gia/giaTim.c
+2
-2
src/misc/tim/tim.h
+3
-1
src/misc/tim/timBox.c
+32
-0
src/misc/tim/timMan.c
+12
-10
No files found.
src/aig/gia/gia.h
View file @
6ed334d4
...
@@ -1359,7 +1359,7 @@ extern Gia_Man_t * Gia_ManDupUnshuffleInputs( Gia_Man_t * p );
...
@@ -1359,7 +1359,7 @@ extern Gia_Man_t * Gia_ManDupUnshuffleInputs( Gia_Man_t * p );
extern
int
Gia_ManLevelWithBoxes
(
Gia_Man_t
*
p
);
extern
int
Gia_ManLevelWithBoxes
(
Gia_Man_t
*
p
);
extern
int
Gia_ManLutLevelWithBoxes
(
Gia_Man_t
*
p
);
extern
int
Gia_ManLutLevelWithBoxes
(
Gia_Man_t
*
p
);
extern
void
*
Gia_ManUpdateTimMan
(
Gia_Man_t
*
p
,
Vec_Int_t
*
vBoxPres
);
extern
void
*
Gia_ManUpdateTimMan
(
Gia_Man_t
*
p
,
Vec_Int_t
*
vBoxPres
);
extern
void
*
Gia_ManUpdateTimMan2
(
Gia_Man_t
*
p
,
Vec_Int_t
*
vBoxesLeft
);
extern
void
*
Gia_ManUpdateTimMan2
(
Gia_Man_t
*
p
,
Vec_Int_t
*
vBoxesLeft
,
int
nTermsDiff
);
extern
Gia_Man_t
*
Gia_ManUpdateExtraAig
(
void
*
pTime
,
Gia_Man_t
*
pAig
,
Vec_Int_t
*
vBoxPres
);
extern
Gia_Man_t
*
Gia_ManUpdateExtraAig
(
void
*
pTime
,
Gia_Man_t
*
pAig
,
Vec_Int_t
*
vBoxPres
);
extern
Gia_Man_t
*
Gia_ManUpdateExtraAig2
(
void
*
pTime
,
Gia_Man_t
*
pAig
,
Vec_Int_t
*
vBoxesLeft
);
extern
Gia_Man_t
*
Gia_ManUpdateExtraAig2
(
void
*
pTime
,
Gia_Man_t
*
pAig
,
Vec_Int_t
*
vBoxesLeft
);
extern
Gia_Man_t
*
Gia_ManDupCollapse
(
Gia_Man_t
*
p
,
Gia_Man_t
*
pBoxes
,
Vec_Int_t
*
vBoxPres
,
int
fSeq
);
extern
Gia_Man_t
*
Gia_ManDupCollapse
(
Gia_Man_t
*
p
,
Gia_Man_t
*
pBoxes
,
Vec_Int_t
*
vBoxPres
,
int
fSeq
);
...
...
src/aig/gia/giaMan.c
View file @
6ed334d4
...
@@ -408,6 +408,8 @@ void Gia_ManPrintStats( Gia_Man_t * p, Gps_Par_t * pPars )
...
@@ -408,6 +408,8 @@ void Gia_ManPrintStats( Gia_Man_t * p, Gps_Par_t * pPars )
Abc_Print
(
1
,
"(c=%d)"
,
Gia_ManConstrNum
(
p
)
);
Abc_Print
(
1
,
"(c=%d)"
,
Gia_ManConstrNum
(
p
)
);
if
(
Gia_ManRegNum
(
p
)
)
if
(
Gia_ManRegNum
(
p
)
)
Abc_Print
(
1
,
" ff =%7d"
,
Gia_ManRegNum
(
p
)
);
Abc_Print
(
1
,
" ff =%7d"
,
Gia_ManRegNum
(
p
)
);
if
(
p
->
vRegClasses
)
Abc_Print
(
1
,
" boxff =%d(%d)"
,
Vec_IntSize
(
p
->
vRegClasses
),
Vec_IntFindMax
(
p
->
vRegClasses
)
);
#ifdef WIN32
#ifdef WIN32
{
{
...
@@ -466,11 +468,11 @@ void Gia_ManPrintStats( Gia_Man_t * p, Gps_Par_t * pPars )
...
@@ -466,11 +468,11 @@ void Gia_ManPrintStats( Gia_Man_t * p, Gps_Par_t * pPars )
Gia_ManPrintFlopClasses
(
p
);
Gia_ManPrintFlopClasses
(
p
);
Gia_ManPrintGateClasses
(
p
);
Gia_ManPrintGateClasses
(
p
);
Gia_ManPrintObjClasses
(
p
);
Gia_ManPrintObjClasses
(
p
);
if
(
p
->
vRegClasses
)
//
if ( p->vRegClasses )
{
//
{
printf
(
"The design has %d flops with the following class info: "
,
Vec_IntSize
(
p
->
vRegClasses
)
);
//
printf( "The design has %d flops with the following class info: ", Vec_IntSize(p->vRegClasses) );
Vec_IntPrint
(
p
->
vRegClasses
);
//
Vec_IntPrint( p->vRegClasses );
}
//
}
if
(
p
->
vInitClasses
)
if
(
p
->
vInitClasses
)
Gia_ManPrintInitClasses
(
p
->
vInitClasses
);
Gia_ManPrintInitClasses
(
p
->
vInitClasses
);
if
(
pPars
&&
pPars
->
fTents
)
if
(
pPars
&&
pPars
->
fTents
)
...
...
src/aig/gia/giaMfs.c
View file @
6ed334d4
...
@@ -341,7 +341,7 @@ Gia_Man_t * Gia_ManInsertMfs( Gia_Man_t * p, Sfm_Ntk_t * pNtk )
...
@@ -341,7 +341,7 @@ Gia_Man_t * Gia_ManInsertMfs( Gia_Man_t * p, Sfm_Ntk_t * pNtk )
// create new timing manager and extra AIG
// create new timing manager and extra AIG
if
(
pManTime
)
if
(
pManTime
)
pNew
->
pManTime
=
Gia_ManUpdateTimMan2
(
p
,
vBoxesLeft
);
pNew
->
pManTime
=
Gia_ManUpdateTimMan2
(
p
,
vBoxesLeft
,
0
);
// update extra STG
// update extra STG
if
(
p
->
pAigExtra
)
if
(
p
->
pAigExtra
)
pNew
->
pAigExtra
=
Gia_ManUpdateExtraAig2
(
p
->
pManTime
,
p
->
pAigExtra
,
vBoxesLeft
);
pNew
->
pAigExtra
=
Gia_ManUpdateExtraAig2
(
p
->
pManTime
,
p
->
pAigExtra
,
vBoxesLeft
);
...
...
src/aig/gia/giaSweep.c
View file @
6ed334d4
This diff is collapsed.
Click to expand it.
src/aig/gia/giaTim.c
View file @
6ed334d4
...
@@ -623,12 +623,12 @@ void * Gia_ManUpdateTimMan( Gia_Man_t * p, Vec_Int_t * vBoxPres )
...
@@ -623,12 +623,12 @@ void * Gia_ManUpdateTimMan( Gia_Man_t * p, Vec_Int_t * vBoxPres )
assert
(
Vec_IntSize
(
vBoxPres
)
==
Tim_ManBoxNum
(
pManTime
)
);
assert
(
Vec_IntSize
(
vBoxPres
)
==
Tim_ManBoxNum
(
pManTime
)
);
return
Tim_ManTrim
(
pManTime
,
vBoxPres
);
return
Tim_ManTrim
(
pManTime
,
vBoxPres
);
}
}
void
*
Gia_ManUpdateTimMan2
(
Gia_Man_t
*
p
,
Vec_Int_t
*
vBoxesLeft
)
void
*
Gia_ManUpdateTimMan2
(
Gia_Man_t
*
p
,
Vec_Int_t
*
vBoxesLeft
,
int
nTermsDiff
)
{
{
Tim_Man_t
*
pManTime
=
(
Tim_Man_t
*
)
p
->
pManTime
;
Tim_Man_t
*
pManTime
=
(
Tim_Man_t
*
)
p
->
pManTime
;
assert
(
pManTime
!=
NULL
);
assert
(
pManTime
!=
NULL
);
assert
(
Vec_IntSize
(
vBoxesLeft
)
<=
Tim_ManBoxNum
(
pManTime
)
);
assert
(
Vec_IntSize
(
vBoxesLeft
)
<=
Tim_ManBoxNum
(
pManTime
)
);
return
Tim_ManReduce
(
pManTime
,
vBoxesLeft
);
return
Tim_ManReduce
(
pManTime
,
vBoxesLeft
,
nTermsDiff
);
}
}
/**Function*************************************************************
/**Function*************************************************************
...
...
src/misc/tim/tim.h
View file @
6ed334d4
...
@@ -114,7 +114,9 @@ extern void Tim_ManCreateBox( Tim_Man_t * p, int firstIn, int nIns, i
...
@@ -114,7 +114,9 @@ extern void Tim_ManCreateBox( Tim_Man_t * p, int firstIn, int nIns, i
extern
int
Tim_ManBoxForCi
(
Tim_Man_t
*
p
,
int
iCo
);
extern
int
Tim_ManBoxForCi
(
Tim_Man_t
*
p
,
int
iCo
);
extern
int
Tim_ManBoxForCo
(
Tim_Man_t
*
p
,
int
iCi
);
extern
int
Tim_ManBoxForCo
(
Tim_Man_t
*
p
,
int
iCi
);
extern
int
Tim_ManBoxInputFirst
(
Tim_Man_t
*
p
,
int
iBox
);
extern
int
Tim_ManBoxInputFirst
(
Tim_Man_t
*
p
,
int
iBox
);
extern
int
Tim_ManBoxInputLast
(
Tim_Man_t
*
p
,
int
iBox
);
extern
int
Tim_ManBoxOutputFirst
(
Tim_Man_t
*
p
,
int
iBox
);
extern
int
Tim_ManBoxOutputFirst
(
Tim_Man_t
*
p
,
int
iBox
);
extern
int
Tim_ManBoxOutputLast
(
Tim_Man_t
*
p
,
int
iBox
);
extern
int
Tim_ManBoxInputNum
(
Tim_Man_t
*
p
,
int
iBox
);
extern
int
Tim_ManBoxInputNum
(
Tim_Man_t
*
p
,
int
iBox
);
extern
int
Tim_ManBoxOutputNum
(
Tim_Man_t
*
p
,
int
iBox
);
extern
int
Tim_ManBoxOutputNum
(
Tim_Man_t
*
p
,
int
iBox
);
extern
int
Tim_ManBoxDelayTableId
(
Tim_Man_t
*
p
,
int
iBox
);
extern
int
Tim_ManBoxDelayTableId
(
Tim_Man_t
*
p
,
int
iBox
);
...
@@ -130,7 +132,7 @@ extern Tim_Man_t * Tim_ManLoad( Vec_Str_t * p, int fHieOnly );
...
@@ -130,7 +132,7 @@ extern Tim_Man_t * Tim_ManLoad( Vec_Str_t * p, int fHieOnly );
extern
Tim_Man_t
*
Tim_ManStart
(
int
nCis
,
int
nCos
);
extern
Tim_Man_t
*
Tim_ManStart
(
int
nCis
,
int
nCos
);
extern
Tim_Man_t
*
Tim_ManDup
(
Tim_Man_t
*
p
,
int
fUnitDelay
);
extern
Tim_Man_t
*
Tim_ManDup
(
Tim_Man_t
*
p
,
int
fUnitDelay
);
extern
Tim_Man_t
*
Tim_ManTrim
(
Tim_Man_t
*
p
,
Vec_Int_t
*
vBoxPres
);
extern
Tim_Man_t
*
Tim_ManTrim
(
Tim_Man_t
*
p
,
Vec_Int_t
*
vBoxPres
);
extern
Tim_Man_t
*
Tim_ManReduce
(
Tim_Man_t
*
p
,
Vec_Int_t
*
vBoxesLeft
);
extern
Tim_Man_t
*
Tim_ManReduce
(
Tim_Man_t
*
p
,
Vec_Int_t
*
vBoxesLeft
,
int
nTermsDiff
);
extern
Vec_Int_t
*
Tim_ManAlignTwo
(
Tim_Man_t
*
pSpec
,
Tim_Man_t
*
pImpl
);
extern
Vec_Int_t
*
Tim_ManAlignTwo
(
Tim_Man_t
*
pSpec
,
Tim_Man_t
*
pImpl
);
extern
void
Tim_ManCreate
(
Tim_Man_t
*
p
,
void
*
pLib
,
Vec_Flt_t
*
vInArrs
,
Vec_Flt_t
*
vOutReqs
);
extern
void
Tim_ManCreate
(
Tim_Man_t
*
p
,
void
*
pLib
,
Vec_Flt_t
*
vInArrs
,
Vec_Flt_t
*
vOutReqs
);
extern
float
*
Tim_ManGetArrTimes
(
Tim_Man_t
*
p
);
extern
float
*
Tim_ManGetArrTimes
(
Tim_Man_t
*
p
);
...
...
src/misc/tim/timBox.c
View file @
6ed334d4
...
@@ -126,6 +126,22 @@ int Tim_ManBoxInputFirst( Tim_Man_t * p, int iBox )
...
@@ -126,6 +126,22 @@ int Tim_ManBoxInputFirst( Tim_Man_t * p, int iBox )
/**Function*************************************************************
/**Function*************************************************************
Synopsis [Returns the last input of the box.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int
Tim_ManBoxInputLast
(
Tim_Man_t
*
p
,
int
iBox
)
{
return
Tim_ManBox
(
p
,
iBox
)
->
Inouts
[
0
]
+
Tim_ManBoxInputNum
(
p
,
iBox
)
-
1
;
}
/**Function*************************************************************
Synopsis [Returns the first output of the box.]
Synopsis [Returns the first output of the box.]
Description []
Description []
...
@@ -142,6 +158,22 @@ int Tim_ManBoxOutputFirst( Tim_Man_t * p, int iBox )
...
@@ -142,6 +158,22 @@ int Tim_ManBoxOutputFirst( Tim_Man_t * p, int iBox )
/**Function*************************************************************
/**Function*************************************************************
Synopsis [Returns the last output of the box.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int
Tim_ManBoxOutputLast
(
Tim_Man_t
*
p
,
int
iBox
)
{
return
Tim_ManBox
(
p
,
iBox
)
->
Inouts
[
Tim_ManBox
(
p
,
iBox
)
->
nInputs
]
+
Tim_ManBoxOutputNum
(
p
,
iBox
)
-
1
;
}
/**Function*************************************************************
Synopsis [Returns the number of box inputs.]
Synopsis [Returns the number of box inputs.]
Description []
Description []
...
...
src/misc/tim/timMan.c
View file @
6ed334d4
...
@@ -248,25 +248,27 @@ Tim_Man_t * Tim_ManTrim( Tim_Man_t * p, Vec_Int_t * vBoxPres )
...
@@ -248,25 +248,27 @@ Tim_Man_t * Tim_ManTrim( Tim_Man_t * p, Vec_Int_t * vBoxPres )
SeeAlso []
SeeAlso []
***********************************************************************/
***********************************************************************/
Tim_Man_t
*
Tim_ManReduce
(
Tim_Man_t
*
p
,
Vec_Int_t
*
vBoxesLeft
)
Tim_Man_t
*
Tim_ManReduce
(
Tim_Man_t
*
p
,
Vec_Int_t
*
vBoxesLeft
,
int
nTermsDiff
)
{
{
Tim_Man_t
*
pNew
;
Tim_Man_t
*
pNew
;
Tim_Box_t
*
pBox
;
Tim_Box_t
*
pBox
;
Tim_Obj_t
*
pObj
;
Tim_Obj_t
*
pObj
;
float
*
pDelayTable
,
*
pDelayTableNew
;
float
*
pDelayTable
,
*
pDelayTableNew
;
int
i
,
k
,
iBox
,
nNewCis
,
nNewCos
,
nInputs
,
nOutputs
;
int
i
,
k
,
iBox
,
nNewCis
,
nNewCos
,
nInputs
,
nOutputs
;
int
nNewPiNum
=
Tim_ManPiNum
(
p
)
-
nTermsDiff
;
int
nNewPoNum
=
Tim_ManPoNum
(
p
)
-
nTermsDiff
;
assert
(
Vec_IntSize
(
vBoxesLeft
)
<=
Tim_ManBoxNum
(
p
)
);
assert
(
Vec_IntSize
(
vBoxesLeft
)
<=
Tim_ManBoxNum
(
p
)
);
// count the number of CIs and COs in the trimmed manager
// count the number of CIs and COs in the trimmed manager
nNewCis
=
Tim_ManPiNum
(
p
)
;
nNewCis
=
nNewPiNum
;
nNewCos
=
Tim_ManPoNum
(
p
)
;
nNewCos
=
nNewPoNum
;
Vec_IntForEachEntry
(
vBoxesLeft
,
iBox
,
i
)
Vec_IntForEachEntry
(
vBoxesLeft
,
iBox
,
i
)
{
{
pBox
=
Tim_ManBox
(
p
,
iBox
);
pBox
=
Tim_ManBox
(
p
,
iBox
);
nNewCis
+=
pBox
->
nOutputs
;
nNewCis
+=
pBox
->
nOutputs
;
nNewCos
+=
pBox
->
nInputs
;
nNewCos
+=
pBox
->
nInputs
;
}
}
assert
(
nNewCis
<=
Tim_ManCiNum
(
p
)
);
assert
(
nNewCis
<=
Tim_ManCiNum
(
p
)
-
nTermsDiff
);
assert
(
nNewCos
<=
Tim_ManCoNum
(
p
)
);
assert
(
nNewCos
<=
Tim_ManCoNum
(
p
)
-
nTermsDiff
);
// clear traversal IDs
// clear traversal IDs
Tim_ManForEachCi
(
p
,
pObj
,
i
)
Tim_ManForEachCi
(
p
,
pObj
,
i
)
pObj
->
TravId
=
0
;
pObj
->
TravId
=
0
;
...
@@ -275,10 +277,10 @@ Tim_Man_t * Tim_ManReduce( Tim_Man_t * p, Vec_Int_t * vBoxesLeft )
...
@@ -275,10 +277,10 @@ Tim_Man_t * Tim_ManReduce( Tim_Man_t * p, Vec_Int_t * vBoxesLeft )
// create new manager
// create new manager
pNew
=
Tim_ManStart
(
nNewCis
,
nNewCos
);
pNew
=
Tim_ManStart
(
nNewCis
,
nNewCos
);
// copy box connectivity information
// copy box connectivity information
memcpy
(
pNew
->
pCis
,
p
->
pCis
,
sizeof
(
Tim_Obj_t
)
*
Tim_ManPiNum
(
p
)
);
memcpy
(
pNew
->
pCis
,
p
->
pCis
,
sizeof
(
Tim_Obj_t
)
*
nNewPiNum
);
memcpy
(
pNew
->
pCos
+
nNewCos
-
Tim_ManPoNum
(
p
)
,
memcpy
(
pNew
->
pCos
+
nNewCos
-
nNewPoNum
,
p
->
pCos
+
Tim_ManCoNum
(
p
)
-
Tim_ManPoNum
(
p
),
p
->
pCos
+
Tim_ManCoNum
(
p
)
-
Tim_ManPoNum
(
p
),
sizeof
(
Tim_Obj_t
)
*
Tim_ManPoNum
(
p
)
);
sizeof
(
Tim_Obj_t
)
*
nNewPoNum
);
// duplicate delay tables
// duplicate delay tables
if
(
Tim_ManDelayTableNum
(
p
)
>
0
)
if
(
Tim_ManDelayTableNum
(
p
)
>
0
)
{
{
...
@@ -304,7 +306,7 @@ Tim_Man_t * Tim_ManReduce( Tim_Man_t * p, Vec_Int_t * vBoxesLeft )
...
@@ -304,7 +306,7 @@ Tim_Man_t * Tim_ManReduce( Tim_Man_t * p, Vec_Int_t * vBoxesLeft )
// duplicate boxes
// duplicate boxes
if
(
Tim_ManBoxNum
(
p
)
>
0
)
if
(
Tim_ManBoxNum
(
p
)
>
0
)
{
{
int
curPi
=
Tim_ManPiNum
(
p
)
;
int
curPi
=
nNewPiNum
;
int
curPo
=
0
;
int
curPo
=
0
;
pNew
->
vBoxes
=
Vec_PtrAlloc
(
Tim_ManBoxNum
(
p
)
);
pNew
->
vBoxes
=
Vec_PtrAlloc
(
Tim_ManBoxNum
(
p
)
);
Vec_IntForEachEntry
(
vBoxesLeft
,
iBox
,
i
)
Vec_IntForEachEntry
(
vBoxesLeft
,
iBox
,
i
)
...
@@ -315,7 +317,7 @@ Tim_Man_t * Tim_ManReduce( Tim_Man_t * p, Vec_Int_t * vBoxesLeft )
...
@@ -315,7 +317,7 @@ Tim_Man_t * Tim_ManReduce( Tim_Man_t * p, Vec_Int_t * vBoxesLeft )
curPi
+=
pBox
->
nOutputs
;
curPi
+=
pBox
->
nOutputs
;
curPo
+=
pBox
->
nInputs
;
curPo
+=
pBox
->
nInputs
;
}
}
curPo
+=
Tim_ManPoNum
(
p
)
;
curPo
+=
nNewPoNum
;
assert
(
curPi
==
Tim_ManCiNum
(
pNew
)
);
assert
(
curPi
==
Tim_ManCiNum
(
pNew
)
);
assert
(
curPo
==
Tim_ManCoNum
(
pNew
)
);
assert
(
curPo
==
Tim_ManCoNum
(
pNew
)
);
}
}
...
...
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