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
Hide 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,
{
// short pStore2[32];
unsigned
*
pIn
=
pInOut
,
*
pOut
=
pAux
,
*
pTemp
;
//
int nWords = Kit_TruthWordNum( nVars );
int
i
,
Temp
,
fChange
,
Counter
;
//
, nOnes;//, k, j, w, Limit;
int
nWords
=
Kit_TruthWordNum
(
nVars
);
int
i
,
Temp
,
fChange
,
Counter
,
nOnes
;
//, k, j, w, Limit;
unsigned
uCanonPhase
;
// canonicize output
uCanonPhase
=
0
;
/*
nOnes
=
Kit_TruthCountOnes
(
pIn
,
nVars
);
if
(
(
nOnes
>
nWords
*
16
)
)
//|| ((nOnes == nWords * 16) && (pIn[0] & 1)) )
{
uCanonPhase
|=
(
1
<<
nVars
);
Kit_TruthNot
(
pIn
,
pIn
,
nVars
);
}
*/
// collect the minterm counts
Kit_TruthCountOnesInCofs
(
pIn
,
nVars
,
pStore
);
/*
...
...
@@ -1698,7 +1698,6 @@ unsigned Kit_TruthSemiCanonicize( unsigned * pInOut, unsigned * pAux, int nVars,
// permute
Counter
=
0
;
do
{
fChange
=
0
;
for
(
i
=
0
;
i
<
nVars
-
1
;
i
++
)
...
...
@@ -1721,11 +1720,11 @@ unsigned Kit_TruthSemiCanonicize( unsigned * pInOut, unsigned * pAux, int nVars,
pStore
[
2
*
(
i
+
1
)
+
1
]
=
Temp
;
// if the polarity of variables is different, swap them
//
if ( ((uCanonPhase & (1 << i)) > 0) != ((uCanonPhase & (1 << (i+1))) > 0) )
//
{
//
uCanonPhase ^= (1 << i);
//
uCanonPhase ^= (1 << (i+1));
//
}
if
(
((
uCanonPhase
&
(
1
<<
i
))
>
0
)
!=
((
uCanonPhase
&
(
1
<<
(
i
+
1
)))
>
0
)
)
{
uCanonPhase
^=
(
1
<<
i
);
uCanonPhase
^=
(
1
<<
(
i
+
1
));
}
Kit_TruthSwapAdjacentVars
(
pOut
,
pIn
,
nVars
,
i
);
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
//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_CommandRecStart ( 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_CommandRecPs ( Abc_Frame_t * pAbc, int argc, char ** argv );
//
static int Abc_CommandRecUse ( 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_CommandRecAdd
(
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_CommandMap
(
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 )
// Cmd_CommandAdd( pAbc, "Choicing", "haig_stop", Abc_CommandHaigStop, 0 );
// Cmd_CommandAdd( pAbc, "Choicing", "haig_use", Abc_CommandHaigUse, 1 );
//
Cmd_CommandAdd( pAbc, "Choicing", "rec_start", Abc_CommandRecStart, 0 );
//
Cmd_CommandAdd( pAbc, "Choicing", "rec_stop", Abc_CommandRecStop, 0 );
//
Cmd_CommandAdd( pAbc, "Choicing", "rec_add", Abc_CommandRecAdd, 0 );
//
Cmd_CommandAdd( pAbc, "Choicing", "rec_ps", Abc_CommandRecPs, 0 );
//
Cmd_CommandAdd( pAbc, "Choicing", "rec_use", Abc_CommandRecUse, 1 );
Cmd_CommandAdd
(
pAbc
,
"Choicing"
,
"rec_start"
,
Abc_CommandRecStart
,
0
);
Cmd_CommandAdd
(
pAbc
,
"Choicing"
,
"rec_stop"
,
Abc_CommandRecStop
,
0
);
Cmd_CommandAdd
(
pAbc
,
"Choicing"
,
"rec_add"
,
Abc_CommandRecAdd
,
0
);
Cmd_CommandAdd
(
pAbc
,
"Choicing"
,
"rec_ps"
,
Abc_CommandRecPs
,
0
);
Cmd_CommandAdd
(
pAbc
,
"Choicing"
,
"rec_use"
,
Abc_CommandRecUse
,
1
);
Cmd_CommandAdd
(
pAbc
,
"SC mapping"
,
"map"
,
Abc_CommandMap
,
1
);
Cmd_CommandAdd
(
pAbc
,
"SC mapping"
,
"amap"
,
Abc_CommandAmap
,
1
);
...
...
@@ -11887,6 +11887,7 @@ usage:
return 1;
}
#endif
/**Function*************************************************************
...
...
@@ -11909,7 +11910,7 @@ int Abc_CommandRecStart( Abc_Frame_t * pAbc, int argc, char ** argv )
pNtk
=
Abc_FrameReadNtk
(
pAbc
);
// set defaults
nVars =
4
;
nVars
=
6
;
nCuts
=
8
;
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"KCh"
)
)
!=
EOF
)
...
...
@@ -12155,8 +12156,6 @@ usage:
return
1
;
}
#endif
/**Function*************************************************************
Synopsis []
...
...
src/base/abci/abcRec.c
View file @
360c705f
...
...
@@ -237,7 +237,7 @@ p->timeTruth += clock() - clk;
// add the resulting truth table to the hash table
ppSpot
=
Abc_NtkRecTableLookup
(
p
,
pTruth
,
p
->
nVars
);
assert
(
pObj
->
p
Equiv
==
NULL
);
assert
(
pObj
->
p
Data
==
NULL
);
assert
(
pObj
->
pCopy
==
NULL
);
if
(
*
ppSpot
==
NULL
)
{
...
...
@@ -246,8 +246,8 @@ p->timeTruth += clock() - clk;
}
else
{
pObj
->
p
Equiv
=
(
*
ppSpot
)
->
pEquiv
;
(
*
ppSpot
)
->
p
Equiv
=
(
Hop_Obj_t
*
)
pObj
;
pObj
->
p
Data
=
(
*
ppSpot
)
->
pData
;
(
*
ppSpot
)
->
p
Data
=
(
Hop_Obj_t
*
)
pObj
;
if
(
!
Abc_NtkRecAddCutCheckCycle_rec
(
*
ppSpot
,
pObj
)
)
printf
(
"Loop!
\n
"
);
}
...
...
@@ -362,7 +362,7 @@ void Abc_NtkRecPs()
{
Counters
[
Abc_ObjGetMax
(
pEntry
)
]
++
;
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
)
);
CountersS
[
Abc_ObjGetMax
(
pTemp
)
]
++
;
...
...
@@ -935,7 +935,7 @@ s_pMan->timeCanon += clock() - clk;
// add the resulting truth table to the hash table
ppSpot
=
Abc_NtkRecTableLookup
(
s_pMan
,
pTruth
,
nInputs
);
assert
(
pObj
->
p
Equiv
==
NULL
);
assert
(
pObj
->
p
Data
==
NULL
);
assert
(
pObj
->
pCopy
==
NULL
);
if
(
*
ppSpot
==
NULL
)
{
...
...
@@ -944,8 +944,8 @@ s_pMan->timeCanon += clock() - clk;
}
else
{
pObj
->
p
Equiv
=
(
*
ppSpot
)
->
pEquiv
;
(
*
ppSpot
)
->
p
Equiv
=
(
Hop_Obj_t
*
)
pObj
;
pObj
->
p
Data
=
(
*
ppSpot
)
->
pData
;
(
*
ppSpot
)
->
p
Data
=
pObj
;
if
(
!
Abc_NtkRecAddCutCheckCycle_rec
(
*
ppSpot
,
pObj
)
)
printf
(
"Loop!
\n
"
);
}
...
...
@@ -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
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
);
...
...
@@ -1120,7 +1120,7 @@ int Abc_NtkRecStrashNode( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pObj, unsigned * pTru
// find the best subgraph
CostMin
=
ABC_INFINITY
;
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
Abc_NtkIncrementTravId
(
pAig
);
...
...
src/base/abci/module.make
View file @
360c705f
...
...
@@ -42,6 +42,7 @@ SRC += src/base/abci/abc.c \
src/base/abci/abcProve.c
\
src/base/abci/abcQbf.c
\
src/base/abci/abcQuant.c
\
src/base/abci/abcRec.c
\
src/base/abci/abcReconv.c
\
src/base/abci/abcReach.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