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
997e1a2d
Commit
997e1a2d
authored
Sep 16, 2021
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Further debugging of MiniLUT APIs.
parent
ecda331a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
73 additions
and
1 deletions
+73
-1
src/aig/gia/giaMini.c
+72
-1
src/base/main/abcapis.h
+1
-0
No files found.
src/aig/gia/giaMini.c
View file @
997e1a2d
...
...
@@ -32,6 +32,8 @@ ABC_NAMESPACE_IMPL_START
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
extern
int
Kit_TruthToGia
(
Gia_Man_t
*
pMan
,
unsigned
*
pTruth
,
int
nVars
,
Vec_Int_t
*
vMemory
,
Vec_Int_t
*
vLeaves
,
int
fHash
);
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///
////////////////////////////////////////////////////////////////////////
...
...
@@ -260,6 +262,66 @@ Gia_Man_t * Gia_ManFromMiniLut( Mini_Lut_t * p, Vec_Int_t ** pvCopies )
return
pGia
;
}
/**Function*************************************************************
Synopsis [Converts MiniLUT into GIA.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
Gia_Man_t
*
Gia_ManFromMiniLut2
(
Mini_Lut_t
*
p
,
Vec_Int_t
**
pvCopies
)
{
Gia_Man_t
*
pGia
;
Vec_Int_t
*
vCopies
;
Vec_Int_t
*
vCover
=
Vec_IntAlloc
(
1000
);
Vec_Int_t
*
vLits
=
Vec_IntAlloc
(
100
);
int
i
,
k
,
Fan
,
iGiaLit
,
nNodes
;
int
LutSize
=
Abc_MaxInt
(
2
,
Mini_LutSize
(
p
)
);
// get the number of nodes
nNodes
=
Mini_LutNodeNum
(
p
);
// create ABC network
pGia
=
Gia_ManStart
(
3
*
nNodes
);
pGia
->
pName
=
Abc_UtilStrsav
(
"MiniLut"
);
// create mapping from MiniLUT objects into ABC objects
vCopies
=
Vec_IntAlloc
(
nNodes
);
Vec_IntPush
(
vCopies
,
0
);
Vec_IntPush
(
vCopies
,
1
);
// iterate through the objects
pGia
->
fGiaSimple
=
1
;
for
(
i
=
2
;
i
<
nNodes
;
i
++
)
{
if
(
Mini_LutNodeIsPi
(
p
,
i
)
)
iGiaLit
=
Gia_ManAppendCi
(
pGia
);
else
if
(
Mini_LutNodeIsPo
(
p
,
i
)
)
iGiaLit
=
Gia_ManAppendCo
(
pGia
,
Vec_IntEntry
(
vCopies
,
Mini_LutNodeFanin
(
p
,
i
,
0
)));
else
if
(
Mini_LutNodeIsNode
(
p
,
i
)
)
{
unsigned
*
puTruth
=
Mini_LutNodeTruth
(
p
,
i
);
Vec_IntClear
(
vLits
);
Mini_LutForEachFanin
(
p
,
i
,
Fan
,
k
)
Vec_IntPush
(
vLits
,
Vec_IntEntry
(
vCopies
,
Fan
)
);
iGiaLit
=
Kit_TruthToGia
(
pGia
,
puTruth
,
Vec_IntSize
(
vLits
),
vCover
,
vLits
,
0
);
}
else
assert
(
0
);
Vec_IntPush
(
vCopies
,
iGiaLit
);
}
Vec_IntFree
(
vCover
);
Vec_IntFree
(
vLits
);
assert
(
Vec_IntSize
(
vCopies
)
==
nNodes
);
if
(
pvCopies
)
*
pvCopies
=
vCopies
;
else
Vec_IntFree
(
vCopies
);
Gia_ManSetRegNum
(
pGia
,
Mini_LutRegNum
(
p
)
);
return
pGia
;
}
/**Function*************************************************************
Synopsis [Marks LUTs that should be complemented.]
...
...
@@ -412,6 +474,15 @@ void Abc_FrameGiaInputMiniLut( Abc_Frame_t * pAbc, void * p )
Abc_FrameUpdateGia
(
pAbc
,
pGia
);
// Gia_ManDelete( pGia );
}
void
Abc_FrameGiaInputMiniLut2
(
Abc_Frame_t
*
pAbc
,
void
*
p
)
{
if
(
pAbc
==
NULL
)
printf
(
"ABC framework is not initialized by calling Abc_Start()
\n
"
);
Vec_IntFreeP
(
&
pAbc
->
vCopyMiniLut
);
Gia_ManStopP
(
&
pAbc
->
pGiaMiniLut
);
pAbc
->
pGiaMiniLut
=
Gia_ManFromMiniLut2
(
(
Mini_Lut_t
*
)
p
,
&
pAbc
->
vCopyMiniLut
);
// Abc_FrameUpdateGia( pAbc, pGia );
}
void
*
Abc_FrameGiaOutputMiniLut
(
Abc_Frame_t
*
pAbc
)
{
Mini_Lut_t
*
pRes
=
NULL
;
...
...
@@ -602,7 +673,7 @@ int * Abc_FrameReadMiniLutSwitching( Abc_Frame_t * pAbc )
pRes
=
ABC_CALLOC
(
int
,
Vec_IntSize
(
pAbc
->
vCopyMiniLut
)
);
Vec_IntForEachEntry
(
pAbc
->
vCopyMiniLut
,
iObj
,
i
)
if
(
iObj
>=
0
)
pRes
[
i
]
=
Vec_IntEntry
(
vSwitching
,
Abc_Lit2Var
(
iObj
)
);
pRes
[
i
]
=
(
int
)(
10000
*
Vec_FltEntry
(
(
Vec_Flt_t
*
)
vSwitching
,
Abc_Lit2Var
(
iObj
)
)
);
Vec_IntFree
(
vSwitching
);
return
pRes
;
}
...
...
src/base/main/abcapis.h
View file @
997e1a2d
...
...
@@ -78,6 +78,7 @@ extern ABC_DLL void Abc_NtkSetFlopNum( Abc_Frame_t * pAbc, int nFlops );
// procedures to input/output 'mini LUT'
extern
ABC_DLL
void
Abc_FrameGiaInputMiniLut
(
Abc_Frame_t
*
pAbc
,
void
*
pMiniLut
);
extern
ABC_DLL
void
Abc_FrameGiaInputMiniLut2
(
Abc_Frame_t
*
pAbc
,
void
*
pMiniLut
);
extern
ABC_DLL
void
*
Abc_FrameGiaOutputMiniLut
(
Abc_Frame_t
*
pAbc
);
extern
ABC_DLL
char
*
Abc_FrameGiaOutputMiniLutAttr
(
Abc_Frame_t
*
pAbc
,
void
*
pMiniLut
);
extern
ABC_DLL
int
*
Abc_FrameReadMiniLutSwitching
(
Abc_Frame_t
*
pAbc
);
...
...
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