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
86fcba60
Commit
86fcba60
authored
Dec 01, 2012
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enabling command &append for combiming multiple AIGs.
parent
01bea8ef
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
116 additions
and
3 deletions
+116
-3
src/aig/gia/gia.h
+1
-0
src/aig/gia/giaDup.c
+32
-0
src/base/abci/abc.c
+80
-0
src/map/if/ifMap.c
+1
-1
src/opt/dau/dauTree.c
+2
-2
No files found.
src/aig/gia/gia.h
View file @
86fcba60
...
@@ -760,6 +760,7 @@ extern Gia_Man_t * Gia_ManDupOutputGroup( Gia_Man_t * p, int iOutStart,
...
@@ -760,6 +760,7 @@ extern Gia_Man_t * Gia_ManDupOutputGroup( Gia_Man_t * p, int iOutStart,
extern
Gia_Man_t
*
Gia_ManDupOrderAiger
(
Gia_Man_t
*
p
);
extern
Gia_Man_t
*
Gia_ManDupOrderAiger
(
Gia_Man_t
*
p
);
extern
Gia_Man_t
*
Gia_ManDupFlip
(
Gia_Man_t
*
p
,
int
*
pInitState
);
extern
Gia_Man_t
*
Gia_ManDupFlip
(
Gia_Man_t
*
p
,
int
*
pInitState
);
extern
Gia_Man_t
*
Gia_ManDup
(
Gia_Man_t
*
p
);
extern
Gia_Man_t
*
Gia_ManDup
(
Gia_Man_t
*
p
);
extern
void
Gia_ManDupAppend
(
Gia_Man_t
*
p
,
Gia_Man_t
*
pTwo
);
extern
Gia_Man_t
*
Gia_ManDupSelf
(
Gia_Man_t
*
p
);
extern
Gia_Man_t
*
Gia_ManDupSelf
(
Gia_Man_t
*
p
);
extern
Gia_Man_t
*
Gia_ManDupFlopClass
(
Gia_Man_t
*
p
,
int
iClass
);
extern
Gia_Man_t
*
Gia_ManDupFlopClass
(
Gia_Man_t
*
p
,
int
iClass
);
extern
Gia_Man_t
*
Gia_ManDupMarked
(
Gia_Man_t
*
p
);
extern
Gia_Man_t
*
Gia_ManDupMarked
(
Gia_Man_t
*
p
);
...
...
src/aig/gia/giaDup.c
View file @
86fcba60
...
@@ -430,6 +430,38 @@ Gia_Man_t * Gia_ManDup( Gia_Man_t * p )
...
@@ -430,6 +430,38 @@ Gia_Man_t * Gia_ManDup( Gia_Man_t * p )
/**Function*************************************************************
/**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
;
int
i
;
if
(
pNew
->
nRegs
>
0
)
pNew
->
nRegs
=
0
;
if
(
pNew
->
pHTable
==
NULL
)
Gia_ManHashAlloc
(
pNew
);
Gia_ManConst0
(
pTwo
)
->
Value
=
0
;
Gia_ManForEachObj1
(
pTwo
,
pObj
,
i
)
{
if
(
Gia_ObjIsAnd
(
pObj
)
)
pObj
->
Value
=
Gia_ManAppendAnd
(
pNew
,
Gia_ObjFanin0Copy
(
pObj
),
Gia_ObjFanin1Copy
(
pObj
)
);
else
if
(
Gia_ObjIsCi
(
pObj
)
)
pObj
->
Value
=
Gia_ManAppendCi
(
pNew
);
else
if
(
Gia_ObjIsCo
(
pObj
)
)
pObj
->
Value
=
Gia_ManAppendCo
(
pNew
,
Gia_ObjFanin0Copy
(
pObj
)
);
}
return
pNew
;
}
/**Function*************************************************************
Synopsis [Duplicates while adding self-loops to the registers.]
Synopsis [Duplicates while adding self-loops to the registers.]
Description []
Description []
...
...
src/base/abci/abc.c
View file @
86fcba60
...
@@ -338,6 +338,7 @@ static int Abc_CommandAbc9Dc2 ( Abc_Frame_t * pAbc, int argc, cha
...
@@ -338,6 +338,7 @@ static int Abc_CommandAbc9Dc2 ( Abc_Frame_t * pAbc, int argc, cha
static
int
Abc_CommandAbc9Bidec
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandAbc9Bidec
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandAbc9Shrink
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandAbc9Shrink
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandAbc9Miter
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandAbc9Miter
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandAbc9Append
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandAbc9Scl
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandAbc9Scl
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandAbc9Lcorr
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandAbc9Lcorr
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandAbc9Scorr
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandAbc9Scorr
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
...
@@ -797,6 +798,7 @@ void Abc_Init( Abc_Frame_t * pAbc )
...
@@ -797,6 +798,7 @@ void Abc_Init( Abc_Frame_t * pAbc )
Cmd_CommandAdd
(
pAbc
,
"ABC9"
,
"&bidec"
,
Abc_CommandAbc9Bidec
,
0
);
Cmd_CommandAdd
(
pAbc
,
"ABC9"
,
"&bidec"
,
Abc_CommandAbc9Bidec
,
0
);
Cmd_CommandAdd
(
pAbc
,
"ABC9"
,
"&shrink"
,
Abc_CommandAbc9Shrink
,
0
);
Cmd_CommandAdd
(
pAbc
,
"ABC9"
,
"&shrink"
,
Abc_CommandAbc9Shrink
,
0
);
Cmd_CommandAdd
(
pAbc
,
"ABC9"
,
"&miter"
,
Abc_CommandAbc9Miter
,
0
);
Cmd_CommandAdd
(
pAbc
,
"ABC9"
,
"&miter"
,
Abc_CommandAbc9Miter
,
0
);
Cmd_CommandAdd
(
pAbc
,
"ABC9"
,
"&append"
,
Abc_CommandAbc9Append
,
0
);
Cmd_CommandAdd
(
pAbc
,
"ABC9"
,
"&scl"
,
Abc_CommandAbc9Scl
,
0
);
Cmd_CommandAdd
(
pAbc
,
"ABC9"
,
"&scl"
,
Abc_CommandAbc9Scl
,
0
);
Cmd_CommandAdd
(
pAbc
,
"ABC9"
,
"&lcorr"
,
Abc_CommandAbc9Lcorr
,
0
);
Cmd_CommandAdd
(
pAbc
,
"ABC9"
,
"&lcorr"
,
Abc_CommandAbc9Lcorr
,
0
);
Cmd_CommandAdd
(
pAbc
,
"ABC9"
,
"&scorr"
,
Abc_CommandAbc9Scorr
,
0
);
Cmd_CommandAdd
(
pAbc
,
"ABC9"
,
"&scorr"
,
Abc_CommandAbc9Scorr
,
0
);
...
@@ -25896,6 +25898,84 @@ usage:
...
@@ -25896,6 +25898,84 @@ usage:
SeeAlso []
SeeAlso []
***********************************************************************/
***********************************************************************/
int
Abc_CommandAbc9Append
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
{
FILE
*
pFile
;
Gia_Man_t
*
pSecond
;
char
*
FileName
,
*
pTemp
;
char
**
pArgvNew
;
int
nArgcNew
;
int
c
;
int
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
;
}
}
pArgvNew
=
argv
+
globalUtilOptind
;
nArgcNew
=
argc
-
globalUtilOptind
;
if
(
nArgcNew
!=
1
)
{
Abc_Print
(
-
1
,
"File name is not given on the command line.
\n
"
);
return
1
;
}
// get the input file name
FileName
=
pArgvNew
[
0
];
// fix the wrong symbol
for
(
pTemp
=
FileName
;
*
pTemp
;
pTemp
++
)
if
(
*
pTemp
==
'>'
)
*
pTemp
=
'\\'
;
if
(
(
pFile
=
fopen
(
FileName
,
"r"
))
==
NULL
)
{
Abc_Print
(
-
1
,
"Cannot open input file
\"
%s
\"
. "
,
FileName
);
if
(
(
FileName
=
Extra_FileGetSimilarName
(
FileName
,
".aig"
,
NULL
,
NULL
,
NULL
,
NULL
))
)
Abc_Print
(
1
,
"Did you mean
\"
%s
\"
?"
,
FileName
);
Abc_Print
(
1
,
"
\n
"
);
return
1
;
}
fclose
(
pFile
);
pSecond
=
Gia_ReadAiger
(
FileName
,
0
,
0
);
if
(
pSecond
==
NULL
)
{
Abc_Print
(
-
1
,
"Reading AIGER has failed.
\n
"
);
return
0
;
}
// compute the miter
Gia_ManDupAppend
(
pAbc
->
pGia
,
pSecond
);
Gia_ManStop
(
pSecond
);
return
0
;
usage:
Abc_Print
(
-
2
,
"usage: &append [-vh] <file>
\n
"
);
Abc_Print
(
-
2
,
"
\t
appends <file> to the current AIG using new PIs and POs
\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
"
);
Abc_Print
(
-
2
,
"
\t
<file> : AIGER file with the design to miter
\n
"
);
return
1
;
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int
Abc_CommandAbc9Scl
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
int
Abc_CommandAbc9Scl
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
{
{
Gia_Man_t
*
pTemp
;
Gia_Man_t
*
pTemp
;
...
...
src/map/if/ifMap.c
View file @
86fcba60
...
@@ -297,7 +297,7 @@ void If_ObjPerformMappingAnd( If_Man_t * p, If_Obj_t * pObj, int Mode, int fPrep
...
@@ -297,7 +297,7 @@ void If_ObjPerformMappingAnd( If_Man_t * p, If_Obj_t * pObj, int Mode, int fPrep
ABC_SWAP
(
int
*
,
pFans
[
0
],
pFans
[
1
]
);
ABC_SWAP
(
int
*
,
pFans
[
0
],
pFans
[
1
]
);
}
}
// derive new DSD
// derive new DSD
pCut
->
iDsd
=
Dss_ManMerge
(
p
->
pDsdMan
,
iDsd
,
nFans
,
pFans
,
p
->
uSharedMask
,
pCut
->
nLimit
,
pCut
->
pPerm
,
If_CutTruthW
(
pCut
)
);
pCut
->
iDsd
=
Dss_ManMerge
(
p
->
pDsdMan
,
iDsd
,
nFans
,
pFans
,
p
->
uSharedMask
,
pCut
->
nLimit
,
(
unsigned
char
*
)
pCut
->
pPerm
,
If_CutTruthW
(
pCut
)
);
}
}
if
(
pCut
->
iDsd
<
0
)
if
(
pCut
->
iDsd
<
0
)
{
{
...
...
src/opt/dau/dauTree.c
View file @
86fcba60
...
@@ -1353,7 +1353,7 @@ int Dss_ManMerge( Dss_Man_t * p, int * iDsd, int * nFans, int ** pFans, unsigned
...
@@ -1353,7 +1353,7 @@ int Dss_ManMerge( Dss_Man_t * p, int * iDsd, int * nFans, int ** pFans, unsigned
if
(
Counter
==
122053
)
if
(
Counter
==
122053
)
{
{
int
s
=
0
;
//
int s = 0;
// fVerbose = 1;
// fVerbose = 1;
}
}
...
@@ -1430,7 +1430,7 @@ printf( "\n" );
...
@@ -1430,7 +1430,7 @@ printf( "\n" );
if
(
Counter
==
134
)
if
(
Counter
==
134
)
{
{
int
s
=
0
;
//
int s = 0;
// Dss_ManPrint( p );
// Dss_ManPrint( p );
}
}
pTruthOne
=
Dss_ManComputeTruth
(
p
,
pFun
->
iDsd
,
p
->
nVars
,
pPermResInt
);
pTruthOne
=
Dss_ManComputeTruth
(
p
,
pFun
->
iDsd
,
p
->
nVars
,
pPermResInt
);
...
...
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