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
632c7a7d
Commit
632c7a7d
authored
Jan 19, 2020
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Experiments with MUX restructuring.
parent
f1a3cffe
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
89 additions
and
0 deletions
+89
-0
src/aig/gia/giaUtil.c
+40
-0
src/base/abci/abc.c
+49
-0
No files found.
src/aig/gia/giaUtil.c
View file @
632c7a7d
...
...
@@ -2382,6 +2382,46 @@ void Gia_ManDumpFiles( Gia_Man_t * p, int nCexesT, int nCexesV )
}
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
Gia_Man_t
*
Gia_ManDupWithMuxPos
(
Gia_Man_t
*
p
)
{
Vec_Int_t
*
vPoints
=
Vec_IntAlloc
(
1000
);
Gia_Obj_t
*
pObj
,
*
pCtrl
,
*
pData0
,
*
pData1
;
Gia_Man_t
*
pNew
=
Gia_ManDup
(
p
);
int
i
,
iObj
;
assert
(
Gia_ManRegNum
(
pNew
)
==
0
);
Gia_ManForEachCo
(
pNew
,
pObj
,
i
)
Gia_ObjFanin0
(
pObj
)
->
fMark0
=
1
;
Gia_ManForEachAnd
(
pNew
,
pObj
,
i
)
{
if
(
!
Gia_ObjIsMuxType
(
pObj
)
)
continue
;
pCtrl
=
Gia_ObjRecognizeMux
(
pObj
,
&
pData1
,
&
pData0
);
pCtrl
=
Gia_Regular
(
pCtrl
);
pData1
=
Gia_Regular
(
pData1
);
pData0
=
Gia_Regular
(
pData0
);
if
(
Gia_ObjIsAnd
(
pObj
)
&&
!
pObj
->
fMark0
)
Vec_IntPush
(
vPoints
,
Gia_ObjId
(
pNew
,
pObj
)
);
if
(
Gia_ObjIsAnd
(
pCtrl
)
&&
!
pCtrl
->
fMark0
)
Vec_IntPush
(
vPoints
,
Gia_ObjId
(
pNew
,
pCtrl
)
);
if
(
Gia_ObjIsAnd
(
pData1
)
&&
!
pData1
->
fMark0
)
Vec_IntPush
(
vPoints
,
Gia_ObjId
(
pNew
,
pData1
)
);
if
(
Gia_ObjIsAnd
(
pData0
)
&&
!
pData0
->
fMark0
)
Vec_IntPush
(
vPoints
,
Gia_ObjId
(
pNew
,
pData0
)
);
}
Gia_ManCleanMark0
(
pNew
);
Vec_IntUniqify
(
vPoints
);
Vec_IntForEachEntry
(
vPoints
,
iObj
,
i
)
Gia_ManAppendCo
(
pNew
,
Abc_Var2Lit
(
iObj
,
0
)
);
Vec_IntFree
(
vPoints
);
return
pNew
;
}
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////
...
...
src/base/abci/abc.c
View file @
632c7a7d
...
...
@@ -396,6 +396,7 @@ static int Abc_CommandAbc9PFan ( Abc_Frame_t * pAbc, int argc, cha
static
int
Abc_CommandAbc9PSig
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandAbc9Status
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandAbc9MuxProfile
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandAbc9MuxPos
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandAbc9PrintTruth
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandAbc9Unate
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandAbc9Rex2Gia
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
...
...
@@ -1104,6 +1105,7 @@ void Abc_Init( Abc_Frame_t * pAbc )
Cmd_CommandAdd
(
pAbc
,
"ABC9"
,
"&psig"
,
Abc_CommandAbc9PSig
,
0
);
Cmd_CommandAdd
(
pAbc
,
"ABC9"
,
"&status"
,
Abc_CommandAbc9Status
,
0
);
Cmd_CommandAdd
(
pAbc
,
"ABC9"
,
"&profile"
,
Abc_CommandAbc9MuxProfile
,
0
);
Cmd_CommandAdd
(
pAbc
,
"ABC9"
,
"&muxpos"
,
Abc_CommandAbc9MuxPos
,
0
);
Cmd_CommandAdd
(
pAbc
,
"ABC9"
,
"&print_truth"
,
Abc_CommandAbc9PrintTruth
,
0
);
Cmd_CommandAdd
(
pAbc
,
"ABC9"
,
"&unate"
,
Abc_CommandAbc9Unate
,
0
);
Cmd_CommandAdd
(
pAbc
,
"ABC9"
,
"&rex2gia"
,
Abc_CommandAbc9Rex2Gia
,
0
);
...
...
@@ -31269,6 +31271,53 @@ usage:
SeeAlso []
***********************************************************************/
int
Abc_CommandAbc9MuxPos
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
{
extern
Gia_Man_t
*
Gia_ManDupWithMuxPos
(
Gia_Man_t
*
p
);
Gia_Man_t
*
pGia
;
int
c
,
fVerbose
=
0
;
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"vh"
)
)
!=
EOF
)
{
switch
(
c
)
{
case
'v'
:
fVerbose
^=
1
;
break
;
case
'h'
:
goto
usage
;
default:
goto
usage
;
}
}
if
(
pAbc
->
pGia
==
NULL
)
{
Abc_Print
(
-
1
,
"Abc_CommandAbc9MuxPos(): There is no AIG.
\n
"
);
return
1
;
}
pGia
=
Gia_ManDupWithMuxPos
(
pAbc
->
pGia
);
Abc_FrameUpdateGia
(
pAbc
,
pGia
);
return
0
;
usage:
Abc_Print
(
-
2
,
"usage: &muxpos [-vh]
\n
"
);
Abc_Print
(
-
2
,
"
\t
create additional POs to preserve MUXes
\n
"
);
Abc_Print
(
-
2
,
"
\t
-v : toggle verbose output [default = %s]
\n
"
,
fVerbose
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-h : print the command usage
\n
"
);
return
1
;
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int
Abc_CommandAbc9PrintTruth
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
{
extern
word
Gia_LutComputeTruth6Simple
(
Gia_Man_t
*
p
,
int
iPo
);
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