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
bd7b5511
Commit
bd7b5511
authored
Nov 02, 2012
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improvements to LMS code.
parent
a20e32f9
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
8 deletions
+44
-8
src/base/abc/abc.h
+1
-0
src/base/abci/abc.c
+20
-0
src/base/abci/abcRec3.c
+23
-8
No files found.
src/base/abc/abc.h
View file @
bd7b5511
...
...
@@ -806,6 +806,7 @@ extern ABC_DLL void Abc_NtkRecPs3(int fPrintLib);
extern
ABC_DLL
Gia_Man_t
*
Abc_NtkRecGetGia3
();
extern
ABC_DLL
int
Abc_NtkRecIsRunning3
();
extern
ABC_DLL
void
Abc_NtkRecLibMerge3
(
Gia_Man_t
*
pGia
);
extern
ABC_DLL
int
Abc_NtkRecInputNum3
();
//extern ABC_DLL void Abc_NtkRecFilter3(int nLimit);
/*=== abcReconv.c ==========================================================*/
extern
ABC_DLL
Abc_ManCut_t
*
Abc_NtkManCutStart
(
int
nNodeSizeMax
,
int
nConeSizeMax
,
int
nNodeFanStop
,
int
nConeFanStop
);
...
...
src/base/abci/abc.c
View file @
bd7b5511
...
...
@@ -876,6 +876,12 @@ void Abc_End( Abc_Frame_t * pAbc )
Gia_ManStop
(
Abc_FrameGetGlobalFrame
()
->
pGia
);
if
(
Abc_FrameGetGlobalFrame
()
->
pGia2
)
Gia_ManStop
(
Abc_FrameGetGlobalFrame
()
->
pGia2
);
if
(
Abc_NtkRecIsRunning
()
)
Abc_NtkRecStop
();
if
(
Abc_NtkRecIsRunning2
()
)
Abc_NtkRecStop2
();
if
(
Abc_NtkRecIsRunning3
()
)
Abc_NtkRecStop3
();
}
/**Function*************************************************************
...
...
@@ -14837,6 +14843,20 @@ int Abc_CommandIf( Abc_Frame_t * pAbc, int argc, char ** argv )
pPars
->
nLutSize
=
pPars
->
nGateSize
;
}
if
(
pPars
->
fUserRecLib
)
{
if
(
Abc_NtkRecIsRunning
()
+
Abc_NtkRecIsRunning2
()
+
Abc_NtkRecIsRunning3
()
!=
1
)
{
printf
(
"Exactly one LMS manager should be running.
\n
"
);
return
0
;
}
if
(
Abc_NtkRecIsRunning3
()
&&
Abc_NtkRecInputNum3
()
!=
pPars
->
nLutSize
)
{
printf
(
"The number of library inputs (%d) different from the K parameters (%d).
\n
"
,
Abc_NtkRecInputNum3
(),
pPars
->
nLutSize
);
return
0
;
}
}
/*
// modify for LUT structures
if ( pPars->pLutStruct )
...
...
src/base/abci/abcRec3.c
View file @
bd7b5511
...
...
@@ -80,7 +80,7 @@ struct Lms_Man_t_
int
nAddedFuncs
;
int
nHoleInTheWall
;
// runtime
clock_t
time
Collect
;
clock_t
time
Truth
;
clock_t
timeCanon
;
clock_t
timeBuild
;
clock_t
timeCheck
;
...
...
@@ -109,6 +109,7 @@ static Lms_Man_t * s_pMan3 = NULL;
Lms_Man_t
*
Lms_ManStart
(
Gia_Man_t
*
pGia
,
int
nVars
,
int
nCuts
,
int
fFuncOnly
,
int
fVerbose
)
{
Lms_Man_t
*
p
;
clock_t
clk
,
clk2
=
clock
();
// if GIA is given, use the number of variables from GIA
nVars
=
pGia
?
Gia_ManCiNum
(
pGia
)
:
nVars
;
assert
(
nVars
>=
6
&&
nVars
<=
16
);
...
...
@@ -141,8 +142,12 @@ Lms_Man_t * Lms_ManStart( Gia_Man_t * pGia, int nVars, int nCuts, int fFuncOnly,
p
->
nAdded
=
Gia_ManCoNum
(
p
->
pGia
);
Gia_ManForEachCo
(
p
->
pGia
,
pObj
,
i
)
{
clk
=
clock
();
pTruth
=
Gia_ObjComputeTruthTable
(
p
->
pGia
,
pObj
);
p
->
timeTruth
+=
clock
()
-
clk
;
clk
=
clock
();
Index
=
Vec_MemHashInsert
(
p
->
vTtMem
,
(
word
*
)
pTruth
);
p
->
timeInsert
+=
clock
()
-
clk
;
assert
(
Index
==
Prev
||
Index
==
Prev
+
1
);
// GIA subgraphs should be ordered
Vec_IntPush
(
p
->
vTruthIds
,
Index
);
Prev
=
Index
;
...
...
@@ -152,6 +157,7 @@ Lms_Man_t * Lms_ManStart( Gia_Man_t * pGia, int nVars, int nCuts, int fFuncOnly,
p
->
vNodes
=
Vec_PtrAlloc
(
1000
);
p
->
vLabelsP
=
Vec_PtrAlloc
(
1000
);
p
->
vLabels
=
Vec_IntAlloc
(
1000
);
p
->
timeTotal
+=
clock
()
-
clk2
;
return
p
;
}
void
Lms_ManStop
(
Lms_Man_t
*
p
)
...
...
@@ -191,12 +197,12 @@ void Lms_ManPrint( Lms_Man_t * p )
if
(
p
->
nHoleInTheWall
)
printf
(
"Cuts whose logic structure has a hole = %10d. (%6.2f %%)
\n
"
,
p
->
nHoleInTheWall
,
!
p
->
nTried
?
0
:
100
.
0
*
p
->
nHoleInTheWall
/
p
->
nTried
);
p
->
timeOther
=
p
->
timeTotal
-
p
->
time
Collect
-
p
->
timeCanon
-
p
->
timeBuild
-
p
->
timeCheck
-
p
->
timeInsert
;
ABC_PRTP
(
"Runtime:
Collect"
,
p
->
timeCollect
,
p
->
timeTotal
);
p
->
timeOther
=
p
->
timeTotal
-
p
->
time
Truth
-
p
->
timeCanon
-
p
->
timeBuild
-
p
->
timeCheck
-
p
->
timeInsert
;
ABC_PRTP
(
"Runtime:
Truth "
,
p
->
timeTruth
,
p
->
timeTotal
);
ABC_PRTP
(
"Runtime: Canon "
,
p
->
timeCanon
,
p
->
timeTotal
);
ABC_PRTP
(
"Runtime: Build "
,
p
->
timeBuild
,
p
->
timeTotal
);
ABC_PRTP
(
"Runtime: Check "
,
p
->
timeCheck
,
p
->
timeTotal
);
ABC_PRTP
(
"Runtime: Insert
"
,
p
->
timeInsert
,
p
->
timeTotal
);
ABC_PRTP
(
"Runtime: Insert
"
,
p
->
timeInsert
,
p
->
timeTotal
);
ABC_PRTP
(
"Runtime: Other "
,
p
->
timeOther
,
p
->
timeTotal
);
ABC_PRTP
(
"Runtime: TOTAL "
,
p
->
timeTotal
,
p
->
timeTotal
);
}
...
...
@@ -470,6 +476,11 @@ void Abc_NtkRecLibMerge3( Gia_Man_t * pLib )
Gia_Obj_t
*
pObjPo
,
*
pDriver
,
*
pTemp
=
NULL
;
clock_t
clk
,
clk2
=
clock
();
if
(
Gia_ManCiNum
(
pLib
)
!=
Gia_ManCiNum
(
pGia
)
)
{
printf
(
"The number of Library inputs (%d) differs from the number of Gia inputs (%d).
\n
"
,
Gia_ManCiNum
(
pLib
),
Gia_ManCiNum
(
pGia
)
);
return
;
}
assert
(
Gia_ManCiNum
(
pLib
)
==
Gia_ManCiNum
(
pGia
)
);
// create hash table if not available
...
...
@@ -486,7 +497,7 @@ void Abc_NtkRecLibMerge3( Gia_Man_t * pLib )
// compute the truth table
clk
=
clock
();
pTruth
=
Gia_ObjComputeTruthTable
(
pLib
,
Gia_ObjFanin0
(
pObjPo
)
);
p
->
time
Collect
+=
clock
()
-
clk
;
p
->
time
Truth
+=
clock
()
-
clk
;
// semi-canonicize
clk
=
clock
();
memcpy
(
p
->
pTemp1
,
pTruth
,
p
->
nWords
*
sizeof
(
word
)
);
...
...
@@ -599,7 +610,7 @@ int Abc_NtkRecAddCut3( If_Man_t * pIfMan, If_Obj_t * pRoot, If_Cut_t * pCut )
// collect internal nodes and skip redundant cuts
clk
=
clock
();
If_CutTraverse
(
pIfMan
,
pRoot
,
pCut
,
vNodes
);
p
->
time
Collect
+=
clock
()
-
clk
;
p
->
time
Truth
+=
clock
()
-
clk
;
// semi-canonicize truth table
clk
=
clock
();
...
...
@@ -1132,13 +1143,17 @@ Gia_Man_t * Abc_NtkRecGetGia3()
{
clock_t
clk
=
clock
();
printf
(
"Before normalizing: Library has %d classes and %d AIG subgraphs with %d AND nodes.
\n
"
,
Vec_MemEntryNum
(
s_pMan3
->
vTtMem
),
s_pMan3
->
nAdded
,
Gia_ManAndNum
(
s_pMan3
->
pGia
)
);
Vec_MemEntryNum
(
s_pMan3
->
vTtMem
),
Gia_ManPoNum
(
s_pMan3
->
pGia
)
,
Gia_ManAndNum
(
s_pMan3
->
pGia
)
);
Lms_GiaNormalize
(
s_pMan3
);
printf
(
"After normalizing: Library has %d classes and %d AIG subgraphs with %d AND nodes.
\n
"
,
Vec_MemEntryNum
(
s_pMan3
->
vTtMem
),
s_pMan3
->
nAdded
,
Gia_ManAndNum
(
s_pMan3
->
pGia
)
);
Vec_MemEntryNum
(
s_pMan3
->
vTtMem
),
Gia_ManPoNum
(
s_pMan3
->
pGia
)
,
Gia_ManAndNum
(
s_pMan3
->
pGia
)
);
Abc_PrintTime
(
1
,
"Normalization runtime"
,
clock
()
-
clk
);
return
s_pMan3
->
pGia
;
}
int
Abc_NtkRecInputNum3
()
{
return
Gia_ManCiNum
(
s_pMan3
->
pGia
);
}
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
...
...
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