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
360c705f
Commit
360c705f
authored
Dec 06, 2011
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added recording of AIG subgraphs.
parent
b4a46eb6
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
32 deletions
+31
-32
src/aig/kit/kitTruth.c
+9
-10
src/base/abci/abc.c
+12
-13
src/base/abci/abcRec.c
+9
-9
src/base/abci/module.make
+1
-0
No files found.
src/aig/kit/kitTruth.c
View file @
360c705f
...
@@ -1658,20 +1658,20 @@ unsigned Kit_TruthSemiCanonicize( unsigned * pInOut, unsigned * pAux, int nVars,
...
@@ -1658,20 +1658,20 @@ unsigned Kit_TruthSemiCanonicize( unsigned * pInOut, unsigned * pAux, int nVars,
{
{
// short pStore2[32];
// short pStore2[32];
unsigned
*
pIn
=
pInOut
,
*
pOut
=
pAux
,
*
pTemp
;
unsigned
*
pIn
=
pInOut
,
*
pOut
=
pAux
,
*
pTemp
;
//
int nWords = Kit_TruthWordNum( nVars );
int
nWords
=
Kit_TruthWordNum
(
nVars
);
int
i
,
Temp
,
fChange
,
Counter
;
//
, nOnes;//, k, j, w, Limit;
int
i
,
Temp
,
fChange
,
Counter
,
nOnes
;
//, k, j, w, Limit;
unsigned
uCanonPhase
;
unsigned
uCanonPhase
;
// canonicize output
// canonicize output
uCanonPhase
=
0
;
uCanonPhase
=
0
;
/*
nOnes
=
Kit_TruthCountOnes
(
pIn
,
nVars
);
nOnes
=
Kit_TruthCountOnes
(
pIn
,
nVars
);
if
(
(
nOnes
>
nWords
*
16
)
)
//|| ((nOnes == nWords * 16) && (pIn[0] & 1)) )
if
(
(
nOnes
>
nWords
*
16
)
)
//|| ((nOnes == nWords * 16) && (pIn[0] & 1)) )
{
{
uCanonPhase
|=
(
1
<<
nVars
);
uCanonPhase
|=
(
1
<<
nVars
);
Kit_TruthNot
(
pIn
,
pIn
,
nVars
);
Kit_TruthNot
(
pIn
,
pIn
,
nVars
);
}
}
*/
// collect the minterm counts
// collect the minterm counts
Kit_TruthCountOnesInCofs
(
pIn
,
nVars
,
pStore
);
Kit_TruthCountOnesInCofs
(
pIn
,
nVars
,
pStore
);
/*
/*
...
@@ -1698,7 +1698,6 @@ unsigned Kit_TruthSemiCanonicize( unsigned * pInOut, unsigned * pAux, int nVars,
...
@@ -1698,7 +1698,6 @@ unsigned Kit_TruthSemiCanonicize( unsigned * pInOut, unsigned * pAux, int nVars,
// permute
// permute
Counter
=
0
;
Counter
=
0
;
do
{
do
{
fChange
=
0
;
fChange
=
0
;
for
(
i
=
0
;
i
<
nVars
-
1
;
i
++
)
for
(
i
=
0
;
i
<
nVars
-
1
;
i
++
)
...
@@ -1721,11 +1720,11 @@ unsigned Kit_TruthSemiCanonicize( unsigned * pInOut, unsigned * pAux, int nVars,
...
@@ -1721,11 +1720,11 @@ unsigned Kit_TruthSemiCanonicize( unsigned * pInOut, unsigned * pAux, int nVars,
pStore
[
2
*
(
i
+
1
)
+
1
]
=
Temp
;
pStore
[
2
*
(
i
+
1
)
+
1
]
=
Temp
;
// if the polarity of variables is different, swap them
// if the polarity of variables is different, swap them
//
if ( ((uCanonPhase & (1 << i)) > 0) != ((uCanonPhase & (1 << (i+1))) > 0) )
if
(
((
uCanonPhase
&
(
1
<<
i
))
>
0
)
!=
((
uCanonPhase
&
(
1
<<
(
i
+
1
)))
>
0
)
)
//
{
{
//
uCanonPhase ^= (1 << i);
uCanonPhase
^=
(
1
<<
i
);
//
uCanonPhase ^= (1 << (i+1));
uCanonPhase
^=
(
1
<<
(
i
+
1
));
//
}
}
Kit_TruthSwapAdjacentVars
(
pOut
,
pIn
,
nVars
,
i
);
Kit_TruthSwapAdjacentVars
(
pOut
,
pIn
,
nVars
,
i
);
pTemp
=
pIn
;
pIn
=
pOut
;
pOut
=
pTemp
;
pTemp
=
pIn
;
pIn
=
pOut
;
pOut
=
pTemp
;
...
...
src/base/abci/abc.c
View file @
360c705f
...
@@ -206,11 +206,11 @@ static int Abc_CommandFraigDress ( Abc_Frame_t * pAbc, int argc, cha
...
@@ -206,11 +206,11 @@ static int Abc_CommandFraigDress ( Abc_Frame_t * pAbc, int argc, cha
//static int Abc_CommandHaigStop ( Abc_Frame_t * pAbc, int argc, char ** argv );
//static int Abc_CommandHaigStop ( Abc_Frame_t * pAbc, int argc, char ** argv );
//static int Abc_CommandHaigUse ( Abc_Frame_t * pAbc, int argc, char ** argv );
//static int Abc_CommandHaigUse ( Abc_Frame_t * pAbc, int argc, char ** argv );
//
static int Abc_CommandRecStart ( Abc_Frame_t * pAbc, int argc, char ** argv );
static
int
Abc_CommandRecStart
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
//
static int Abc_CommandRecStop ( Abc_Frame_t * pAbc, int argc, char ** argv );
static
int
Abc_CommandRecStop
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
//
static int Abc_CommandRecAdd ( Abc_Frame_t * pAbc, int argc, char ** argv );
static
int
Abc_CommandRecAdd
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
//
static int Abc_CommandRecPs ( Abc_Frame_t * pAbc, int argc, char ** argv );
static
int
Abc_CommandRecPs
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
//
static int Abc_CommandRecUse ( Abc_Frame_t * pAbc, int argc, char ** argv );
static
int
Abc_CommandRecUse
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandMap
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandMap
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandAmap
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
static
int
Abc_CommandAmap
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
);
...
@@ -662,11 +662,11 @@ void Abc_Init( Abc_Frame_t * pAbc )
...
@@ -662,11 +662,11 @@ void Abc_Init( Abc_Frame_t * pAbc )
// Cmd_CommandAdd( pAbc, "Choicing", "haig_stop", Abc_CommandHaigStop, 0 );
// Cmd_CommandAdd( pAbc, "Choicing", "haig_stop", Abc_CommandHaigStop, 0 );
// Cmd_CommandAdd( pAbc, "Choicing", "haig_use", Abc_CommandHaigUse, 1 );
// Cmd_CommandAdd( pAbc, "Choicing", "haig_use", Abc_CommandHaigUse, 1 );
//
Cmd_CommandAdd( pAbc, "Choicing", "rec_start", Abc_CommandRecStart, 0 );
Cmd_CommandAdd
(
pAbc
,
"Choicing"
,
"rec_start"
,
Abc_CommandRecStart
,
0
);
//
Cmd_CommandAdd( pAbc, "Choicing", "rec_stop", Abc_CommandRecStop, 0 );
Cmd_CommandAdd
(
pAbc
,
"Choicing"
,
"rec_stop"
,
Abc_CommandRecStop
,
0
);
//
Cmd_CommandAdd( pAbc, "Choicing", "rec_add", Abc_CommandRecAdd, 0 );
Cmd_CommandAdd
(
pAbc
,
"Choicing"
,
"rec_add"
,
Abc_CommandRecAdd
,
0
);
//
Cmd_CommandAdd( pAbc, "Choicing", "rec_ps", Abc_CommandRecPs, 0 );
Cmd_CommandAdd
(
pAbc
,
"Choicing"
,
"rec_ps"
,
Abc_CommandRecPs
,
0
);
//
Cmd_CommandAdd( pAbc, "Choicing", "rec_use", Abc_CommandRecUse, 1 );
Cmd_CommandAdd
(
pAbc
,
"Choicing"
,
"rec_use"
,
Abc_CommandRecUse
,
1
);
Cmd_CommandAdd
(
pAbc
,
"SC mapping"
,
"map"
,
Abc_CommandMap
,
1
);
Cmd_CommandAdd
(
pAbc
,
"SC mapping"
,
"map"
,
Abc_CommandMap
,
1
);
Cmd_CommandAdd
(
pAbc
,
"SC mapping"
,
"amap"
,
Abc_CommandAmap
,
1
);
Cmd_CommandAdd
(
pAbc
,
"SC mapping"
,
"amap"
,
Abc_CommandAmap
,
1
);
...
@@ -11887,6 +11887,7 @@ usage:
...
@@ -11887,6 +11887,7 @@ usage:
return 1;
return 1;
}
}
#endif
/**Function*************************************************************
/**Function*************************************************************
...
@@ -11909,7 +11910,7 @@ int Abc_CommandRecStart( Abc_Frame_t * pAbc, int argc, char ** argv )
...
@@ -11909,7 +11910,7 @@ int Abc_CommandRecStart( Abc_Frame_t * pAbc, int argc, char ** argv )
pNtk
=
Abc_FrameReadNtk
(
pAbc
);
pNtk
=
Abc_FrameReadNtk
(
pAbc
);
// set defaults
// set defaults
nVars =
4
;
nVars
=
6
;
nCuts
=
8
;
nCuts
=
8
;
Extra_UtilGetoptReset
();
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"KCh"
)
)
!=
EOF
)
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"KCh"
)
)
!=
EOF
)
...
@@ -12155,8 +12156,6 @@ usage:
...
@@ -12155,8 +12156,6 @@ usage:
return
1
;
return
1
;
}
}
#endif
/**Function*************************************************************
/**Function*************************************************************
Synopsis []
Synopsis []
...
...
src/base/abci/abcRec.c
View file @
360c705f
...
@@ -237,7 +237,7 @@ p->timeTruth += clock() - clk;
...
@@ -237,7 +237,7 @@ p->timeTruth += clock() - clk;
// add the resulting truth table to the hash table
// add the resulting truth table to the hash table
ppSpot
=
Abc_NtkRecTableLookup
(
p
,
pTruth
,
p
->
nVars
);
ppSpot
=
Abc_NtkRecTableLookup
(
p
,
pTruth
,
p
->
nVars
);
assert
(
pObj
->
p
Equiv
==
NULL
);
assert
(
pObj
->
p
Data
==
NULL
);
assert
(
pObj
->
pCopy
==
NULL
);
assert
(
pObj
->
pCopy
==
NULL
);
if
(
*
ppSpot
==
NULL
)
if
(
*
ppSpot
==
NULL
)
{
{
...
@@ -246,8 +246,8 @@ p->timeTruth += clock() - clk;
...
@@ -246,8 +246,8 @@ p->timeTruth += clock() - clk;
}
}
else
else
{
{
pObj
->
p
Equiv
=
(
*
ppSpot
)
->
pEquiv
;
pObj
->
p
Data
=
(
*
ppSpot
)
->
pData
;
(
*
ppSpot
)
->
p
Equiv
=
(
Hop_Obj_t
*
)
pObj
;
(
*
ppSpot
)
->
p
Data
=
(
Hop_Obj_t
*
)
pObj
;
if
(
!
Abc_NtkRecAddCutCheckCycle_rec
(
*
ppSpot
,
pObj
)
)
if
(
!
Abc_NtkRecAddCutCheckCycle_rec
(
*
ppSpot
,
pObj
)
)
printf
(
"Loop!
\n
"
);
printf
(
"Loop!
\n
"
);
}
}
...
@@ -362,7 +362,7 @@ void Abc_NtkRecPs()
...
@@ -362,7 +362,7 @@ void Abc_NtkRecPs()
{
{
Counters
[
Abc_ObjGetMax
(
pEntry
)
]
++
;
Counters
[
Abc_ObjGetMax
(
pEntry
)
]
++
;
Counter
++
;
Counter
++
;
for
(
pTemp
=
pEntry
;
pTemp
;
pTemp
=
(
Abc_Obj_t
*
)
pTemp
->
p
Equiv
)
for
(
pTemp
=
pEntry
;
pTemp
;
pTemp
=
(
Abc_Obj_t
*
)
pTemp
->
p
Data
)
{
{
assert
(
Abc_ObjGetMax
(
pTemp
)
==
Abc_ObjGetMax
(
pEntry
)
);
assert
(
Abc_ObjGetMax
(
pTemp
)
==
Abc_ObjGetMax
(
pEntry
)
);
CountersS
[
Abc_ObjGetMax
(
pTemp
)
]
++
;
CountersS
[
Abc_ObjGetMax
(
pTemp
)
]
++
;
...
@@ -935,7 +935,7 @@ s_pMan->timeCanon += clock() - clk;
...
@@ -935,7 +935,7 @@ s_pMan->timeCanon += clock() - clk;
// add the resulting truth table to the hash table
// add the resulting truth table to the hash table
ppSpot
=
Abc_NtkRecTableLookup
(
s_pMan
,
pTruth
,
nInputs
);
ppSpot
=
Abc_NtkRecTableLookup
(
s_pMan
,
pTruth
,
nInputs
);
assert
(
pObj
->
p
Equiv
==
NULL
);
assert
(
pObj
->
p
Data
==
NULL
);
assert
(
pObj
->
pCopy
==
NULL
);
assert
(
pObj
->
pCopy
==
NULL
);
if
(
*
ppSpot
==
NULL
)
if
(
*
ppSpot
==
NULL
)
{
{
...
@@ -944,8 +944,8 @@ s_pMan->timeCanon += clock() - clk;
...
@@ -944,8 +944,8 @@ s_pMan->timeCanon += clock() - clk;
}
}
else
else
{
{
pObj
->
p
Equiv
=
(
*
ppSpot
)
->
pEquiv
;
pObj
->
p
Data
=
(
*
ppSpot
)
->
pData
;
(
*
ppSpot
)
->
p
Equiv
=
(
Hop_Obj_t
*
)
pObj
;
(
*
ppSpot
)
->
p
Data
=
pObj
;
if
(
!
Abc_NtkRecAddCutCheckCycle_rec
(
*
ppSpot
,
pObj
)
)
if
(
!
Abc_NtkRecAddCutCheckCycle_rec
(
*
ppSpot
,
pObj
)
)
printf
(
"Loop!
\n
"
);
printf
(
"Loop!
\n
"
);
}
}
...
@@ -1104,7 +1104,7 @@ int Abc_NtkRecStrashNode( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pObj, unsigned * pTru
...
@@ -1104,7 +1104,7 @@ int Abc_NtkRecStrashNode( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pObj, unsigned * pTru
}
}
// go through the candidates - and recursively label them
// go through the candidates - and recursively label them
for
(
pCand
=
*
ppSpot
;
pCand
;
pCand
=
(
Abc_Obj_t
*
)
pCand
->
p
Equiv
)
for
(
pCand
=
*
ppSpot
;
pCand
;
pCand
=
(
Abc_Obj_t
*
)
pCand
->
p
Data
)
Abc_NtkRecStrashNodeLabel_rec
(
pNtkNew
,
pCand
,
0
,
s_pMan
->
vLabels
);
Abc_NtkRecStrashNodeLabel_rec
(
pNtkNew
,
pCand
,
0
,
s_pMan
->
vLabels
);
...
@@ -1120,7 +1120,7 @@ int Abc_NtkRecStrashNode( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pObj, unsigned * pTru
...
@@ -1120,7 +1120,7 @@ int Abc_NtkRecStrashNode( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pObj, unsigned * pTru
// find the best subgraph
// find the best subgraph
CostMin
=
ABC_INFINITY
;
CostMin
=
ABC_INFINITY
;
pCandMin
=
NULL
;
pCandMin
=
NULL
;
for
(
pCand
=
*
ppSpot
;
pCand
;
pCand
=
(
Abc_Obj_t
*
)
pCand
->
p
Equiv
)
for
(
pCand
=
*
ppSpot
;
pCand
;
pCand
=
(
Abc_Obj_t
*
)
pCand
->
p
Data
)
{
{
// label the leaves
// label the leaves
Abc_NtkIncrementTravId
(
pAig
);
Abc_NtkIncrementTravId
(
pAig
);
...
...
src/base/abci/module.make
View file @
360c705f
...
@@ -42,6 +42,7 @@ SRC += src/base/abci/abc.c \
...
@@ -42,6 +42,7 @@ SRC += src/base/abci/abc.c \
src/base/abci/abcProve.c
\
src/base/abci/abcProve.c
\
src/base/abci/abcQbf.c
\
src/base/abci/abcQbf.c
\
src/base/abci/abcQuant.c
\
src/base/abci/abcQuant.c
\
src/base/abci/abcRec.c
\
src/base/abci/abcReconv.c
\
src/base/abci/abcReconv.c
\
src/base/abci/abcReach.c
\
src/base/abci/abcReach.c
\
src/base/abci/abcRefactor.c
\
src/base/abci/abcRefactor.c
\
...
...
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