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
feb3e794
Commit
feb3e794
authored
Oct 26, 2019
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding limit on the depth of recursion when counting exact area in 'amap'.
parent
35c2b421
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
67 additions
and
6 deletions
+67
-6
src/base/cmd/cmdApi.c
+5
-5
src/map/amap/amapInt.h
+1
-0
src/map/amap/amapMan.c
+2
-0
src/map/amap/amapMatch.c
+59
-1
No files found.
src/base/cmd/cmdApi.c
View file @
feb3e794
...
...
@@ -99,11 +99,11 @@ void Cmd_CommandAdd( Abc_Frame_t * pAbc, const char * sGroup, const char * sName
int
Cmd_CommandHandleSpecial
(
Abc_Frame_t
*
pAbc
,
const
char
*
sCommand
)
{
Abc_Ntk_t
*
pNtk
=
Abc_FrameReadNtk
(
pAbc
);
int
piCountNew
=
pNtk
?
Abc_NtkCiNum
(
pNtk
)
:
0
,
piCount
=
0
;
int
poCountNew
=
pNtk
?
Abc_NtkCoNum
(
pNtk
)
:
0
,
poCount
=
0
;
int
ndCountNew
=
pNtk
?
Abc_NtkNodeNum
(
pNtk
)
:
0
,
ndCount
=
0
;
double
AreaNew
=
pNtk
?
Abc_NtkGetMappedArea
(
pNtk
)
:
0
,
Area
=
0
;
int
DepthNew
=
pNtk
?
Abc_NtkLevel
(
pNtk
)
:
0
,
Depth
=
0
;
int
piCountNew
=
(
pNtk
&&
Abc_NtkHasMapping
(
pNtk
))
?
Abc_NtkCiNum
(
pNtk
)
:
0
,
piCount
=
0
;
int
poCountNew
=
(
pNtk
&&
Abc_NtkHasMapping
(
pNtk
))
?
Abc_NtkCoNum
(
pNtk
)
:
0
,
poCount
=
0
;
int
ndCountNew
=
(
pNtk
&&
Abc_NtkHasMapping
(
pNtk
))
?
Abc_NtkNodeNum
(
pNtk
)
:
0
,
ndCount
=
0
;
double
AreaNew
=
(
pNtk
&&
Abc_NtkHasMapping
(
pNtk
))
?
Abc_NtkGetMappedArea
(
pNtk
)
:
0
,
Area
=
0
;
int
DepthNew
=
(
pNtk
&&
Abc_NtkHasMapping
(
pNtk
))
?
Abc_NtkLevel
(
pNtk
)
:
0
,
Depth
=
0
;
if
(
strstr
(
sCommand
,
"#PS"
)
)
{
printf
(
"pi=%d "
,
piCountNew
);
...
...
src/map/amap/amapInt.h
View file @
feb3e794
...
...
@@ -103,6 +103,7 @@ struct Amap_Man_t_
Vec_Ptr_t
*
vCuts0
;
Vec_Ptr_t
*
vCuts1
;
Vec_Ptr_t
*
vCuts2
;
Vec_Ptr_t
*
vTempP
;
// statistics
int
nCutsUsed
;
int
nCutsTried
;
...
...
src/map/amap/amapMan.c
View file @
feb3e794
...
...
@@ -57,6 +57,7 @@ Amap_Man_t * Amap_ManStart( int nNodes )
p
->
vCuts0
=
Vec_PtrAlloc
(
100
);
p
->
vCuts1
=
Vec_PtrAlloc
(
100
);
p
->
vCuts2
=
Vec_PtrAlloc
(
100
);
p
->
vTempP
=
Vec_PtrAlloc
(
100
);
// prepare the memory manager
p
->
pMemObj
=
Aig_MmFixedStart
(
sizeof
(
Amap_Obj_t
),
nNodes
);
p
->
pMemCuts
=
Aig_MmFlexStart
();
...
...
@@ -84,6 +85,7 @@ void Amap_ManStop( Amap_Man_t * p )
Vec_PtrFree
(
p
->
vCuts0
);
Vec_PtrFree
(
p
->
vCuts1
);
Vec_PtrFree
(
p
->
vCuts2
);
Vec_PtrFree
(
p
->
vTempP
);
Vec_IntFree
(
p
->
vTemp
);
Aig_MmFixedStop
(
p
->
pMemObj
,
0
);
Aig_MmFlexStop
(
p
->
pMemCuts
,
0
);
...
...
src/map/amap/amapMatch.c
View file @
feb3e794
...
...
@@ -299,6 +299,63 @@ static inline float Amap_CutAreaDeref( Amap_Man_t * p, Amap_Mat_t * pM )
SeeAlso []
***********************************************************************/
static
inline
float
Amap_CutAreaRef2
(
Amap_Man_t
*
p
,
Amap_Mat_t
*
pM
,
Vec_Ptr_t
*
vTemp
,
int
Limit
)
{
Amap_Obj_t
*
pFanin
;
int
i
,
fCompl
;
float
Area
=
Amap_LibGate
(
p
->
pLib
,
pM
->
pSet
->
iGate
)
->
dArea
;
if
(
Limit
==
0
)
return
Area
;
Amap_MatchForEachFaninCompl
(
p
,
pM
,
pFanin
,
fCompl
,
i
)
{
Vec_PtrPush
(
vTemp
,
pFanin
->
nFouts
+
fCompl
);
assert
(
Amap_ObjRefsTotal
(
pFanin
)
>=
0
);
if
(
(
int
)
pFanin
->
fPolar
!=
fCompl
&&
pFanin
->
nFouts
[
fCompl
]
==
0
)
Area
+=
p
->
fAreaInv
;
if
(
pFanin
->
nFouts
[
fCompl
]
++
+
pFanin
->
nFouts
[
!
fCompl
]
==
0
&&
Amap_ObjIsNode
(
pFanin
)
)
Area
+=
Amap_CutAreaRef2
(
p
,
&
pFanin
->
Best
,
vTemp
,
Limit
-
1
);
}
return
Area
;
}
/**Function*************************************************************
Synopsis [Derives area of the match for a non-referenced node.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
static
inline
float
Amap_CutAreaDerefed2
(
Amap_Man_t
*
p
,
Amap_Obj_t
*
pNode
,
Amap_Mat_t
*
pM
)
{
int
nRecurLevels
=
8
;
int
fComplNew
,
i
,
*
pInt
;
float
aResult
;
Vec_PtrClear
(
p
->
vTempP
);
aResult
=
Amap_CutAreaRef2
(
p
,
pM
,
p
->
vTempP
,
nRecurLevels
);
//Amap_CutAreaDeref( p, pM );
Vec_PtrForEachEntry
(
int
*
,
p
->
vTempP
,
pInt
,
i
)
(
*
pInt
)
--
;
// if node is needed in another polarity, add inverter
fComplNew
=
pM
->
pCut
->
fInv
^
pM
->
pSet
->
fInv
;
if
(
pNode
->
nFouts
[
fComplNew
]
==
0
&&
pNode
->
nFouts
[
!
fComplNew
]
>
0
)
aResult
+=
p
->
fAreaInv
;
return
aResult
;
}
/**Function*************************************************************
Synopsis [Counts area while referencing the match.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
static
inline
float
Amap_CutAreaRef
(
Amap_Man_t
*
p
,
Amap_Mat_t
*
pM
)
{
Amap_Obj_t
*
pFanin
;
...
...
@@ -444,7 +501,8 @@ static inline void Amap_ManMatchGetExacts( Amap_Man_t * p, Amap_Obj_t * pNode, A
}
pM
->
AveFan
/=
pGate
->
nPins
;
pM
->
Delay
+=
1
.
0
;
pM
->
Area
=
Amap_CutAreaDerefed
(
p
,
pNode
,
pM
);
//pM->Area = Amap_CutAreaDerefed( p, pNode, pM );
pM
->
Area
=
Amap_CutAreaDerefed2
(
p
,
pNode
,
pM
);
}
/**Function*************************************************************
...
...
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