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
b581e16f
Commit
b581e16f
authored
Mar 20, 2014
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Experiments with cut caching.
parent
d44d9e29
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
134 additions
and
1 deletions
+134
-1
abclib.dsp
+4
-0
src/map/if/if.h
+1
-0
src/map/if/ifCache.c
+121
-0
src/map/if/ifDsd.c
+1
-1
src/map/if/ifMan.c
+4
-0
src/map/if/ifMap.c
+2
-0
src/map/if/module.make
+1
-0
No files found.
abclib.dsp
View file @
b581e16f
...
...
@@ -2303,6 +2303,10 @@ SOURCE=.\src\map\if\if.h
# End Source File
# Begin Source File
SOURCE=.\src\map\if\ifCache.c
# End Source File
# Begin Source File
SOURCE=.\src\map\if\ifCom.c
# End Source File
# Begin Source File
...
...
src/map/if/if.h
View file @
b581e16f
...
...
@@ -237,6 +237,7 @@ struct If_Man_t_
Vec_Str_t
*
vTtPerms
;
// mapping of truth table into permutations
int
nBestCutSmall
[
2
];
int
nCountNonDec
[
2
];
Vec_Int_t
*
vCutData
;
// cut data storage
// timing manager
Tim_Man_t
*
pManTim
;
...
...
src/map/if/ifCache.c
0 → 100644
View file @
b581e16f
/**CFile****************************************************************
FileName [ifCache.c]
SystemName [ABC: Logic synthesis and verification system.]
PackageName [FPGA mapping based on priority cuts.]
Synopsis []
Author [Alan Mishchenko]
Affiliation [UC Berkeley]
Date [Ver. 1.0. Started - November 21, 2006.]
Revision [$Id: ifCache.c,v 1.00 2006/11/21 00:00:00 alanmi Exp $]
***********************************************************************/
#include "if.h"
#include "misc/vec/vecHsh.h"
ABC_NAMESPACE_IMPL_START
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///
////////////////////////////////////////////////////////////////////////
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void
If_ManCacheRecord
(
If_Man_t
*
p
,
int
iDsd0
,
int
iDsd1
,
int
nShared
,
int
iDsd
)
{
if
(
p
->
vCutData
==
NULL
)
p
->
vCutData
=
Vec_IntAlloc
(
10000
);
if
(
iDsd0
>
iDsd1
)
ABC_SWAP
(
int
,
iDsd0
,
iDsd1
);
Vec_IntPush
(
p
->
vCutData
,
iDsd0
);
Vec_IntPush
(
p
->
vCutData
,
iDsd1
);
Vec_IntPush
(
p
->
vCutData
,
nShared
);
Vec_IntPush
(
p
->
vCutData
,
iDsd
);
// printf( "%6d %6d %6d %6d\n", iDsd0, iDsd1, nShared, iDsd );
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
static
inline
int
Vec_IntCountUnique
(
Vec_Int_t
*
p
)
{
int
i
,
Count
=
0
,
Max
=
Vec_IntFindMax
(
p
);
unsigned
char
*
pPres
=
ABC_CALLOC
(
unsigned
char
,
Max
+
1
);
for
(
i
=
0
;
i
<
p
->
nSize
;
i
++
)
if
(
pPres
[
p
->
pArray
[
i
]]
==
0
)
pPres
[
p
->
pArray
[
i
]]
=
1
,
Count
++
;
ABC_FREE
(
pPres
);
return
Count
;
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void
If_ManCacheAnalize
(
If_Man_t
*
p
)
{
Vec_Int_t
*
vRes
,
*
vTest
[
32
];
int
i
,
Entry
,
uUnique
;
vRes
=
Hsh_IntManHashArray
(
p
->
vCutData
,
4
);
for
(
i
=
0
;
i
<=
p
->
pPars
->
nLutSize
;
i
++
)
vTest
[
i
]
=
Vec_IntAlloc
(
1000
);
Vec_IntForEachEntry
(
vRes
,
Entry
,
i
)
Vec_IntPush
(
vTest
[
Vec_IntEntry
(
p
->
vCutData
,
4
*
i
+
2
)],
Entry
);
for
(
i
=
0
;
i
<=
p
->
pPars
->
nLutSize
;
i
++
)
{
uUnique
=
Vec_IntCountUnique
(
vTest
[
i
]);
printf
(
"%2d-var entries = %8d. (%6.2f %%) Unique entries = %8d. (%6.2f %%)
\n
"
,
i
,
Vec_IntSize
(
vTest
[
i
]),
100
.
0
*
Vec_IntSize
(
vTest
[
i
])
/
Vec_IntSize
(
vRes
),
uUnique
,
100
.
0
*
uUnique
/
Vec_IntSize
(
vTest
[
i
])
);
}
for
(
i
=
0
;
i
<=
p
->
pPars
->
nLutSize
;
i
++
)
Vec_IntFree
(
vTest
[
i
]
);
uUnique
=
Vec_IntCountUnique
(
vRes
);
printf
(
"Total entries = %8d. (%6.2f %%) Unique entries = %8d. (%6.2f %%)
\n
"
,
Vec_IntSize
(
p
->
vCutData
)
/
4
,
100
.
0
,
uUnique
,
100
.
0
*
uUnique
/
(
Vec_IntSize
(
p
->
vCutData
)
/
4
)
);
Vec_IntFree
(
vRes
);
}
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////
ABC_NAMESPACE_IMPL_END
src/map/if/ifDsd.c
View file @
b581e16f
...
...
@@ -781,7 +781,7 @@ abctime clk;
if
(
*
pSpot
)
return
(
int
)
*
pSpot
;
clk
=
Abc_Clock
();
if
(
truthId
>=
0
&&
truthId
==
Vec_PtrSize
(
p
->
vTtDecs
)
)
if
(
p
->
LutSize
&&
truthId
>=
0
&&
truthId
==
Vec_PtrSize
(
p
->
vTtDecs
)
)
{
Vec_Int_t
*
vSets
=
Dau_DecFindSets_int
(
pTruth
,
nLits
,
p
->
pSched
);
// printf( "%d ", Vec_IntSize(vSets) );
...
...
src/map/if/ifMan.c
View file @
b581e16f
...
...
@@ -141,6 +141,9 @@ void If_ManRestart( If_Man_t * p )
***********************************************************************/
void
If_ManStop
(
If_Man_t
*
p
)
{
extern
void
If_ManCacheAnalize
(
If_Man_t
*
p
);
if
(
p
->
pPars
->
fVerbose
&&
p
->
vCutData
)
If_ManCacheAnalize
(
p
);
/*
if ( p->pIfDsdMan )
{
...
...
@@ -190,6 +193,7 @@ void If_ManStop( If_Man_t * p )
Vec_IntFreeP
(
&
p
->
vLags
);
Vec_IntFreeP
(
&
p
->
vTtDsds
);
Vec_StrFreeP
(
&
p
->
vTtPerms
);
Vec_IntFreeP
(
&
p
->
vCutData
);
Vec_MemHashFree
(
p
->
vTtMem
);
Vec_MemFreeP
(
&
p
->
vTtMem
);
Mem_FixedStop
(
p
->
pMemObj
,
0
);
...
...
src/map/if/ifMap.c
View file @
b581e16f
...
...
@@ -219,6 +219,7 @@ void If_ObjPerformMappingAnd( If_Man_t * p, If_Obj_t * pObj, int Mode, int fPrep
// p->timeTruth += Abc_Clock() - clk;
if
(
p
->
pPars
->
fUseDsd
)
{
extern
void
If_ManCacheRecord
(
If_Man_t
*
p
,
int
iDsd0
,
int
iDsd1
,
int
nShared
,
int
iDsd
);
int
truthId
=
Abc_Lit2Var
(
pCut
->
iCutFunc
);
if
(
Vec_IntSize
(
p
->
vTtDsds
)
<=
truthId
||
Vec_IntEntry
(
p
->
vTtDsds
,
truthId
)
==
-
1
)
{
...
...
@@ -239,6 +240,7 @@ void If_ObjPerformMappingAnd( If_Man_t * p, If_Obj_t * pObj, int Mode, int fPrep
for
(
v
=
0
;
v
<
(
int
)
pCut
->
nLeaves
;
v
++
)
pCut
->
pPerm
[
v
]
=
(
unsigned
char
)
Vec_StrEntry
(
p
->
vTtPerms
,
truthId
*
p
->
pPars
->
nLutSize
+
v
);
}
If_ManCacheRecord
(
p
,
pCut0
->
iCutDsd
,
pCut1
->
iCutDsd
,
p
->
nShared
,
pCut
->
iCutDsd
);
}
// run user functions
pCut
->
fUseless
=
0
;
...
...
src/map/if/module.make
View file @
b581e16f
SRC
+=
src/map/if/ifCom.c
\
src/map/if/ifCache.c
\
src/map/if/ifCore.c
\
src/map/if/ifCut.c
\
src/map/if/ifDec07.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