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
bb86d914
Commit
bb86d914
authored
Jul 20, 2011
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New demitering features.
parent
3ab9683d
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
155 additions
and
3 deletions
+155
-3
src/aig/saig/saig.h
+1
-0
src/aig/saig/saigMiter.c
+94
-0
src/base/abci/abc.c
+7
-3
src/base/abci/abcDar.c
+53
-0
No files found.
src/aig/saig/saig.h
View file @
bb86d914
...
...
@@ -170,6 +170,7 @@ extern int Saig_ManDemiterSimple( Aig_Man_t * p, Aig_Man_t ** ppAi
extern
int
Saig_ManDemiterSimpleDiff
(
Aig_Man_t
*
p
,
Aig_Man_t
**
ppAig0
,
Aig_Man_t
**
ppAig1
);
extern
int
Saig_ManDemiterDual
(
Aig_Man_t
*
p
,
Aig_Man_t
**
ppAig0
,
Aig_Man_t
**
ppAig1
);
extern
int
Ssw_SecSpecialMiter
(
Aig_Man_t
*
p0
,
Aig_Man_t
*
p1
,
int
nFrames
,
int
fVerbose
);
extern
int
Saig_ManDemiterNew
(
Aig_Man_t
*
pMan
);
/*=== saigOutdec.c ==========================================================*/
extern
Aig_Man_t
*
Saig_ManDecPropertyOutput
(
Aig_Man_t
*
pAig
,
int
nLits
,
int
fVerbose
);
/*=== saigPhase.c ==========================================================*/
...
...
src/aig/saig/saigMiter.c
View file @
bb86d914
...
...
@@ -1213,6 +1213,100 @@ int Ssw_SecSpecialMiter( Aig_Man_t * p0, Aig_Man_t * p1, int nFrames, int fVerbo
return
RetValue
;
}
/**Function*************************************************************
Synopsis [Performs demitering of the network.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int
Saig_ManDemiterNew
(
Aig_Man_t
*
pMan
)
{
Vec_Ptr_t
*
vSuper
,
*
vSupp0
,
*
vSupp1
;
Aig_Obj_t
*
pObj
,
*
pTemp
,
*
pFan0
,
*
pFan1
;
int
i
,
k
;
vSuper
=
Vec_PtrAlloc
(
100
);
Saig_ManForEachPo
(
pMan
,
pObj
,
i
)
{
if
(
pMan
->
nConstrs
&&
i
>=
pMan
->
nConstrs
)
break
;
printf
(
"Output %3d : "
,
i
);
if
(
Aig_ObjIsConst1
(
Aig_ObjFanin0
(
pObj
))
)
{
if
(
!
Aig_ObjFaninC0
(
pObj
)
)
printf
(
"Const1
\n
"
);
else
printf
(
"Const0
\n
"
);
continue
;
}
if
(
!
Aig_ObjIsNode
(
Aig_ObjFanin0
(
pObj
))
)
{
printf
(
"Terminal
\n
"
);
continue
;
}
// check AND
if
(
!
Aig_ObjFaninC0
(
pObj
)
)
{
printf
(
"AND "
);
if
(
Aig_ObjRecognizeExor
(
Aig_ObjFanin0
(
pObj
),
&
pFan0
,
&
pFan1
)
)
printf
(
" Yes"
);
else
printf
(
" No"
);
printf
(
"
\n
"
);
continue
;
}
// check OR
Aig_ObjCollectSuper
(
Aig_ObjFanin0
(
pObj
),
vSuper
);
printf
(
"OR with %d inputs "
,
Vec_PtrSize
(
vSuper
)
);
if
(
Vec_PtrSize
(
vSuper
)
==
2
)
{
if
(
Aig_ObjRecognizeExor
(
Aig_ObjFanin0
(
pObj
),
&
pFan0
,
&
pFan1
)
)
{
printf
(
" Yes"
);
printf
(
"
\n
"
);
vSupp0
=
Aig_Support
(
pMan
,
Aig_Regular
(
pFan0
)
);
Vec_PtrForEachEntry
(
Aig_Obj_t
*
,
vSupp0
,
pTemp
,
k
)
if
(
Saig_ObjIsLo
(
pMan
,
pTemp
)
)
printf
(
" %d"
,
Aig_ObjPioNum
(
pTemp
)
);
printf
(
"
\n
"
);
Vec_PtrFree
(
vSupp0
);
vSupp1
=
Aig_Support
(
pMan
,
Aig_Regular
(
pFan1
)
);
Vec_PtrForEachEntry
(
Aig_Obj_t
*
,
vSupp1
,
pTemp
,
k
)
if
(
Saig_ObjIsLo
(
pMan
,
pTemp
)
)
printf
(
" %d"
,
Aig_ObjPioNum
(
pTemp
)
);
printf
(
"
\n
"
);
Vec_PtrFree
(
vSupp1
);
}
else
printf
(
" No"
);
printf
(
"
\n
"
);
continue
;
}
/*
Vec_PtrForEachEntry( Aig_Obj_t *, vSuper, pTemp, k )
if ( Aig_ObjRecognizeExor(Aig_Regular(pTemp), &pFan0, &pFan1) )
{
printf( " Yes" );
if ( Aig_IsComplement(pTemp) )
pFan0 = Aig_Not(pFan0);
}
else
printf( " No" );
*/
printf
(
"
\n
"
);
}
Vec_PtrFree
(
vSuper
);
return
1
;
}
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////
...
...
src/base/abci/abc.c
View file @
bb86d914
...
...
@@ -5519,6 +5519,8 @@ int Abc_CommandDemiter( Abc_Frame_t * pAbc, int argc, char ** argv )
extern
int
Abc_NtkDarDemiter
(
Abc_Ntk_t
*
pNtk
);
extern
int
Abc_NtkDarDemiterDual
(
Abc_Ntk_t
*
pNtk
,
int
fVerbose
);
extern
int
Abc_NtkDarDemiterNew
(
Abc_Ntk_t
*
pNtk
);
// set defaults
fDual
=
0
;
fSeq
=
1
;
...
...
@@ -5554,14 +5556,16 @@ int Abc_CommandDemiter( Abc_Frame_t * pAbc, int argc, char ** argv )
return
1
;
}
// Abc_NtkDarDemiterNew( pNtk );
// return 0;
if
(
fDual
)
{
if
(
(
Abc_NtkPoNum
(
pNtk
)
&
1
)
)
{
Abc_Print
(
-
1
,
"The number of POs should be even.
\n
"
);
return
0
;
}
if
(
fDual
)
{
if
(
!
Abc_NtkDarDemiterDual
(
pNtk
,
fVerbose
)
)
{
Abc_Print
(
-
1
,
"Demitering has failed.
\n
"
);
...
...
src/base/abci/abcDar.c
View file @
bb86d914
...
...
@@ -2063,6 +2063,59 @@ int Abc_NtkDarDemiter( Abc_Ntk_t * pNtk )
SeeAlso []
***********************************************************************/
int
Abc_NtkDarDemiterNew
(
Abc_Ntk_t
*
pNtk
)
{
char
*
pFileNameGeneric
,
pFileName0
[
1000
],
pFileName1
[
1000
];
Aig_Man_t
*
pMan
,
*
pPart0
,
*
pPart1
;
//, * pMiter;
// derive the AIG manager
pMan
=
Abc_NtkToDar
(
pNtk
,
0
,
1
);
if
(
pMan
==
NULL
)
{
printf
(
"Converting network into AIG has failed.
\n
"
);
return
0
;
}
Saig_ManDemiterNew
(
pMan
);
Aig_ManStop
(
pMan
);
return
1
;
// if ( !Saig_ManDemiterSimple( pMan, &pPart0, &pPart1 ) )
if
(
!
Saig_ManDemiterSimpleDiff
(
pMan
,
&
pPart0
,
&
pPart1
)
)
{
printf
(
"Demitering has failed.
\n
"
);
return
0
;
}
// create file names
pFileNameGeneric
=
Extra_FileNameGeneric
(
pNtk
->
pSpec
);
sprintf
(
pFileName0
,
"%s%s"
,
pFileNameGeneric
,
"_part0.aig"
);
sprintf
(
pFileName1
,
"%s%s"
,
pFileNameGeneric
,
"_part1.aig"
);
ABC_FREE
(
pFileNameGeneric
);
// dump files
Ioa_WriteAiger
(
pPart0
,
pFileName0
,
0
,
0
);
Ioa_WriteAiger
(
pPart1
,
pFileName1
,
0
,
0
);
printf
(
"Demitering produced two files
\"
%s
\"
and
\"
%s
\"
.
\n
"
,
pFileName0
,
pFileName1
);
// create two-level miter
// pMiter = Saig_ManCreateMiterTwo( pPart0, pPart1, 2 );
// Aig_ManDumpBlif( pMiter, "miter01.blif", NULL, NULL );
// Aig_ManStop( pMiter );
// printf( "The new miter is written into file \"%s\".\n", "miter01.blif" );
Aig_ManStop
(
pPart0
);
Aig_ManStop
(
pPart1
);
Aig_ManStop
(
pMan
);
return
1
;
}
/**Function*************************************************************
Synopsis [Gives the current ABC network to AIG manager for processing.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int
Abc_NtkDarDemiterDual
(
Abc_Ntk_t
*
pNtk
,
int
fVerbose
)
{
char
*
pFileNameGeneric
,
pFileName0
[
1000
],
pFileName1
[
1000
];
...
...
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