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
fdf0fb27
Commit
fdf0fb27
authored
Jul 02, 2019
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding command &permute.
parent
9f6e1feb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
94 additions
and
0 deletions
+94
-0
src/aig/gia/giaDup.c
+45
-0
src/base/abci/abc.c
+49
-0
No files found.
src/aig/gia/giaDup.c
View file @
fdf0fb27
...
...
@@ -936,6 +936,51 @@ Gia_Man_t * Gia_ManDupPermFlopGap( Gia_Man_t * p, Vec_Int_t * vFfMask )
SeeAlso []
***********************************************************************/
Gia_Man_t
*
Gia_ManDupPiPerm
(
Gia_Man_t
*
p
)
{
Gia_Man_t
*
pNew
,
*
pOne
;
Gia_Obj_t
*
pObj
;
int
i
;
Gia_ManRandom
(
1
);
pNew
=
Gia_ManStart
(
Gia_ManObjNum
(
p
)
);
pNew
->
pName
=
Abc_UtilStrsav
(
p
->
pName
);
pNew
->
pSpec
=
Abc_UtilStrsav
(
p
->
pSpec
);
Gia_ManHashAlloc
(
pNew
);
Gia_ManConst0
(
p
)
->
Value
=
0
;
Gia_ManForEachCi
(
p
,
pObj
,
i
)
pObj
->
Value
=
Gia_ManAppendCi
(
pNew
);
Gia_ManForEachAnd
(
p
,
pObj
,
i
)
{
int
iLit0
=
Gia_ObjFanin0Copy
(
pObj
);
int
iLit1
=
Gia_ObjFanin1Copy
(
pObj
);
int
iPlace0
=
Gia_ManRandom
(
0
)
%
Gia_ManCiNum
(
p
);
int
iPlace1
=
Gia_ManRandom
(
0
)
%
Gia_ManCiNum
(
p
);
if
(
Abc_Lit2Var
(
iLit0
)
<=
Gia_ManCiNum
(
p
)
)
iLit0
=
Abc_Var2Lit
(
iPlace0
+
1
,
Abc_LitIsCompl
(
iLit0
)
);
if
(
Abc_Lit2Var
(
iLit1
)
<=
Gia_ManCiNum
(
p
)
)
iLit1
=
Abc_Var2Lit
(
iPlace1
+
1
,
Abc_LitIsCompl
(
iLit1
)
);
pObj
->
Value
=
Gia_ManHashAnd
(
pNew
,
iLit0
,
iLit1
);
}
Gia_ManForEachCo
(
p
,
pObj
,
i
)
pObj
->
Value
=
Gia_ManAppendCo
(
pNew
,
Gia_ObjFanin0Copy
(
pObj
)
);
Gia_ManHashStop
(
pNew
);
Gia_ManSetRegNum
(
pNew
,
Gia_ManRegNum
(
p
)
);
pNew
=
Gia_ManCleanup
(
pOne
=
pNew
);
Gia_ManStop
(
pOne
);
return
pNew
;
}
/**Function*************************************************************
Synopsis [Appends second AIG without any changes.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void
Gia_ManDupAppend
(
Gia_Man_t
*
pNew
,
Gia_Man_t
*
pTwo
)
{
Gia_Obj_t
*
pObj
;
...
...
src/base/abci/abc.c
View file @
fdf0fb27
...
...
@@ -475,6 +475,7 @@ static int Abc_CommandAbc9Dch ( Abc_Frame_t * pAbc, int argc, cha
static
int
Abc_CommandAbc9Rpm
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandAbc9BackReach
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandAbc9Posplit
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandAbc9Permute
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
#ifdef ABC_USE_CUDD
static
int
Abc_CommandAbc9ReachM
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandAbc9ReachP
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
...
...
@@ -1174,6 +1175,7 @@ void Abc_Init( Abc_Frame_t * pAbc )
Cmd_CommandAdd
(
pAbc
,
"ABC9"
,
"&rpm"
,
Abc_CommandAbc9Rpm
,
0
);
Cmd_CommandAdd
(
pAbc
,
"ABC9"
,
"&back_reach"
,
Abc_CommandAbc9BackReach
,
0
);
Cmd_CommandAdd
(
pAbc
,
"ABC9"
,
"&posplit"
,
Abc_CommandAbc9Posplit
,
0
);
Cmd_CommandAdd
(
pAbc
,
"ABC9"
,
"&permute"
,
Abc_CommandAbc9Permute
,
0
);
#ifdef ABC_USE_CUDD
Cmd_CommandAdd
(
pAbc
,
"ABC9"
,
"&reachm"
,
Abc_CommandAbc9ReachM
,
0
);
Cmd_CommandAdd
(
pAbc
,
"ABC9"
,
"&reachp"
,
Abc_CommandAbc9ReachP
,
0
);
...
...
@@ -39715,6 +39717,53 @@ usage:
return
1
;
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int
Abc_CommandAbc9Permute
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
{
extern
Gia_Man_t
*
Gia_ManDupPiPerm
(
Gia_Man_t
*
p
);
Gia_Man_t
*
pTemp
;
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_CommandAbc9Posplit(): There is no AIG.
\n
"
);
return
1
;
}
pTemp
=
Gia_ManDupPiPerm
(
pAbc
->
pGia
);
Abc_FrameUpdateGia
(
pAbc
,
pTemp
);
return
0
;
usage:
Abc_Print
(
-
2
,
"usage: &permute [-vh]
\n
"
);
Abc_Print
(
-
2
,
"
\t
permutes primary inputs
\n
"
);
Abc_Print
(
-
2
,
"
\t
-v : toggle printing verbose information [default = %s]
\n
"
,
fVerbose
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-h : print the command usage
\n
"
);
return
1
;
}
#ifdef ABC_USE_CUDD
/**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