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
7802db98
Commit
7802db98
authored
Feb 23, 2013
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Integrating sweeping information.
parent
8281b56e
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
73 additions
and
36 deletions
+73
-36
src/aig/gia/gia.h
+5
-1
src/aig/gia/giaAig.c
+8
-6
src/aig/gia/giaAiger.c
+16
-1
src/aig/gia/giaIf.c
+9
-6
src/aig/gia/giaMan.c
+1
-1
src/aig/gia/giaSweep.c
+4
-3
src/aig/gia/giaTim.c
+25
-15
src/misc/tim/tim.h
+1
-1
src/misc/tim/timMan.c
+4
-2
No files found.
src/aig/gia/gia.h
View file @
7802db98
...
...
@@ -160,7 +160,11 @@ struct Gia_Man_t_
void
*
pLutLib
;
// LUT library
word
nHashHit
;
// hash table hit
word
nHashMiss
;
// hash table miss
unsigned
*
pData2
;
// storage for object values
unsigned
*
pData
;
// various user data
unsigned
*
pData2
;
// various user data
int
iData
;
// various user data
int
iData2
;
// various user data
int
nAnd2Delay
;
// AND2 delay scaled to match delay numbers used
int
fVerbose
;
// verbose reports
// truth table computation for small functions
int
nTtVars
;
// truth table variables
...
...
src/aig/gia/giaAig.c
View file @
7802db98
...
...
@@ -550,7 +550,6 @@ void Gia_ManReprFromAigRepr2( Aig_Man_t * pAig, Gia_Man_t * pGia )
***********************************************************************/
Gia_Man_t
*
Gia_ManCompress2
(
Gia_Man_t
*
p
,
int
fUpdateLevel
,
int
fVerbose
)
{
// extern Aig_Man_t * Dar_ManCompress2( Aig_Man_t * pAig, int fBalance, int fUpdateLevel, int fFanout, int fPower, int fVerbose );
Gia_Man_t
*
pGia
;
Aig_Man_t
*
pNew
,
*
pTemp
;
if
(
p
->
pManTime
&&
p
->
vLevels
==
NULL
)
...
...
@@ -560,9 +559,9 @@ Gia_Man_t * Gia_ManCompress2( Gia_Man_t * p, int fUpdateLevel, int fVerbose )
Aig_ManStop
(
pTemp
);
pGia
=
Gia_ManFromAig
(
pNew
);
Aig_ManStop
(
pNew
);
pGia
->
pManTime
=
p
->
pManTime
;
p
->
pManTime
=
NULL
;
pGia
->
pAigExtra
=
p
->
pAigExtra
;
p
->
pAigExtra
=
NULL
;
// Gia_ManLevelWithBoxes( pGia )
;
pGia
->
pManTime
=
p
->
pManTime
;
p
->
pManTime
=
NULL
;
pGia
->
pAigExtra
=
p
->
pAigExtra
;
p
->
pAigExtra
=
NULL
;
pGia
->
nAnd2Delay
=
p
->
nAnd2Delay
;
p
->
nAnd2Delay
=
0
;
return
pGia
;
}
...
...
@@ -581,13 +580,16 @@ Gia_Man_t * Gia_ManPerformDch( Gia_Man_t * p, void * pPars )
{
Gia_Man_t
*
pGia
;
Aig_Man_t
*
pNew
;
if
(
p
->
pManTime
&&
p
->
vLevels
==
NULL
)
Gia_ManLevelWithBoxes
(
p
);
pNew
=
Gia_ManToAig
(
p
,
0
);
pNew
=
Dar_ManChoiceNew
(
pNew
,
(
Dch_Pars_t
*
)
pPars
);
// pGia = Gia_ManFromAig( pNew );
pGia
=
Gia_ManFromAigChoices
(
pNew
);
Aig_ManStop
(
pNew
);
pGia
->
pManTime
=
p
->
pManTime
;
p
->
pManTime
=
NULL
;
pGia
->
pAigExtra
=
p
->
pAigExtra
;
p
->
pAigExtra
=
NULL
;
pGia
->
pManTime
=
p
->
pManTime
;
p
->
pManTime
=
NULL
;
pGia
->
pAigExtra
=
p
->
pAigExtra
;
p
->
pAigExtra
=
NULL
;
pGia
->
nAnd2Delay
=
p
->
nAnd2Delay
;
p
->
nAnd2Delay
=
0
;
return
pGia
;
}
...
...
src/aig/gia/giaAiger.c
View file @
7802db98
...
...
@@ -521,6 +521,13 @@ Gia_Man_t * Gia_AigerReadFromMemory( char * pContents, int nFileSize, int fSkipS
if
(
fVerbose
)
printf
(
"Finished reading extension
\"
c
\"
.
\n
"
);
}
// read delay information
else
if
(
*
pCur
==
'd'
)
{
pCur
++
;
assert
(
Gia_AigerReadInt
(
pCur
)
==
4
);
pCur
+=
4
;
pNew
->
nAnd2Delay
=
Gia_AigerReadInt
(
pCur
);
pCur
+=
4
;
if
(
fVerbose
)
printf
(
"Finished reading extension
\"
d
\"
.
\n
"
);
}
else
if
(
*
pCur
==
'i'
)
{
pCur
++
;
...
...
@@ -739,6 +746,8 @@ Gia_Man_t * Gia_AigerReadFromMemory( char * pContents, int nFileSize, int fSkipS
return NULL;
}
*/
// pNew->nAnd2Delay = 5;
return
pNew
;
}
...
...
@@ -1092,7 +1101,13 @@ void Gia_AigerWrite( Gia_Man_t * pInit, char * pFileName, int fWriteSymbols, int
Gia_FileWriteBufferSize( pFile, p->nConstrs );
}
*/
// write gate classes
// write timing information
if
(
p
->
nAnd2Delay
)
{
fprintf
(
pFile
,
"d"
);
Gia_FileWriteBufferSize
(
pFile
,
4
);
Gia_FileWriteBufferSize
(
pFile
,
p
->
nAnd2Delay
);
}
if
(
p
->
pManTime
)
{
Vec_Flt_t
*
vArrTimes
,
*
vReqTimes
;
...
...
src/aig/gia/giaIf.c
View file @
7802db98
...
...
@@ -1148,8 +1148,9 @@ Gia_Man_t * Gia_ManPerformMapping( Gia_Man_t * p, void * pp )
pNew
=
Gia_ManDupUnnormalize
(
p
);
if
(
pNew
==
NULL
)
return
NULL
;
pNew
->
pManTime
=
p
->
pManTime
;
p
->
pManTime
=
NULL
;
pNew
->
pAigExtra
=
p
->
pAigExtra
;
p
->
pAigExtra
=
NULL
;
pNew
->
pManTime
=
p
->
pManTime
;
p
->
pManTime
=
NULL
;
pNew
->
pAigExtra
=
p
->
pAigExtra
;
p
->
pAigExtra
=
NULL
;
pNew
->
nAnd2Delay
=
p
->
nAnd2Delay
;
p
->
nAnd2Delay
=
0
;
p
=
pNew
;
}
else
...
...
@@ -1187,15 +1188,17 @@ Gia_Man_t * Gia_ManPerformMapping( Gia_Man_t * p, void * pp )
// if ( pIfMan->pPars->fDelayOpt )
// Vec_IntFreeP( &pNew->vMapping );
// return the original (unmodified by the mapper) timing manager
pNew
->
pManTime
=
p
->
pManTime
;
p
->
pManTime
=
NULL
;
pNew
->
pAigExtra
=
p
->
pAigExtra
;
p
->
pAigExtra
=
NULL
;
pNew
->
pManTime
=
p
->
pManTime
;
p
->
pManTime
=
NULL
;
pNew
->
pAigExtra
=
p
->
pAigExtra
;
p
->
pAigExtra
=
NULL
;
pNew
->
nAnd2Delay
=
p
->
nAnd2Delay
;
p
->
nAnd2Delay
=
0
;
Gia_ManStop
(
p
);
// normalize and transfer mapping
pNew
=
Gia_ManDupNormalize
(
p
=
pNew
);
Gia_ManTransferMapping
(
p
,
pNew
);
Gia_ManTransferPacking
(
p
,
pNew
);
pNew
->
pManTime
=
p
->
pManTime
;
p
->
pManTime
=
NULL
;
pNew
->
pAigExtra
=
p
->
pAigExtra
;
p
->
pAigExtra
=
NULL
;
pNew
->
pManTime
=
p
->
pManTime
;
p
->
pManTime
=
NULL
;
pNew
->
pAigExtra
=
p
->
pAigExtra
;
p
->
pAigExtra
=
NULL
;
pNew
->
nAnd2Delay
=
p
->
nAnd2Delay
;
p
->
nAnd2Delay
=
0
;
// pNew->vPacking = p->vPacking; p->vPacking = NULL;
Gia_ManStop
(
p
);
...
...
src/aig/gia/giaMan.c
View file @
7802db98
...
...
@@ -335,7 +335,7 @@ void Gia_ManPrintStats( Gia_Man_t * p, int fTents, int fSwitch, int fCut )
if
(
p
->
pPlacement
)
Gia_ManPrintPlacement
(
p
);
if
(
p
->
pManTime
)
Tim_ManPrintStats
(
p
->
pManTime
);
Tim_ManPrintStats
(
p
->
pManTime
,
p
->
nAnd2Delay
);
// print register classes
Gia_ManPrintFlopClasses
(
p
);
Gia_ManPrintGateClasses
(
p
);
...
...
src/aig/gia/giaSweep.c
View file @
7802db98
...
...
@@ -317,12 +317,13 @@ Gia_Man_t * Gia_ManFraigSweep( Gia_Man_t * p, void * pPars )
// derive new AIG
assert
(
pNew
->
pManTime
==
NULL
);
assert
(
pNew
->
pAigExtra
==
NULL
);
pNew
->
pManTime
=
p
->
pManTime
;
pNew
->
pAigExtra
=
p
->
pAigExtra
;
pNew
->
pManTime
=
p
->
pManTime
;
pNew
->
pAigExtra
=
p
->
pAigExtra
;
pNew
->
nAnd2Delay
=
p
->
nAnd2Delay
;
pNew
=
Gia_ManFraigCreateGia
(
pTemp
=
pNew
);
assert
(
pTemp
->
pManTime
==
p
->
pManTime
);
assert
(
pTemp
->
pAigExtra
==
p
->
pAigExtra
);
pTemp
->
pManTime
=
NULL
;
pTemp
->
pManTime
=
NULL
;
pTemp
->
pAigExtra
=
NULL
;
Gia_ManStop
(
pTemp
);
// return the result
...
...
src/aig/gia/giaTim.c
View file @
7802db98
...
...
@@ -84,7 +84,7 @@ int Gia_ManOrderWithBoxes_rec( Gia_Man_t * p, Gia_Obj_t * pObj, Vec_Int_t * vNod
Gia_ObjSetTravIdCurrent
(
p
,
pObj
);
if
(
Gia_ObjIsCi
(
pObj
)
)
{
p
->
pData2
=
(
void
*
)(
ABC_PTRUINT_T
)
Gia_ObjCioId
(
pObj
);
p
->
iData2
=
Gia_ObjCioId
(
pObj
);
return
1
;
}
assert
(
Gia_ObjIsAnd
(
pObj
)
);
...
...
@@ -132,7 +132,7 @@ Vec_Int_t * Gia_ManOrderWithBoxes( Gia_Man_t * p )
pObj
=
Gia_ManPo
(
p
,
curCo
+
k
);
if
(
Gia_ManOrderWithBoxes_rec
(
p
,
Gia_ObjFanin0
(
pObj
),
vNodes
)
)
{
int
iCiNum
=
(
int
)(
ABC_PTRUINT_T
)
p
->
p
Data2
;
int
iCiNum
=
p
->
i
Data2
;
int
iBoxNum
=
Tim_ManBoxFindFromCiNum
(
p
->
pManTime
,
iCiNum
);
printf
(
"Boxes are not in a topological order. The command has to terminate.
\n
"
);
printf
(
"The following information may help debugging (numbers are 0-based):
\n
"
);
...
...
@@ -143,7 +143,7 @@ Vec_Int_t * Gia_ManOrderWithBoxes( Gia_Man_t * p )
Tim_ManBoxOutputFirst
(
p
->
pManTime
,
iBoxNum
),
Tim_ManBoxInputFirst
(
p
->
pManTime
,
iBoxNum
)
);
printf
(
"In a correct topological order, BoxB should preceed BoxA.
\n
"
);
Vec_IntFree
(
vNodes
);
p
->
pData2
=
NULL
;
p
->
iData2
=
0
;
return
NULL
;
}
}
...
...
@@ -395,9 +395,10 @@ int Gia_ManLevelWithBoxes_rec( Gia_Man_t * p, Gia_Obj_t * pObj )
}
int
Gia_ManLevelWithBoxes
(
Gia_Man_t
*
p
)
{
int
nAnd2Delay
=
p
->
nAnd2Delay
?
p
->
nAnd2Delay
:
1
;
Tim_Man_t
*
pTime
=
(
Tim_Man_t
*
)
p
->
pManTime
;
Gia_Obj_t
*
pObj
;
int
i
,
k
,
curCi
,
curCo
,
LevelMax
;
Gia_Obj_t
*
pObj
,
*
pObjIn
;
int
i
,
k
,
j
,
curCi
,
curCo
,
LevelMax
;
assert
(
Gia_ManRegNum
(
p
)
==
0
);
// copy const and real PIs
Gia_ManCleanLevels
(
p
,
Gia_ManObjNum
(
p
)
);
...
...
@@ -407,8 +408,7 @@ int Gia_ManLevelWithBoxes( Gia_Man_t * p )
for
(
i
=
0
;
i
<
Tim_ManPiNum
(
pTime
);
i
++
)
{
pObj
=
Gia_ManPi
(
p
,
i
);
// Gia_ObjSetLevel( p, pObj, Tim_ManGetCiArrival(pTime, i) );
Gia_ObjSetLevel
(
p
,
pObj
,
0
);
Gia_ObjSetLevel
(
p
,
pObj
,
Tim_ManGetCiArrival
(
pTime
,
i
)
/
nAnd2Delay
);
Gia_ObjSetTravIdCurrent
(
p
,
pObj
);
}
// create logic for each box
...
...
@@ -416,8 +416,11 @@ int Gia_ManLevelWithBoxes( Gia_Man_t * p )
curCo
=
0
;
for
(
i
=
0
;
i
<
Tim_ManBoxNum
(
pTime
);
i
++
)
{
LevelMax
=
0
;
for
(
k
=
0
;
k
<
Tim_ManBoxInputNum
(
pTime
,
i
);
k
++
)
int
nBoxInputs
=
Tim_ManBoxInputNum
(
pTime
,
i
);
int
nBoxOutputs
=
Tim_ManBoxOutputNum
(
pTime
,
i
);
float
*
pDelayTable
=
Tim_ManBoxDelayTable
(
pTime
,
i
);
// compute level for TFI of box inputs
for
(
k
=
0
;
k
<
nBoxInputs
;
k
++
)
{
pObj
=
Gia_ManPo
(
p
,
curCo
+
k
);
if
(
Gia_ManLevelWithBoxes_rec
(
p
,
Gia_ObjFanin0
(
pObj
)
)
)
...
...
@@ -425,18 +428,25 @@ int Gia_ManLevelWithBoxes( Gia_Man_t * p )
printf
(
"Boxes are not in a topological order. Switching to level computation without boxes.
\n
"
);
return
Gia_ManLevelNum
(
p
);
}
// set box input level
Gia_ObjSetCoLevel
(
p
,
pObj
);
LevelMax
=
Abc_MaxInt
(
LevelMax
,
Gia_ObjLevel
(
p
,
pObj
)
);
}
curCo
+=
Tim_ManBoxInputNum
(
pTime
,
i
);
LevelMax
++
;
for
(
k
=
0
;
k
<
Tim_ManBoxOutputNum
(
pTime
,
i
);
k
++
)
// compute level for box outputs
for
(
k
=
0
;
k
<
nBoxOutputs
;
k
++
)
{
pObj
=
Gia_ManPi
(
p
,
curCi
+
k
);
Gia_ObjSetLevel
(
p
,
pObj
,
LevelMax
);
Gia_ObjSetTravIdCurrent
(
p
,
pObj
);
// evaluate delay of this output
LevelMax
=
0
;
assert
(
nBoxInputs
==
(
int
)
pDelayTable
[
1
]
);
for
(
j
=
0
;
j
<
nBoxInputs
&&
(
pObjIn
=
Gia_ManPo
(
p
,
curCo
+
j
));
j
++
)
if
(
(
int
)
pDelayTable
[
3
+
k
*
nBoxInputs
+
j
]
!=
-
ABC_INFINITY
)
LevelMax
=
Abc_MaxInt
(
LevelMax
,
Gia_ObjLevel
(
p
,
pObjIn
)
+
((
int
)
pDelayTable
[
3
+
k
*
nBoxInputs
+
j
]
/
nAnd2Delay
)
);
// set box output level
Gia_ObjSetLevel
(
p
,
pObj
,
LevelMax
);
}
curCi
+=
Tim_ManBoxOutputNum
(
pTime
,
i
);
curCo
+=
nBoxInputs
;
curCi
+=
nBoxOutputs
;
}
// add remaining nodes
p
->
nLevels
=
0
;
...
...
src/misc/tim/tim.h
View file @
7802db98
...
...
@@ -134,7 +134,7 @@ extern int Tim_ManGetArrsReqs( Tim_Man_t * p, Vec_Flt_t ** pvInArrs,
extern
void
Tim_ManStop
(
Tim_Man_t
*
p
);
extern
void
Tim_ManStopP
(
Tim_Man_t
**
p
);
extern
void
Tim_ManPrint
(
Tim_Man_t
*
p
);
extern
void
Tim_ManPrintStats
(
Tim_Man_t
*
p
);
extern
void
Tim_ManPrintStats
(
Tim_Man_t
*
p
,
int
nAnd2Delay
);
extern
int
Tim_ManCiNum
(
Tim_Man_t
*
p
);
extern
int
Tim_ManCoNum
(
Tim_Man_t
*
p
);
extern
int
Tim_ManPiNum
(
Tim_Man_t
*
p
);
...
...
src/misc/tim/timMan.c
View file @
7802db98
...
...
@@ -488,7 +488,7 @@ void Tim_ManPrint( Tim_Man_t * p )
SeeAlso []
***********************************************************************/
void
Tim_ManPrintStats
(
Tim_Man_t
*
p
)
void
Tim_ManPrintStats
(
Tim_Man_t
*
p
,
int
nAnd2Delay
)
{
Tim_Box_t
*
pBox
;
Vec_Int_t
*
vCounts
;
...
...
@@ -497,10 +497,12 @@ void Tim_ManPrintStats( Tim_Man_t * p )
if
(
p
==
NULL
)
return
;
Abc_Print
(
1
,
"Hierarchy : "
);
printf
(
"PI/CI = %d/%d PO/CO = %d/%d Box = %d"
,
printf
(
"PI/CI = %d/%d PO/CO = %d/%d Box = %d
"
,
Tim_ManPiNum
(
p
),
Tim_ManCiNum
(
p
),
Tim_ManPoNum
(
p
),
Tim_ManCoNum
(
p
),
Tim_ManBoxNum
(
p
)
);
if
(
nAnd2Delay
)
printf
(
"delay(AND2) = %d"
,
nAnd2Delay
);
printf
(
"
\n
"
);
if
(
Tim_ManBoxNum
(
p
)
==
0
)
return
;
...
...
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