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
0d09071f
Commit
0d09071f
authored
Jul 11, 2015
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding new Python API 'is_func_iso2'.
parent
b949436f
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
37 additions
and
13 deletions
+37
-13
src/base/abc/abc.h
+1
-1
src/base/abc/abcDfs.c
+16
-6
src/base/pla/plaFxch.c
+2
-2
src/base/pla/plaHash.c
+1
-1
src/base/pla/plaSimple.c
+2
-2
src/python/pyabc.i
+15
-1
No files found.
src/base/abc/abc.h
View file @
0d09071f
...
...
@@ -626,7 +626,7 @@ extern ABC_DLL Vec_Ptr_t * Abc_NtkDfsWithBoxes( Abc_Ntk_t * pNtk );
extern
ABC_DLL
Vec_Ptr_t
*
Abc_NtkSupport
(
Abc_Ntk_t
*
pNtk
);
extern
ABC_DLL
Vec_Ptr_t
*
Abc_NtkNodeSupport
(
Abc_Ntk_t
*
pNtk
,
Abc_Obj_t
**
ppNodes
,
int
nNodes
);
extern
ABC_DLL
Vec_Int_t
*
Abc_NtkNodeSupportInt
(
Abc_Ntk_t
*
pNtk
,
int
iCo
);
extern
ABC_DLL
int
Abc_NtkFunctionalIso
(
Abc_Ntk_t
*
pNtk
,
int
iCo1
,
int
iCo2
);
extern
ABC_DLL
int
Abc_NtkFunctionalIso
(
Abc_Ntk_t
*
pNtk
,
int
iCo1
,
int
iCo2
,
int
fCommon
);
extern
ABC_DLL
Vec_Ptr_t
*
Abc_AigDfs
(
Abc_Ntk_t
*
pNtk
,
int
fCollectAll
,
int
fCollectCos
);
extern
ABC_DLL
Vec_Ptr_t
*
Abc_AigDfsMap
(
Abc_Ntk_t
*
pNtk
);
extern
ABC_DLL
Vec_Vec_t
*
Abc_DfsLevelized
(
Abc_Obj_t
*
pNode
,
int
fTfi
);
...
...
src/base/abc/abcDfs.c
View file @
0d09071f
...
...
@@ -980,7 +980,7 @@ int Abc_NtkFunctionalIsoGia_rec( Gia_Man_t * pNew, Abc_Obj_t * pNode )
iLit1
=
Abc_LitNotCond
(
iLit1
,
Abc_ObjFaninC1
(
pNode
)
);
return
(
pNode
->
iTemp
=
Gia_ManHashAnd
(
pNew
,
iLit0
,
iLit1
));
}
Gia_Man_t
*
Abc_NtkFunctionalIsoGia
(
Abc_Ntk_t
*
pNtk
,
int
iCo1
,
int
iCo2
)
Gia_Man_t
*
Abc_NtkFunctionalIsoGia
(
Abc_Ntk_t
*
pNtk
,
int
iCo1
,
int
iCo2
,
int
fCommon
)
{
Gia_Man_t
*
pNew
=
NULL
,
*
pTemp
;
Vec_Int_t
*
vSupp1
=
Abc_NtkNodeSupportInt
(
pNtk
,
iCo1
);
...
...
@@ -993,6 +993,16 @@ Gia_Man_t * Abc_NtkFunctionalIsoGia( Abc_Ntk_t * pNtk, int iCo1, int iCo2 )
pNew
->
pName
=
Abc_UtilStrsav
(
pNtk
->
pName
);
pNew
->
pSpec
=
Abc_UtilStrsav
(
pNtk
->
pSpec
);
Gia_ManHashStart
(
pNew
);
// put commom together
if
(
fCommon
)
{
Vec_Int_t
*
vCommon
=
Vec_IntAlloc
(
Vec_IntSize
(
vSupp1
)
);
Vec_IntTwoRemoveCommon
(
vSupp1
,
vSupp2
,
vCommon
);
Vec_IntAppend
(
vSupp1
,
vCommon
);
Vec_IntAppend
(
vSupp2
,
vCommon
);
Vec_IntFree
(
vCommon
);
assert
(
Vec_IntSize
(
vSupp1
)
==
Vec_IntSize
(
vSupp2
)
);
}
// primary inputs
Abc_AigConst1
(
pNtk
)
->
iTemp
=
1
;
Vec_IntForEachEntry
(
vSupp1
,
iCi
,
i
)
...
...
@@ -1020,7 +1030,7 @@ Gia_Man_t * Abc_NtkFunctionalIsoGia( Abc_Ntk_t * pNtk, int iCo1, int iCo2 )
Vec_IntFree
(
vSupp2
);
return
pNew
;
}
int
Abc_NtkFunctionalIsoInt
(
Abc_Ntk_t
*
pNtk
,
int
iCo1
,
int
iCo2
)
int
Abc_NtkFunctionalIsoInt
(
Abc_Ntk_t
*
pNtk
,
int
iCo1
,
int
iCo2
,
int
fCommon
)
{
Gia_Man_t
*
pGia
;
int
Value
;
assert
(
Abc_NtkIsStrash
(
pNtk
)
);
...
...
@@ -1028,20 +1038,20 @@ int Abc_NtkFunctionalIsoInt( Abc_Ntk_t * pNtk, int iCo1, int iCo2 )
return
0
;
if
(
iCo2
<
0
||
iCo2
>=
Abc_NtkCoNum
(
pNtk
)
)
return
0
;
pGia
=
Abc_NtkFunctionalIsoGia
(
pNtk
,
iCo1
,
iCo2
);
pGia
=
Abc_NtkFunctionalIsoGia
(
pNtk
,
iCo1
,
iCo2
,
fCommon
);
if
(
pGia
==
NULL
)
return
0
;
Value
=
Cec_ManVerifySimple
(
pGia
);
Gia_ManStop
(
pGia
);
return
(
int
)(
Value
==
1
);
}
int
Abc_NtkFunctionalIso
(
Abc_Ntk_t
*
pNtk
,
int
iCo1
,
int
iCo2
)
int
Abc_NtkFunctionalIso
(
Abc_Ntk_t
*
pNtk
,
int
iCo1
,
int
iCo2
,
int
fCommon
)
{
Abc_Ntk_t
*
pNtkNew
;
int
Result
;
if
(
Abc_NtkIsStrash
(
pNtk
)
)
return
Abc_NtkFunctionalIsoInt
(
pNtk
,
iCo1
,
iCo2
);
return
Abc_NtkFunctionalIsoInt
(
pNtk
,
iCo1
,
iCo2
,
fCommon
);
pNtkNew
=
Abc_NtkStrash
(
pNtk
,
0
,
0
,
0
);
Result
=
Abc_NtkFunctionalIsoInt
(
pNtkNew
,
iCo1
,
iCo2
);
Result
=
Abc_NtkFunctionalIsoInt
(
pNtkNew
,
iCo1
,
iCo2
,
fCommon
);
Abc_NtkDelete
(
pNtkNew
);
return
Result
;
}
...
...
src/base/pla/plaFxch.c
View file @
0d09071f
...
...
@@ -99,7 +99,7 @@ void Fxch_ManWriteBlif( char * pFileName, Vec_Wec_t * vCubes, Vec_Wrd_t * vDivs
printf
(
"Cannot open file
\"
%s
\"
for writing.
\n
"
,
pFileName
);
else
{
char
*
pLits
=
"-01?"
;
//
char * pLits = "-01?";
Vec_Str_t
*
vStr
;
Vec_Int_t
*
vCube
;
int
i
,
k
,
Lit
;
...
...
@@ -617,7 +617,7 @@ void Fxch_ManCreateDivisors( Fxch_Man_t * p )
void
Fxch_ManUpdate
(
Fxch_Man_t
*
p
,
int
iDiv
)
{
Vec_Int_t
*
vCube1
,
*
vCube2
,
*
vLitP
,
*
vLitN
;
int
nLitsNew
=
p
->
nLits
-
(
int
)
Vec_FltEntry
(
&
p
->
vWeights
,
iDiv
);
//
int nLitsNew = p->nLits - (int)Vec_FltEntry(&p->vWeights, iDiv);
int
i
,
Lit0
,
Lit1
,
hCube1
,
hCube2
,
iVarNew
;
//float Diff = Vec_FltEntry(&p->vWeights, iDiv) - (float)((int)Vec_FltEntry(&p->vWeights, iDiv));
//assert( Diff > 0.0 && Diff < 1.0 );
...
...
src/base/pla/plaHash.c
View file @
0d09071f
...
...
@@ -272,7 +272,7 @@ Vec_Int_t * Pla_ManComputeDistance1Int( Pla_Man_t * p )
Vec_Int_t
*
vCounts
=
Vec_IntStart
(
Vec_WecSize
(
&
p
->
vCubeLits
)
);
Vec_Int_t
*
vEntries
=
Vec_IntAlloc
(
p
->
nIns
);
int
nBits
=
Abc_Base2Log
(
Vec_WecSizeSize
(
&
p
->
vCubeLits
)
)
+
2
;
int
v
,
i
,
k
,
Count
=
0
;
int
v
,
i
,
k
;
//
, Count = 0;
int
iCube1
,
iCube2
,
iVar1
,
iVar2
;
assert
(
nBits
<=
26
);
pTab
=
Tab_ManAlloc
(
nBits
,
p
);
...
...
src/base/pla/plaSimple.c
View file @
0d09071f
...
...
@@ -50,7 +50,7 @@ void Pla_ManDumpPla( Pla_Man_t * p, char * pFileName )
printf
(
"Cannot open file
\"
%s
\"
for writing.
\n
"
,
pFileName
);
else
{
char
*
pLits
=
"-01?"
;
//
char * pLits = "-01?";
Vec_Str_t
*
vStr
;
Vec_Int_t
*
vCube
;
int
i
,
k
,
Lit
;
...
...
@@ -89,7 +89,7 @@ void Pla_ManDumpBlif( Pla_Man_t * p, char * pFileName )
printf
(
"Cannot open file
\"
%s
\"
for writing.
\n
"
,
pFileName
);
else
{
char
*
pLits
=
"-01?"
;
//
char * pLits = "-01?";
Vec_Str_t
*
vStr
;
Vec_Int_t
*
vCube
;
int
i
,
k
,
Lit
,
Div
;
...
...
src/python/pyabc.i
View file @
0d09071f
...
...
@@ -394,7 +394,20 @@ int is_func_iso( int iCo1, int iCo2 )
return 0;
}
return Abc_NtkFunctionalIso( pNtk, iCo1, iCo2 );
return Abc_NtkFunctionalIso( pNtk, iCo1, iCo2, 0 );
}
int is_func_iso2( int iCo1, int iCo2 )
{
Abc_Frame_t* pAbc = Abc_FrameGetGlobalFrame();
Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
if ( !pNtk )
{
return 0;
}
return Abc_NtkFunctionalIso( pNtk, iCo1, iCo2, 1 );
}
void _pyabc_array_clear()
...
...
@@ -755,6 +768,7 @@ int _cex_get_frame(Abc_Cex_t* pCex);
PyObject* eq_classes();
PyObject* co_supp(int iCo);
int is_func_iso(int iCo1, int iCo2);
int is_func_iso2(int iCo1, int iCo2);
void _pyabc_array_clear();
void _pyabc_array_push(int i);
...
...
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