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
f401c17f
Commit
f401c17f
authored
Apr 17, 2017
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Logic restruturing after mapping.
parent
fb12c23a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
124 additions
and
0 deletions
+124
-0
src/base/acb/acbPush.c
+124
-0
No files found.
src/base/acb/acbPush.c
0 → 100644
View file @
f401c17f
/**CFile****************************************************************
FileName [acbPush.c]
SystemName [ABC: Logic synthesis and verification system.]
PackageName [Hierarchical word-level netlist.]
Synopsis [Implementation of logic pushing.]
Author [Alan Mishchenko]
Affiliation [UC Berkeley]
Date [Ver. 1.0. Started - July 21, 2015.]
Revision [$Id: acbPush.c,v 1.00 2014/11/29 00:00:00 alanmi Exp $]
***********************************************************************/
#include "acb.h"
#include "misc/util/utilTruth.h"
ABC_NAMESPACE_IMPL_START
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///
////////////////////////////////////////////////////////////////////////
/**Function*************************************************************
Synopsis [Check if the node can have its logic pushed.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int
Acb_ObjCheckFaninDsd
(
Acb_Ntk_t
*
p
,
int
iObj
,
int
iFanIndex
)
{
int
k
,
iFanin
,
*
pFanins
;
Acb_ObjForEachFaninFast
(
p
,
iObj
,
pFanins
,
iFanin
,
k
)
if
(
Abc_TtCheckDsdAnd
(
Acb_ObjTruth
(
p
,
iObj
),
iFanIndex
,
k
,
NULL
)
>=
0
)
return
1
;
return
0
;
}
int
Acb_ObjCountFaninAbsorb
(
Acb_Ntk_t
*
p
,
int
iObj
,
int
iFanin
,
int
iFanIndex
,
int
nLutSize
)
{
if
(
Acb_ObjSetTravIdCur
(
p
,
iFanin
)
)
return
0
;
if
(
Acb_ObjIsCi
(
p
,
iFanin
)
)
return
0
;
if
(
Acb_ObjFanoutNum
(
p
,
iFanin
)
>
1
)
return
0
;
if
(
!
Acb_ObjCheckFaninDsd
(
p
,
iObj
,
iFanIndex
)
)
return
0
;
if
(
Acb_ObjFaninNum
(
p
,
iFanin
)
==
nLutSize
)
return
0
;
return
1
;
}
int
Acb_NtkObjPushEstimate
(
Acb_Ntk_t
*
p
,
int
iObj
,
int
nLutSize
)
{
int
k
,
iFanin
,
*
pFanins
;
int
Count
=
Acb_ObjFaninNum
(
p
,
iObj
);
Acb_NtkIncTravId
(
p
);
Acb_ObjForEachFaninFast
(
p
,
iObj
,
pFanins
,
iFanin
,
k
)
{
Count
-=
Acb_ObjCountFaninAbsorb
(
p
,
iObj
,
iFanin
,
k
,
nLutSize
);
if
(
Count
<=
0
)
return
1
;
}
if
(
Acb_ObjFanoutNum
(
p
,
iObj
)
>
1
)
return
0
;
Acb_ObjForEachFaninFast
(
p
,
iObj
,
pFanins
,
iFanin
,
k
)
if
(
Abc_TtCheckOutAnd
(
Acb_ObjTruth
(
p
,
iObj
),
k
,
NULL
)
)
break
;
if
(
k
==
Acb_ObjFaninNum
(
p
,
iFanin
)
)
return
0
;
iFanin
=
Vec_IntEntry
(
Acb_ObjFanout
(
p
,
iObj
),
0
);
if
(
Acb_ObjFaninNum
(
p
,
iFanin
)
==
nLutSize
)
return
0
;
return
1
;
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void
Acb_NtkPushLogic
(
Acb_Ntk_t
*
p
,
int
nLutSize
,
int
fVerbose
)
{
//Vec_Bit_t * vVisited = Vec_BitStart( Acb_NtkObjNumMax(p) );
int
n
=
0
,
iObj
,
nNodes
=
0
;
Acb_NtkCreateFanout
(
p
);
// fanout data structure
for
(
n
=
2
;
n
<=
nLutSize
;
n
++
)
Acb_NtkForEachNode
(
p
,
iObj
)
{
if
(
!
Acb_NtkObjPushEstimate
(
p
,
iObj
,
nLutSize
)
)
continue
;
nNodes
++
;
}
printf
(
"Performed optimization at %d nodes.
\n
"
,
nNodes
);
//Vec_BitFree( vVisited );
}
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////
ABC_NAMESPACE_IMPL_END
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