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
024f9a2b
Commit
024f9a2b
authored
Dec 15, 2011
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Performance improvement in 'dch' for designs having nodes with many fanouts.
parent
f67cb76d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
28 deletions
+56
-28
src/aig/dar/darScript.c
+56
-28
No files found.
src/aig/dar/darScript.c
View file @
024f9a2b
...
...
@@ -86,7 +86,7 @@ Aig_Man_t * Dar_ManRwsat( Aig_Man_t * pAig, int fBalance, int fVerbose )
pParsRef
->
fVerbose
=
fVerbose
;
//printf( "1" );
pAig
=
Aig_ManDupDfs
(
pAig
);
if
(
fVerbose
)
Aig_ManPrintStats
(
pAig
);
if
(
fVerbose
)
printf
(
"Starting: "
),
Aig_ManPrintStats
(
pAig
);
//printf( "2" );
// balance
...
...
@@ -94,7 +94,7 @@ Aig_Man_t * Dar_ManRwsat( Aig_Man_t * pAig, int fBalance, int fVerbose )
{
pAig
=
Dar_ManBalance
(
pTemp
=
pAig
,
0
);
Aig_ManStop
(
pTemp
);
if
(
fVerbose
)
Aig_ManPrintStats
(
pAig
);
if
(
fVerbose
)
printf
(
"Balance: "
),
Aig_ManPrintStats
(
pAig
);
}
//Aig_ManDumpBlif( pAig, "inter.blif", NULL, NULL );
...
...
@@ -103,14 +103,14 @@ Aig_Man_t * Dar_ManRwsat( Aig_Man_t * pAig, int fBalance, int fVerbose )
Dar_ManRewrite
(
pAig
,
pParsRwr
);
pAig
=
Aig_ManDupDfs
(
pTemp
=
pAig
);
Aig_ManStop
(
pTemp
);
if
(
fVerbose
)
Aig_ManPrintStats
(
pAig
);
if
(
fVerbose
)
printf
(
"Rewrite: "
),
Aig_ManPrintStats
(
pAig
);
//printf( "4" );
// refactor
Dar_ManRefactor
(
pAig
,
pParsRef
);
pAig
=
Aig_ManDupDfs
(
pTemp
=
pAig
);
Aig_ManStop
(
pTemp
);
if
(
fVerbose
)
Aig_ManPrintStats
(
pAig
);
if
(
fVerbose
)
printf
(
"Refactor: "
),
Aig_ManPrintStats
(
pAig
);
//printf( "5" );
// balance
...
...
@@ -118,7 +118,7 @@ Aig_Man_t * Dar_ManRwsat( Aig_Man_t * pAig, int fBalance, int fVerbose )
{
pAig
=
Dar_ManBalance
(
pTemp
=
pAig
,
0
);
Aig_ManStop
(
pTemp
);
if
(
fVerbose
)
Aig_ManPrintStats
(
pAig
);
if
(
fVerbose
)
printf
(
"Balance: "
),
Aig_ManPrintStats
(
pAig
);
}
//printf( "6" );
...
...
@@ -126,7 +126,7 @@ Aig_Man_t * Dar_ManRwsat( Aig_Man_t * pAig, int fBalance, int fVerbose )
Dar_ManRewrite
(
pAig
,
pParsRwr
);
pAig
=
Aig_ManDupDfs
(
pTemp
=
pAig
);
Aig_ManStop
(
pTemp
);
if
(
fVerbose
)
Aig_ManPrintStats
(
pAig
);
if
(
fVerbose
)
printf
(
"Rewrite: "
),
Aig_ManPrintStats
(
pAig
);
//printf( "7" );
return
pAig
;
...
...
@@ -184,34 +184,34 @@ Aig_Man_t * Dar_ManCompress( Aig_Man_t * pAig, int fBalance, int fUpdateLevel, i
pParsRef
->
fVerbose
=
0
;
//fVerbose;
pAig
=
Aig_ManDupDfs
(
pAig
);
if
(
fVerbose
)
Aig_ManPrintStats
(
pAig
);
if
(
fVerbose
)
printf
(
"Starting: "
),
Aig_ManPrintStats
(
pAig
);
/*
// balance
if ( fBalance )
{
pAig = Dar_ManBalance( pTemp = pAig, fUpdateLevel );
Aig_ManStop( pTemp );
if ( fVerbose ) Aig_ManPrintStats( pAig );
if ( fVerbose )
printf( "Balance: " ),
Aig_ManPrintStats( pAig );
}
*/
// rewrite
Dar_ManRewrite
(
pAig
,
pParsRwr
);
pAig
=
Aig_ManDupDfs
(
pTemp
=
pAig
);
Aig_ManStop
(
pTemp
);
if
(
fVerbose
)
Aig_ManPrintStats
(
pAig
);
if
(
fVerbose
)
printf
(
"Rewrite: "
),
Aig_ManPrintStats
(
pAig
);
// refactor
Dar_ManRefactor
(
pAig
,
pParsRef
);
pAig
=
Aig_ManDupDfs
(
pTemp
=
pAig
);
Aig_ManStop
(
pTemp
);
if
(
fVerbose
)
Aig_ManPrintStats
(
pAig
);
if
(
fVerbose
)
printf
(
"Refactor: "
),
Aig_ManPrintStats
(
pAig
);
// balance
if
(
fBalance
)
{
pAig
=
Dar_ManBalance
(
pTemp
=
pAig
,
fUpdateLevel
);
Aig_ManStop
(
pTemp
);
if
(
fVerbose
)
Aig_ManPrintStats
(
pAig
);
if
(
fVerbose
)
printf
(
"Balance: "
),
Aig_ManPrintStats
(
pAig
);
}
pParsRwr
->
fUseZeros
=
1
;
...
...
@@ -221,7 +221,7 @@ Aig_Man_t * Dar_ManCompress( Aig_Man_t * pAig, int fBalance, int fUpdateLevel, i
Dar_ManRewrite
(
pAig
,
pParsRwr
);
pAig
=
Aig_ManDupDfs
(
pTemp
=
pAig
);
Aig_ManStop
(
pTemp
);
if
(
fVerbose
)
Aig_ManPrintStats
(
pAig
);
if
(
fVerbose
)
printf
(
"RewriteZ: "
),
Aig_ManPrintStats
(
pAig
);
return
pAig
;
}
...
...
@@ -264,7 +264,7 @@ Aig_Man_t * Dar_ManCompress2( Aig_Man_t * pAig, int fBalance, int fUpdateLevel,
{
pAig = Dar_ManBalance( pTemp = pAig, fUpdateLevel );
Aig_ManStop( pTemp );
if ( fVerbose ) Aig_ManPrintStats( pAig );
if ( fVerbose )
printf( "Balance: " ),
Aig_ManPrintStats( pAig );
}
*/
// rewrite
...
...
@@ -466,26 +466,26 @@ Aig_Man_t * Dar_NewCompress( Aig_Man_t * pAig, int fBalance, int fUpdateLevel, i
pParsRef
->
fVerbose
=
0
;
//fVerbose;
// pAig = Aig_ManDupDfs( pAig );
if
(
fVerbose
)
Aig_ManPrintStats
(
pAig
);
if
(
fVerbose
)
printf
(
"Starting: "
),
Aig_ManPrintStats
(
pAig
);
// rewrite
Dar_ManRewrite
(
pAig
,
pParsRwr
);
pAig
=
Aig_ManDupDfs
(
pTemp
=
pAig
);
Aig_ManStop
(
pTemp
);
if
(
fVerbose
)
Aig_ManPrintStats
(
pAig
);
if
(
fVerbose
)
printf
(
"Rewrite: "
),
Aig_ManPrintStats
(
pAig
);
// refactor
Dar_ManRefactor
(
pAig
,
pParsRef
);
pAig
=
Aig_ManDupDfs
(
pTemp
=
pAig
);
Aig_ManStop
(
pTemp
);
if
(
fVerbose
)
Aig_ManPrintStats
(
pAig
);
if
(
fVerbose
)
printf
(
"Refactor: "
),
Aig_ManPrintStats
(
pAig
);
// balance
if
(
fBalance
)
{
pAig
=
Dar_ManBalance
(
pTemp
=
pAig
,
fUpdateLevel
);
Aig_ManStop
(
pTemp
);
if
(
fVerbose
)
Aig_ManPrintStats
(
pAig
);
if
(
fVerbose
)
printf
(
"Balance: "
),
Aig_ManPrintStats
(
pAig
);
}
pParsRwr
->
fUseZeros
=
1
;
...
...
@@ -495,7 +495,7 @@ Aig_Man_t * Dar_NewCompress( Aig_Man_t * pAig, int fBalance, int fUpdateLevel, i
Dar_ManRewrite
(
pAig
,
pParsRwr
);
pAig
=
Aig_ManDupDfs
(
pTemp
=
pAig
);
Aig_ManStop
(
pTemp
);
if
(
fVerbose
)
Aig_ManPrintStats
(
pAig
);
if
(
fVerbose
)
printf
(
"RewriteZ: "
),
Aig_ManPrintStats
(
pAig
);
return
pAig
;
}
...
...
@@ -531,7 +531,7 @@ Aig_Man_t * Dar_NewCompress2( Aig_Man_t * pAig, int fBalance, int fUpdateLevel,
pParsRef
->
fVerbose
=
0
;
//fVerbose;
// pAig = Aig_ManDupDfs( pAig );
if
(
fVerbose
)
Aig_ManPrintStats
(
pAig
);
if
(
fVerbose
)
printf
(
"Starting: "
),
Aig_ManPrintStats
(
pAig
);
// skip if lighter synthesis is requested
if
(
!
fLightSynth
)
...
...
@@ -544,19 +544,19 @@ Aig_Man_t * Dar_NewCompress2( Aig_Man_t * pAig, int fBalance, int fUpdateLevel,
pAig
=
Aig_ManDupDfs
(
pTemp
=
pAig
);
Aig_ManStop
(
pTemp
);
if
(
fVerbose
)
Aig_ManPrintStats
(
pAig
);
if
(
fVerbose
)
printf
(
"Rewrite: "
),
Aig_ManPrintStats
(
pAig
);
// refactor
Dar_ManRefactor
(
pAig
,
pParsRef
);
pAig
=
Aig_ManDupDfs
(
pTemp
=
pAig
);
Aig_ManStop
(
pTemp
);
if
(
fVerbose
)
Aig_ManPrintStats
(
pAig
);
if
(
fVerbose
)
printf
(
"Refactor: "
),
Aig_ManPrintStats
(
pAig
);
}
// balance
pAig
=
Dar_ManBalance
(
pTemp
=
pAig
,
fUpdateLevel
);
Aig_ManStop
(
pTemp
);
if
(
fVerbose
)
Aig_ManPrintStats
(
pAig
);
if
(
fVerbose
)
printf
(
"Balance: "
),
Aig_ManPrintStats
(
pAig
);
// skip if lighter synthesis is requested
if
(
!
fLightSynth
)
...
...
@@ -565,7 +565,7 @@ Aig_Man_t * Dar_NewCompress2( Aig_Man_t * pAig, int fBalance, int fUpdateLevel,
Dar_ManRewrite
(
pAig
,
pParsRwr
);
pAig
=
Aig_ManDupDfs
(
pTemp
=
pAig
);
Aig_ManStop
(
pTemp
);
if
(
fVerbose
)
Aig_ManPrintStats
(
pAig
);
if
(
fVerbose
)
printf
(
"Rewrite: "
),
Aig_ManPrintStats
(
pAig
);
}
pParsRwr
->
fUseZeros
=
1
;
...
...
@@ -575,7 +575,7 @@ Aig_Man_t * Dar_NewCompress2( Aig_Man_t * pAig, int fBalance, int fUpdateLevel,
Dar_ManRewrite
(
pAig
,
pParsRwr
);
pAig
=
Aig_ManDupDfs
(
pTemp
=
pAig
);
Aig_ManStop
(
pTemp
);
if
(
fVerbose
)
Aig_ManPrintStats
(
pAig
);
if
(
fVerbose
)
printf
(
"RewriteZ: "
),
Aig_ManPrintStats
(
pAig
);
// skip if lighter synthesis is requested
if
(
!
fLightSynth
)
...
...
@@ -585,7 +585,7 @@ Aig_Man_t * Dar_NewCompress2( Aig_Man_t * pAig, int fBalance, int fUpdateLevel,
{
pAig
=
Dar_ManBalance
(
pTemp
=
pAig
,
fUpdateLevel
);
Aig_ManStop
(
pTemp
);
if
(
fVerbose
)
Aig_ManPrintStats
(
pAig
);
if
(
fVerbose
)
printf
(
"Balance: "
),
Aig_ManPrintStats
(
pAig
);
}
}
...
...
@@ -593,7 +593,7 @@ Aig_Man_t * Dar_NewCompress2( Aig_Man_t * pAig, int fBalance, int fUpdateLevel,
Dar_ManRefactor
(
pAig
,
pParsRef
);
pAig
=
Aig_ManDupDfs
(
pTemp
=
pAig
);
Aig_ManStop
(
pTemp
);
if
(
fVerbose
)
Aig_ManPrintStats
(
pAig
);
if
(
fVerbose
)
printf
(
"RefactorZ: "
),
Aig_ManPrintStats
(
pAig
);
// skip if lighter synthesis is requested
if
(
!
fLightSynth
)
...
...
@@ -602,7 +602,7 @@ Aig_Man_t * Dar_NewCompress2( Aig_Man_t * pAig, int fBalance, int fUpdateLevel,
Dar_ManRewrite
(
pAig
,
pParsRwr
);
pAig
=
Aig_ManDupDfs
(
pTemp
=
pAig
);
Aig_ManStop
(
pTemp
);
if
(
fVerbose
)
Aig_ManPrintStats
(
pAig
);
if
(
fVerbose
)
printf
(
"RewriteZ: "
),
Aig_ManPrintStats
(
pAig
);
}
// balance
...
...
@@ -610,13 +610,34 @@ Aig_Man_t * Dar_NewCompress2( Aig_Man_t * pAig, int fBalance, int fUpdateLevel,
{
pAig
=
Dar_ManBalance
(
pTemp
=
pAig
,
fUpdateLevel
);
Aig_ManStop
(
pTemp
);
if
(
fVerbose
)
Aig_ManPrintStats
(
pAig
);
if
(
fVerbose
)
printf
(
"Balance: "
),
Aig_ManPrintStats
(
pAig
);
}
return
pAig
;
}
/**Function*************************************************************
Synopsis [Count the number of nodes with very high fanout count.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int
Dar_NewChoiceSynthesisGuard
(
Aig_Man_t
*
pAig
)
{
Aig_Obj_t
*
pObj
;
int
i
,
Count
=
0
;
Aig_ManForEachNode
(
pAig
,
pObj
,
i
)
if
(
Aig_ObjRefs
(
pObj
)
>
1000
)
Count
+=
Aig_ObjRefs
(
pObj
)
/
1000
;
return
(
int
)(
Count
>
10
);
}
/**Function*************************************************************
Synopsis [Reproduces script "compress2".]
Description [Takes AIG manager, consumes it, and produces GIA manager.]
...
...
@@ -634,6 +655,13 @@ Gia_Man_t * Dar_NewChoiceSynthesis( Aig_Man_t * pAig, int fBalance, int fUpdateL
Gia_Man_t
*
pGia
,
*
pTemp
;
int
i
;
if
(
fUpdateLevel
&&
Dar_NewChoiceSynthesisGuard
(
pAig
)
)
{
if
(
fVerbose
)
printf
(
"Warning: Due to high fanout count of some nodes, level updating is disabled.
\n
"
);
fUpdateLevel
=
0
;
}
vGias
=
Vec_PtrAlloc
(
3
);
pGia
=
Gia_ManFromAig
(
pAig
);
Vec_PtrPush
(
vGias
,
pGia
);
...
...
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