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
a620c09c
Commit
a620c09c
authored
Jul 22, 2023
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding functional comparison to &compare.
parent
3592078d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
65 additions
and
5 deletions
+65
-5
src/aig/gia/giaSimBase.c
+52
-0
src/base/abci/abc.c
+13
-5
No files found.
src/aig/gia/giaSimBase.c
View file @
a620c09c
...
...
@@ -3689,6 +3689,58 @@ Vec_Str_t * Gia_ManComputeRange( Gia_Man_t * p )
return
vOut
;
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void
Gia_ManComparePrint
(
Gia_Man_t
*
p
,
Gia_Man_t
*
q
)
{
Vec_Wrd_t
*
vSimsPi
=
Vec_WrdStartTruthTables
(
Gia_ManCiNum
(
p
)
);
Vec_Wrd_t
*
vSimsP
=
Gia_ManSimPatSimOut
(
p
,
vSimsPi
,
0
);
Vec_Wrd_t
*
vSimsQ
=
Gia_ManSimPatSimOut
(
q
,
vSimsPi
,
0
);
int
i
,
k
,
nWords
=
Vec_WrdSize
(
vSimsPi
)
/
Gia_ManCiNum
(
p
),
Count
=
0
;
Gia_Obj_t
*
pObjP
,
*
pObjQ
;
Gia_ManSetPhase
(
p
);
Gia_ManSetPhase
(
q
);
Gia_ManForEachObj
(
p
,
pObjP
,
i
)
{
word
*
pSim
=
Vec_WrdEntryP
(
vSimsP
,
i
*
nWords
);
if
(
pSim
[
0
]
&
1
)
Abc_TtNot
(
pSim
,
nWords
);
}
Gia_ManForEachObj
(
q
,
pObjQ
,
i
)
{
word
*
pSim
=
Vec_WrdEntryP
(
vSimsQ
,
i
*
nWords
);
if
(
pSim
[
0
]
&
1
)
Abc_TtNot
(
pSim
,
nWords
);
}
Gia_ManForEachAnd
(
q
,
pObjQ
,
i
)
{
word
*
pSimQ
=
Vec_WrdEntryP
(
vSimsQ
,
i
*
nWords
);
int
fFirst
=
1
;
Gia_ManForEachObj
(
p
,
pObjP
,
k
)
{
word
*
pSimP
=
Vec_WrdEntryP
(
vSimsP
,
k
*
nWords
);
if
(
!
Abc_TtEqual
(
pSimQ
,
pSimP
,
nWords
)
)
continue
;
if
(
fFirst
)
{
printf
(
"%5d :"
,
i
);
fFirst
=
0
;
Count
++
;
}
printf
(
" %5d(%d)"
,
k
,
pObjQ
->
fPhase
^
pObjP
->
fPhase
);
}
if
(
!
fFirst
)
printf
(
"
\n
"
);
}
printf
(
"Found %d equivalent nodes.
\n
"
,
Count
);
Vec_WrdFree
(
vSimsP
);
Vec_WrdFree
(
vSimsQ
);
Vec_WrdFree
(
vSimsPi
);
}
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////
...
...
src/base/abci/abc.c
View file @
a620c09c
...
...
@@ -45032,17 +45032,21 @@ usage:
int
Abc_CommandAbc9Compare
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
{
extern
void
Gia_Iso4TestTwo
(
Gia_Man_t
*
pGia0
,
Gia_Man_t
*
pGia1
);
extern
void
Gia_ManComparePrint
(
Gia_Man_t
*
p
,
Gia_Man_t
*
q
);
Gia_Man_t
*
pGia0
,
*
pGia1
;
char
**
pArgvNew
;
int
nArgcNew
;
int
c
,
fVerbose
=
0
;
int
c
,
f
Func
=
0
,
f
Verbose
=
0
;
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"vh"
)
)
!=
EOF
)
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"
f
vh"
)
)
!=
EOF
)
{
switch
(
c
)
{
case
'f'
:
fFunc
^=
1
;
break
;
case
'v'
:
fVerbose
^=
1
;
break
;
break
;
case
'h'
:
goto
usage
;
default:
...
...
@@ -45063,14 +45067,18 @@ int Abc_CommandAbc9Compare( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_Print
(
-
1
,
"Abc_CommandAbc9Compare(): Reading input files did not work.
\n
"
);
return
1
;
}
Gia_Iso4TestTwo
(
pGia0
,
pGia1
);
if
(
fFunc
)
Gia_ManComparePrint
(
pGia0
,
pGia1
);
else
Gia_Iso4TestTwo
(
pGia0
,
pGia1
);
Gia_ManStop
(
pGia0
);
Gia_ManStop
(
pGia1
);
return
0
;
usage:
Abc_Print
(
-
2
,
"usage: &compare <file1> <file2> [-vh]
\n
"
);
Abc_Print
(
-
2
,
"usage: &compare <file1> <file2> [-
f
vh]
\n
"
);
Abc_Print
(
-
2
,
"
\t
compared two AIGs for structural similarity
\n
"
);
Abc_Print
(
-
2
,
"
\t
-f : toggle functional comparison [default = %s]
\n
"
,
fFunc
?
"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
"
);
return
1
;
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