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
27c44fd6
Commit
27c44fd6
authored
May 20, 2016
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Switch &miter -y to convert a two-word miter into a dual-output miter.
parent
555ed0b1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
23 deletions
+55
-23
src/aig/gia/gia.h
+1
-0
src/aig/gia/giaDup.c
+31
-0
src/base/abci/abc.c
+23
-23
No files found.
src/aig/gia/gia.h
View file @
27c44fd6
...
...
@@ -1209,6 +1209,7 @@ extern Gia_Man_t * Gia_ManMiter2( Gia_Man_t * p, char * pInit, int fVerb
extern
Gia_Man_t
*
Gia_ManTransformMiter
(
Gia_Man_t
*
p
);
extern
Gia_Man_t
*
Gia_ManTransformMiter2
(
Gia_Man_t
*
p
);
extern
Gia_Man_t
*
Gia_ManTransformToDual
(
Gia_Man_t
*
p
);
extern
Gia_Man_t
*
Gia_ManTransformTwoWord2DualOutput
(
Gia_Man_t
*
p
);
extern
Gia_Man_t
*
Gia_ManChoiceMiter
(
Vec_Ptr_t
*
vGias
);
extern
Gia_Man_t
*
Gia_ManDupWithConstraints
(
Gia_Man_t
*
p
,
Vec_Int_t
*
vPoTypes
);
extern
Gia_Man_t
*
Gia_ManDupCones
(
Gia_Man_t
*
p
,
int
*
pPos
,
int
nPos
,
int
fTrimPis
);
...
...
src/aig/gia/giaDup.c
View file @
27c44fd6
...
...
@@ -2575,6 +2575,37 @@ Gia_Man_t * Gia_ManTransformToDual( Gia_Man_t * p )
Gia_ManSetRegNum
(
pNew
,
Gia_ManRegNum
(
p
)
);
return
pNew
;
}
Gia_Man_t
*
Gia_ManTransformTwoWord2DualOutput
(
Gia_Man_t
*
p
)
{
Gia_Man_t
*
pNew
,
*
pTemp
;
Gia_Obj_t
*
pObj
,
*
pObj2
;
int
i
,
nPart
=
Gia_ManPoNum
(
p
)
/
2
;
assert
(
(
Gia_ManPoNum
(
p
)
&
1
)
==
0
);
pNew
=
Gia_ManStart
(
Gia_ManObjNum
(
p
)
);
pNew
->
pName
=
Abc_UtilStrsav
(
p
->
pName
);
pNew
->
pSpec
=
Abc_UtilStrsav
(
p
->
pSpec
);
Gia_ManConst0
(
p
)
->
Value
=
0
;
Gia_ManHashAlloc
(
pNew
);
Gia_ManForEachCi
(
p
,
pObj
,
i
)
pObj
->
Value
=
Gia_ManAppendCi
(
pNew
);
Gia_ManForEachAnd
(
p
,
pObj
,
i
)
pObj
->
Value
=
Gia_ManHashAnd
(
pNew
,
Gia_ObjFanin0Copy
(
pObj
),
Gia_ObjFanin1Copy
(
pObj
)
);
Gia_ManForEachPo
(
p
,
pObj
,
i
)
{
if
(
i
==
nPart
)
break
;
pObj2
=
Gia_ManPo
(
p
,
nPart
+
i
);
Gia_ManAppendCo
(
pNew
,
Gia_ObjFanin0Copy
(
pObj
)
);
Gia_ManAppendCo
(
pNew
,
Gia_ObjFanin0Copy
(
pObj2
)
);
}
Gia_ManForEachRi
(
p
,
pObj
,
i
)
pObj
->
Value
=
Gia_ManAppendCo
(
pNew
,
Gia_ObjFanin0Copy
(
pObj
)
);
Gia_ManHashStop
(
pNew
);
Gia_ManSetRegNum
(
pNew
,
Gia_ManRegNum
(
p
)
);
pNew
=
Gia_ManCleanup
(
pTemp
=
pNew
);
Gia_ManStop
(
pTemp
);
return
pNew
;
}
/**Function*************************************************************
...
...
src/base/abci/abc.c
View file @
27c44fd6
...
...
@@ -30536,9 +30536,10 @@ int Abc_CommandAbc9Miter( Abc_Frame_t * pAbc, int argc, char ** argv )
int
fSeq
=
0
;
int
fTrans
=
0
;
int
fTransX
=
0
;
int
fConvert
=
0
;
int
fVerbose
=
0
;
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"Idstxvh"
)
)
!=
EOF
)
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"Idstx
y
vh"
)
)
!=
EOF
)
{
switch
(
c
)
{
...
...
@@ -30565,6 +30566,9 @@ int Abc_CommandAbc9Miter( Abc_Frame_t * pAbc, int argc, char ** argv )
case
'x'
:
fTransX
^=
1
;
break
;
case
'y'
:
fConvert
^=
1
;
break
;
case
'v'
:
fVerbose
^=
1
;
break
;
...
...
@@ -30574,42 +30578,37 @@ int Abc_CommandAbc9Miter( Abc_Frame_t * pAbc, int argc, char ** argv )
goto
usage
;
}
}
if
(
fTrans
)
if
(
fTrans
||
fTransX
||
fConvert
)
{
if
(
(
Gia_ManPoNum
(
pAbc
->
pGia
)
&
1
)
==
1
)
{
Abc_Print
(
-
1
,
"Abc_CommandAbc9Miter(): The number of outputs should be even.
\n
"
);
return
0
;
}
if
(
pAbc
->
pGia
==
NULL
)
{
Abc_Print
(
-
1
,
"Abc_CommandAbc9Miter(): There is no AIG.
\n
"
);
return
1
;
}
pAux
=
Gia_ManTransformMiter
(
pAbc
->
pGia
);
Abc_FrameUpdateGia
(
pAbc
,
pAux
);
Abc_Print
(
1
,
"The miter (current AIG) is transformed by XORing POs pair-wise.
\n
"
);
return
0
;
}
if
(
fTransX
)
{
if
(
(
Gia_ManPoNum
(
pAbc
->
pGia
)
&
1
)
==
1
)
{
Abc_Print
(
-
1
,
"Abc_CommandAbc9Miter(): The number of outputs should be even.
\n
"
);
return
0
;
}
if
(
pAbc
->
pGia
==
NULL
)
if
(
fTrans
)
{
Abc_Print
(
-
1
,
"Abc_CommandAbc9Miter(): There is no AIG.
\n
"
);
return
1
;
pAux
=
Gia_ManTransformMiter
(
pAbc
->
pGia
);
Abc_Print
(
1
,
"The miter (current AIG) is transformed by XORing POs pair-wise.
\n
"
);
}
else
if
(
fTransX
)
{
pAux
=
Gia_ManTransformMiter2
(
pAbc
->
pGia
);
Abc_Print
(
1
,
"The miter (current AIG) is transformed by XORing POs of two word-level outputs.
\n
"
);
}
else
{
pAux
=
Gia_ManTransformTwoWord2DualOutput
(
pAbc
->
pGia
);
Abc_Print
(
1
,
"The miter (current AIG) is transformed from two-word to dual-output.
\n
"
);
}
pAux
=
Gia_ManTransformMiter2
(
pAbc
->
pGia
);
Abc_FrameUpdateGia
(
pAbc
,
pAux
);
Abc_Print
(
1
,
"The miter (current AIG) is transformed by XORing POs of two word-level outputs.
\n
"
);
return
0
;
}
pArgvNew
=
argv
+
globalUtilOptind
;
nArgcNew
=
argc
-
globalUtilOptind
;
if
(
nArgcNew
!=
1
)
...
...
@@ -30646,13 +30645,14 @@ int Abc_CommandAbc9Miter( Abc_Frame_t * pAbc, int argc, char ** argv )
return
0
;
usage:
Abc_Print
(
-
2
,
"usage: &miter [-I num] [-dstxvh] <file>
\n
"
);
Abc_Print
(
-
2
,
"usage: &miter [-I num] [-dstx
y
vh] <file>
\n
"
);
Abc_Print
(
-
2
,
"
\t
creates miter of two designs (current AIG vs. <file>)
\n
"
);
Abc_Print
(
-
2
,
"
\t
-I num : the number of last PIs to replicate [default = %d]
\n
"
,
nInsDup
);
Abc_Print
(
-
2
,
"
\t
-d : toggle creating dual-output miter [default = %s]
\n
"
,
fDualOut
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-s : toggle creating sequential miter [default = %s]
\n
"
,
fSeq
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-t : toggle XORing pair-wise POs of the miter [default = %s]
\n
"
,
fTrans
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-x : toggle XORing POs of two word-level outputs [default = %s]
\n
"
,
fTransX
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-t : toggle XORing POs of dual-output miter [default = %s]
\n
"
,
fTrans
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-x : toggle XORing POs of two-word miter [default = %s]
\n
"
,
fTransX
?
"yes"
:
"no"
);
Abc_Print
(
-
2
,
"
\t
-y : toggle convering two-word miter into dual-output miter [default = %s]
\n
"
,
fConvert
?
"yes"
:
"no"
);
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
"
);
Abc_Print
(
-
2
,
"
\t
<file> : AIGER file with the design to miter
\n
"
);
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