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
f866920e
Commit
f866920e
authored
Jul 02, 2011
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a new demitering feature for dual-output miters.
parent
6c2ac766
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
180 additions
and
5 deletions
+180
-5
src/aig/aig/aig.h
+1
-0
src/aig/aig/aigObj.c
+21
-0
src/aig/saig/saig.h
+1
-0
src/aig/saig/saigMiter.c
+57
-0
src/base/abci/abc.c
+32
-5
src/base/abci/abcDar.c
+68
-0
No files found.
src/aig/aig/aig.h
View file @
f866920e
...
...
@@ -557,6 +557,7 @@ extern void Aig_ObjConnect( Aig_Man_t * p, Aig_Obj_t * pObj, Aig_Obj_
extern
void
Aig_ObjDisconnect
(
Aig_Man_t
*
p
,
Aig_Obj_t
*
pObj
);
extern
void
Aig_ObjDelete
(
Aig_Man_t
*
p
,
Aig_Obj_t
*
pObj
);
extern
void
Aig_ObjDelete_rec
(
Aig_Man_t
*
p
,
Aig_Obj_t
*
pObj
,
int
fFreeTop
);
extern
void
Aig_ObjDeletePo
(
Aig_Man_t
*
p
,
Aig_Obj_t
*
pObj
);
extern
void
Aig_ObjPrint
(
Aig_Man_t
*
p
,
Aig_Obj_t
*
pObj
);
extern
void
Aig_ObjPatchFanin0
(
Aig_Man_t
*
p
,
Aig_Obj_t
*
pObj
,
Aig_Obj_t
*
pFaninNew
);
extern
void
Aig_ObjReplace
(
Aig_Man_t
*
p
,
Aig_Obj_t
*
pObjOld
,
Aig_Obj_t
*
pObjNew
,
int
fUpdateLevel
);
...
...
src/aig/aig/aigObj.c
View file @
f866920e
...
...
@@ -268,6 +268,27 @@ void Aig_ObjDelete_rec( Aig_Man_t * p, Aig_Obj_t * pObj, int fFreeTop )
/**Function*************************************************************
Synopsis [Deletes the node.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void
Aig_ObjDeletePo
(
Aig_Man_t
*
p
,
Aig_Obj_t
*
pObj
)
{
assert
(
Aig_ObjIsPo
(
pObj
)
);
Aig_ObjDeref
(
Aig_ObjFanin0
(
pObj
));
pObj
->
pFanin0
=
NULL
;
p
->
nObjs
[
pObj
->
Type
]
--
;
Vec_PtrWriteEntry
(
p
->
vObjs
,
pObj
->
Id
,
NULL
);
Aig_ManRecycleMemory
(
p
,
pObj
);
}
/**Function*************************************************************
Synopsis [Replaces the first fanin of the node by the new fanin.]
Description []
...
...
src/aig/saig/saig.h
View file @
f866920e
...
...
@@ -168,6 +168,7 @@ extern Aig_Man_t * Saig_ManDualRail( Aig_Man_t * p, int fMiter );
extern
Aig_Man_t
*
Saig_ManCreateMiterTwo
(
Aig_Man_t
*
pOld
,
Aig_Man_t
*
pNew
,
int
nFrames
);
extern
int
Saig_ManDemiterSimple
(
Aig_Man_t
*
p
,
Aig_Man_t
**
ppAig0
,
Aig_Man_t
**
ppAig1
);
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
);
/*=== saigOutdec.c ==========================================================*/
extern
Aig_Man_t
*
Saig_ManDecPropertyOutput
(
Aig_Man_t
*
pAig
,
int
nLits
,
int
fVerbose
);
...
...
src/aig/saig/saigMiter.c
View file @
f866920e
...
...
@@ -696,6 +696,63 @@ int Saig_ManDemiterSimpleDiff( Aig_Man_t * p, Aig_Man_t ** ppAig0, Aig_Man_t **
/**Function*************************************************************
Synopsis [Returns 1 if AIG can be demitered.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int
Saig_ManDemiterDual
(
Aig_Man_t
*
p
,
Aig_Man_t
**
ppAig0
,
Aig_Man_t
**
ppAig1
)
{
Aig_Man_t
*
pTemp
;
Aig_Obj_t
*
pObj
;
int
i
,
k
;
if
(
p
->
pFanData
)
Aig_ManFanoutStop
(
p
);
k
=
0
;
pTemp
=
Aig_ManDupSimple
(
p
);
Saig_ManForEachPo
(
pTemp
,
pObj
,
i
)
{
if
(
i
&
1
)
Aig_ObjDeletePo
(
pTemp
,
pObj
);
else
Vec_PtrWriteEntry
(
pTemp
->
vPos
,
k
++
,
pObj
);
}
Saig_ManForEachLi
(
pTemp
,
pObj
,
i
)
Vec_PtrWriteEntry
(
pTemp
->
vPos
,
k
++
,
pObj
);
Vec_PtrShrink
(
pTemp
->
vPos
,
k
);
pTemp
->
nTruePos
=
k
-
Saig_ManRegNum
(
pTemp
);
Aig_ManSeqCleanup
(
pTemp
);
*
ppAig0
=
Aig_ManDupSimple
(
pTemp
);
Aig_ManStop
(
pTemp
);
k
=
0
;
pTemp
=
Aig_ManDupSimple
(
p
);
Saig_ManForEachPo
(
pTemp
,
pObj
,
i
)
{
if
(
i
&
1
)
Vec_PtrWriteEntry
(
pTemp
->
vPos
,
k
++
,
pObj
);
else
Aig_ObjDeletePo
(
pTemp
,
pObj
);
}
Saig_ManForEachLi
(
pTemp
,
pObj
,
i
)
Vec_PtrWriteEntry
(
pTemp
->
vPos
,
k
++
,
pObj
);
Vec_PtrShrink
(
pTemp
->
vPos
,
k
);
pTemp
->
nTruePos
=
k
-
Saig_ManRegNum
(
pTemp
);
Aig_ManSeqCleanup
(
pTemp
);
*
ppAig1
=
Aig_ManDupSimple
(
pTemp
);
Aig_ManStop
(
pTemp
);
return
1
;
}
/**Function*************************************************************
Synopsis [Duplicates the AIG to have constant-0 initial state.]
Description []
...
...
src/base/abci/abc.c
View file @
f866920e
...
...
@@ -5513,21 +5513,30 @@ usage:
int
Abc_CommandDemiter
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
{
Abc_Ntk_t
*
pNtk
=
Abc_FrameReadNtk
(
pAbc
);
//, * pNtkRes;
int
f
Seq
;
int
f
Dual
,
fSeq
,
fVerbose
;
int
c
;
extern
int
Abc_NtkDemiter
(
Abc_Ntk_t
*
pNtk
);
extern
int
Abc_NtkDarDemiter
(
Abc_Ntk_t
*
pNtk
);
extern
int
Abc_NtkDarDemiterDual
(
Abc_Ntk_t
*
pNtk
,
int
fVerbose
);
// set defaults
fDual
=
0
;
fSeq
=
1
;
fVerbose
=
1
;
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"
s
h"
)
)
!=
EOF
)
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"
dsv
h"
)
)
!=
EOF
)
{
switch
(
c
)
{
case
'd'
:
fDual
^=
1
;
break
;
case
's'
:
fSeq
^=
1
;
break
;
case
'v'
:
fVerbose
^=
1
;
break
;
default:
goto
usage
;
}
...
...
@@ -5545,6 +5554,22 @@ int Abc_CommandDemiter( Abc_Frame_t * pAbc, int argc, char ** argv )
return
1
;
}
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
"
);
return
1
;
}
return
0
;
}
// get the new network
if
(
fSeq
)
{
...
...
@@ -5577,9 +5602,11 @@ int Abc_CommandDemiter( Abc_Frame_t * pAbc, int argc, char ** argv )
return
0
;
usage:
Abc_Print
(
-
2
,
"usage: demiter [-sh]
\n
"
);
Abc_Print
(
-
2
,
"
\t
removes topmost EXOR from the miter to create two POs
\n
"
);
Abc_Print
(
-
2
,
"
\t
-s : applied multi-output algorithm [default = %s]
\n
"
,
fSeq
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"usage: demiter [-dsvh]
\n
"
);
Abc_Print
(
-
2
,
"
\t
removes topmost XOR from the miter to create two POs
\n
"
);
Abc_Print
(
-
2
,
"
\t
-d : demiters a dual-output miter (without XORs) [default = %s]
\n
"
,
fSeq
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-s : applies a multi-output algorithm [default = %s]
\n
"
,
fSeq
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-v : toggles outputting verbose information [default = %s]
\n
"
,
fVerbose
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-h : print the command usage
\n
"
);
return
1
;
}
...
...
src/base/abci/abcDar.c
View file @
f866920e
...
...
@@ -2051,6 +2051,74 @@ int Abc_NtkDarDemiter( Abc_Ntk_t * pNtk )
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
];
Aig_Man_t
*
pMan
,
*
pPart0
,
*
pPart1
;
//, * pMiter;
if
(
(
Abc_NtkPoNum
(
pNtk
)
&
1
)
)
{
printf
(
"The number of POs should be even.
\n
"
);
return
0
;
}
// derive the AIG manager
pMan
=
Abc_NtkToDar
(
pNtk
,
0
,
1
);
if
(
pMan
==
NULL
)
{
printf
(
"Converting network into AIG has failed.
\n
"
);
return
0
;
}
// if ( !Saig_ManDemiterSimple( pMan, &pPart0, &pPart1 ) )
if
(
!
Saig_ManDemiterDual
(
pMan
,
&
pPart0
,
&
pPart1
)
)
{
printf
(
"Demitering has failed.
\n
"
);
return
0
;
}
// create new AIG
ABC_FREE
(
pPart0
->
pName
);
pPart0
->
pName
=
Aig_UtilStrsav
(
"part0"
);
// create new AIGs
ABC_FREE
(
pPart1
->
pName
);
pPart1
->
pName
=
Aig_UtilStrsav
(
"part1"
);
// 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
);
Ioa_WriteAiger
(
pPart0
,
pFileName0
,
0
,
0
);
Ioa_WriteAiger
(
pPart1
,
pFileName1
,
0
,
0
);
printf
(
"Demitering produced two files
\"
%s
\"
and
\"
%s
\"
.
\n
"
,
pFileName0
,
pFileName1
);
// dump files
if
(
fVerbose
)
{
// printf( "Init: " );
Aig_ManPrintStats
(
pMan
);
// printf( "Part1: " );
Aig_ManPrintStats
(
pPart0
);
// printf( "Part2: " );
Aig_ManPrintStats
(
pPart1
);
}
// 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*************************************************************
...
...
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