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
270f6db2
Commit
270f6db2
authored
Jun 22, 2015
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Version abc90715
committer: Baruch Sterin <baruchs@gmail.com>
parent
0398ced8
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
52 additions
and
40 deletions
+52
-40
src/aig/ntl/ntl.h
+3
-3
src/aig/ntl/ntlExtract.c
+7
-8
src/aig/ntl/ntlFraig.c
+17
-9
src/aig/ntl/ntlMan.c
+1
-1
src/aig/ntl/ntlObj.c
+6
-6
src/aig/ntl/ntlUtil.c
+3
-3
src/base/abci/abc.c
+15
-10
No files found.
src/aig/ntl/ntl.h
View file @
270f6db2
...
@@ -137,14 +137,14 @@ struct Ntl_Reg_t_
...
@@ -137,14 +137,14 @@ struct Ntl_Reg_t_
struct
Ntl_Obj_t_
struct
Ntl_Obj_t_
{
{
Ntl_Mod_t
*
pModel
;
// the model
//
Ntl_Mod_t * pModel; // the model
void
*
pCopy
;
// the copy of this object
void
*
pCopy
;
// the copy of this object
unsigned
Type
:
3
;
// object type
unsigned
Type
:
3
;
// object type
unsigned
fMark
:
1
;
// temporary mark
unsigned
fMark
:
1
;
// temporary mark
unsigned
Id
:
28
;
// object ID
unsigned
Id
:
28
;
// object ID
int
nFanins
;
// the number of fanins
int
nFanins
;
// the number of fanins
int
nFanouts
;
// the number of fanouts
int
nFanouts
;
// the number of fanouts
int
Reset
;
// reset of the flop
//
int Reset; // reset of the flop
union
{
// functionality
union
{
// functionality
Ntl_Mod_t
*
pImplem
;
// model (for boxes)
Ntl_Mod_t
*
pImplem
;
// model (for boxes)
char
*
pSop
;
// SOP (for logic nodes)
char
*
pSop
;
// SOP (for logic nodes)
...
@@ -165,7 +165,7 @@ struct Ntl_Net_t_
...
@@ -165,7 +165,7 @@ struct Ntl_Net_t_
union
{
union
{
void
*
pCopy2
;
// the copy of this object
void
*
pCopy2
;
// the copy of this object
float
dTemp
;
// other data
float
dTemp
;
// other data
int
iTemp
;
// other data
//
int iTemp; // other data
};
};
Ntl_Obj_t
*
pDriver
;
// driver of the net
Ntl_Obj_t
*
pDriver
;
// driver of the net
unsigned
NetId
:
27
;
// unique ID of the net
unsigned
NetId
:
27
;
// unique ID of the net
...
...
src/aig/ntl/ntlExtract.c
View file @
270f6db2
...
@@ -116,13 +116,12 @@ Aig_Obj_t * Ntl_GraphToNetworkAig( Aig_Man_t * pMan, Dec_Graph_t * pGraph )
...
@@ -116,13 +116,12 @@ Aig_Obj_t * Ntl_GraphToNetworkAig( Aig_Man_t * pMan, Dec_Graph_t * pGraph )
SeeAlso []
SeeAlso []
***********************************************************************/
***********************************************************************/
Aig_Obj_t
*
Ntl_ManBuildNodeAig
(
Ntl_Obj_t
*
pNode
)
Aig_Obj_t
*
Ntl_ManBuildNodeAig
(
Ntl_
Man_t
*
p
,
Ntl_
Obj_t
*
pNode
)
{
{
Aig_Man_t
*
pMan
=
pNode
->
pModel
->
pMan
->
pAig
;
int
fUseFactor
=
1
;
int
fUseFactor
=
1
;
// consider the constant node
// consider the constant node
if
(
Kit_PlaGetVarNum
(
pNode
->
pSop
)
==
0
)
if
(
Kit_PlaGetVarNum
(
pNode
->
pSop
)
==
0
)
return
Aig_NotCond
(
Aig_ManConst1
(
p
Man
),
Kit_PlaIsConst0
(
pNode
->
pSop
)
);
return
Aig_NotCond
(
Aig_ManConst1
(
p
->
pAig
),
Kit_PlaIsConst0
(
pNode
->
pSop
)
);
// decide when to use factoring
// decide when to use factoring
if
(
fUseFactor
&&
Kit_PlaGetVarNum
(
pNode
->
pSop
)
>
2
&&
Kit_PlaGetCubeNum
(
pNode
->
pSop
)
>
1
)
if
(
fUseFactor
&&
Kit_PlaGetVarNum
(
pNode
->
pSop
)
>
2
&&
Kit_PlaGetCubeNum
(
pNode
->
pSop
)
>
1
)
{
{
...
@@ -136,11 +135,11 @@ Aig_Obj_t * Ntl_ManBuildNodeAig( Ntl_Obj_t * pNode )
...
@@ -136,11 +135,11 @@ Aig_Obj_t * Ntl_ManBuildNodeAig( Ntl_Obj_t * pNode )
Dec_GraphForEachLeaf
(
pFForm
,
pFFNode
,
i
)
Dec_GraphForEachLeaf
(
pFForm
,
pFFNode
,
i
)
pFFNode
->
pFunc
=
Ntl_ObjFanin
(
pNode
,
i
)
->
pCopy
;
pFFNode
->
pFunc
=
Ntl_ObjFanin
(
pNode
,
i
)
->
pCopy
;
// perform strashing
// perform strashing
pFunc
=
Ntl_GraphToNetworkAig
(
p
Man
,
pFForm
);
pFunc
=
Ntl_GraphToNetworkAig
(
p
->
pAig
,
pFForm
);
Dec_GraphFree
(
pFForm
);
Dec_GraphFree
(
pFForm
);
return
pFunc
;
return
pFunc
;
}
}
return
Ntl_ConvertSopToAigInternal
(
p
Man
,
pNode
,
pNode
->
pSop
);
return
Ntl_ConvertSopToAigInternal
(
p
->
pAig
,
pNode
,
pNode
->
pSop
);
}
}
/**Function*************************************************************
/**Function*************************************************************
...
@@ -198,7 +197,7 @@ int Ntl_ManExtract_rec( Ntl_Man_t * p, Ntl_Net_t * pNet )
...
@@ -198,7 +197,7 @@ int Ntl_ManExtract_rec( Ntl_Man_t * p, Ntl_Net_t * pNet )
}
}
Vec_PtrPush
(
p
->
vVisNodes
,
pObj
);
Vec_PtrPush
(
p
->
vVisNodes
,
pObj
);
if
(
Ntl_ObjIsNode
(
pObj
)
)
if
(
Ntl_ObjIsNode
(
pObj
)
)
pNet
->
pCopy
=
Ntl_ManBuildNodeAig
(
pObj
);
pNet
->
pCopy
=
Ntl_ManBuildNodeAig
(
p
,
p
Obj
);
pNet
->
nVisits
=
2
;
pNet
->
nVisits
=
2
;
return
1
;
return
1
;
}
}
...
@@ -371,7 +370,7 @@ int Ntl_ManCollapseBoxSeq1_rec( Ntl_Man_t * p, Ntl_Obj_t * pBox, int fSeq )
...
@@ -371,7 +370,7 @@ int Ntl_ManCollapseBoxSeq1_rec( Ntl_Man_t * p, Ntl_Obj_t * pBox, int fSeq )
pNet
->
nVisits
=
2
;
pNet
->
nVisits
=
2
;
// remember the class of this register
// remember the class of this register
Vec_IntPush
(
p
->
vRegClasses
,
p
->
pNal
?
pBox
->
iTemp
:
pObj
->
LatchId
.
regClass
);
Vec_IntPush
(
p
->
vRegClasses
,
p
->
pNal
?
pBox
->
iTemp
:
pObj
->
LatchId
.
regClass
);
Vec_IntPush
(
p
->
vRstClasses
,
p
->
pNal
?
pBox
->
Reset
:
-
1
);
//
Vec_IntPush( p->vRstClasses, p->pNal ? pBox->Reset : -1 );
}
}
// compute AIG for the internal nodes
// compute AIG for the internal nodes
Ntl_ModelForEachPo
(
pModel
,
pObj
,
i
)
Ntl_ModelForEachPo
(
pModel
,
pObj
,
i
)
...
@@ -478,7 +477,7 @@ int Ntl_ManCollapse_rec( Ntl_Man_t * p, Ntl_Net_t * pNet, int fSeq )
...
@@ -478,7 +477,7 @@ int Ntl_ManCollapse_rec( Ntl_Man_t * p, Ntl_Net_t * pNet, int fSeq )
return
0
;
return
0
;
}
}
if
(
Ntl_ObjIsNode
(
pObj
)
)
if
(
Ntl_ObjIsNode
(
pObj
)
)
pNet
->
pCopy
=
Ntl_ManBuildNodeAig
(
pObj
);
pNet
->
pCopy
=
Ntl_ManBuildNodeAig
(
p
,
p
Obj
);
pNet
->
nVisits
=
2
;
pNet
->
nVisits
=
2
;
return
1
;
return
1
;
}
}
...
...
src/aig/ntl/ntlFraig.c
View file @
270f6db2
...
@@ -373,7 +373,7 @@ if ( fVerbose )
...
@@ -373,7 +373,7 @@ if ( fVerbose )
Synopsis [Returns AIG with WB after fraiging.]
Synopsis [Returns AIG with WB after fraiging.]
Description []
Description [
Consumes the input NTL to save memory.
]
SideEffects []
SideEffects []
...
@@ -386,11 +386,12 @@ Ntl_Man_t * Ntl_ManFraig( Ntl_Man_t * p, int nPartSize, int nConfLimit, int nLev
...
@@ -386,11 +386,12 @@ Ntl_Man_t * Ntl_ManFraig( Ntl_Man_t * p, int nPartSize, int nConfLimit, int nLev
Aig_Man_t
*
pAig
,
*
pAigCol
,
*
pTemp
;
Aig_Man_t
*
pAig
,
*
pAigCol
,
*
pTemp
;
if
(
Ntl_ModelNodeNum
(
Ntl_ManRootModel
(
p
))
==
0
)
if
(
Ntl_ModelNodeNum
(
Ntl_ManRootModel
(
p
))
==
0
)
return
Ntl_ManDup
(
p
)
;
return
p
;
// collapse the AIG
// collapse the AIG
pAig
=
Ntl_ManExtract
(
p
);
pAig
=
Ntl_ManExtract
(
p
);
pNew
=
Ntl_ManInsertAig
(
p
,
pAig
);
pNew
=
Ntl_ManInsertAig
(
p
,
pAig
);
Ntl_ManFree
(
p
);
pAigCol
=
Ntl_ManCollapseComb
(
pNew
);
pAigCol
=
Ntl_ManCollapseComb
(
pNew
);
if
(
pAigCol
==
NULL
)
if
(
pAigCol
==
NULL
)
{
{
...
@@ -434,12 +435,15 @@ Ntl_Man_t * Ntl_ManFraig( Ntl_Man_t * p, int nPartSize, int nConfLimit, int nLev
...
@@ -434,12 +435,15 @@ Ntl_Man_t * Ntl_ManFraig( Ntl_Man_t * p, int nPartSize, int nConfLimit, int nLev
***********************************************************************/
***********************************************************************/
int
Ntl_ManAigCountResets
(
Ntl_Man_t
*
pNtl
)
int
Ntl_ManAigCountResets
(
Ntl_Man_t
*
pNtl
)
{
{
/*
Ntl_Mod_t * pModel = Ntl_ManRootModel(pNtl);
Ntl_Mod_t * pModel = Ntl_ManRootModel(pNtl);
Ntl_Obj_t * pBox;
Ntl_Obj_t * pBox;
int i, Counter = -1;
int i, Counter = -1;
Ntl_ModelForEachObj( pModel, pBox, i )
Ntl_ModelForEachObj( pModel, pBox, i )
Counter = ABC_MAX( Counter, pBox->Reset );
Counter = ABC_MAX( Counter, pBox->Reset );
return Counter + 1;
return Counter + 1;
*/
return
-
1
;
}
}
/**Function*************************************************************
/**Function*************************************************************
...
@@ -590,7 +594,7 @@ void Ntl_ManRemapClassesScorr( Ntl_Man_t * pNtl, Aig_Man_t * p, Aig_Man_t * pNew
...
@@ -590,7 +594,7 @@ void Ntl_ManRemapClassesScorr( Ntl_Man_t * pNtl, Aig_Man_t * p, Aig_Man_t * pNew
Synopsis [Performs sequential cleanup.]
Synopsis [Performs sequential cleanup.]
Description []
Description [
Consumes the input NTL to save memory.
]
SideEffects []
SideEffects []
...
@@ -607,6 +611,7 @@ Ntl_Man_t * Ntl_ManScl( Ntl_Man_t * p, int fLatchConst, int fLatchEqual, int fVe
...
@@ -607,6 +611,7 @@ Ntl_Man_t * Ntl_ManScl( Ntl_Man_t * p, int fLatchConst, int fLatchEqual, int fVe
//Ntl_ManPrintStats( p );
//Ntl_ManPrintStats( p );
//Aig_ManPrintStats( pAig );
//Aig_ManPrintStats( pAig );
pNew
=
Ntl_ManInsertAig
(
p
,
pAig
);
pNew
=
Ntl_ManInsertAig
(
p
,
pAig
);
Ntl_ManFree
(
p
);
pAigCol
=
Ntl_ManCollapseSeq
(
pNew
,
0
,
fVerbose
);
pAigCol
=
Ntl_ManCollapseSeq
(
pNew
,
0
,
fVerbose
);
if
(
pAigCol
==
NULL
)
if
(
pAigCol
==
NULL
)
{
{
...
@@ -617,7 +622,7 @@ Ntl_Man_t * Ntl_ManScl( Ntl_Man_t * p, int fLatchConst, int fLatchEqual, int fVe
...
@@ -617,7 +622,7 @@ Ntl_Man_t * Ntl_ManScl( Ntl_Man_t * p, int fLatchConst, int fLatchEqual, int fVe
//Aig_ManPrintStats( pAigCol );
//Aig_ManPrintStats( pAigCol );
// perform SCL
// perform SCL
if
(
p
->
pNal
)
if
(
p
New
->
pNal
)
{
{
Aig_Man_t
*
pAigRst
;
Aig_Man_t
*
pAigRst
;
pAigRst
=
Ntl_ManAigToRst
(
pNew
,
pAigCol
);
pAigRst
=
Ntl_ManAigToRst
(
pNew
,
pAigCol
);
...
@@ -644,7 +649,7 @@ Ntl_Man_t * Ntl_ManScl( Ntl_Man_t * p, int fLatchConst, int fLatchEqual, int fVe
...
@@ -644,7 +649,7 @@ Ntl_Man_t * Ntl_ManScl( Ntl_Man_t * p, int fLatchConst, int fLatchEqual, int fVe
Synopsis [Returns AIG with WB after fraiging.]
Synopsis [Returns AIG with WB after fraiging.]
Description []
Description [
Consumes the input NTL to save memory.
]
SideEffects []
SideEffects []
...
@@ -663,6 +668,7 @@ Ntl_Man_t * Ntl_ManLcorr( Ntl_Man_t * p, int nConfMax, int fScorrGia, int fUseCS
...
@@ -663,6 +668,7 @@ Ntl_Man_t * Ntl_ManLcorr( Ntl_Man_t * p, int nConfMax, int fScorrGia, int fUseCS
// collapse the AIG
// collapse the AIG
pAig
=
Ntl_ManExtract
(
p
);
pAig
=
Ntl_ManExtract
(
p
);
pNew
=
Ntl_ManInsertAig
(
p
,
pAig
);
pNew
=
Ntl_ManInsertAig
(
p
,
pAig
);
Ntl_ManFree
(
p
);
pAigCol
=
Ntl_ManCollapseSeq
(
pNew
,
pPars
->
nMinDomSize
,
pPars
->
fVerbose
);
pAigCol
=
Ntl_ManCollapseSeq
(
pNew
,
pPars
->
nMinDomSize
,
pPars
->
fVerbose
);
if
(
pAigCol
==
NULL
)
if
(
pAigCol
==
NULL
)
{
{
...
@@ -673,7 +679,7 @@ Ntl_Man_t * Ntl_ManLcorr( Ntl_Man_t * p, int nConfMax, int fScorrGia, int fUseCS
...
@@ -673,7 +679,7 @@ Ntl_Man_t * Ntl_ManLcorr( Ntl_Man_t * p, int nConfMax, int fScorrGia, int fUseCS
// perform LCORR
// perform LCORR
pPars
->
fScorrGia
=
fScorrGia
;
pPars
->
fScorrGia
=
fScorrGia
;
pPars
->
fUseCSat
=
fUseCSat
;
pPars
->
fUseCSat
=
fUseCSat
;
if
(
p
->
pNal
)
if
(
p
New
->
pNal
)
{
{
Aig_Man_t
*
pAigRst
;
Aig_Man_t
*
pAigRst
;
pAigRst
=
Ntl_ManAigToRst
(
pNew
,
pAigCol
);
pAigRst
=
Ntl_ManAigToRst
(
pNew
,
pAigCol
);
...
@@ -700,7 +706,7 @@ Ntl_Man_t * Ntl_ManLcorr( Ntl_Man_t * p, int nConfMax, int fScorrGia, int fUseCS
...
@@ -700,7 +706,7 @@ Ntl_Man_t * Ntl_ManLcorr( Ntl_Man_t * p, int nConfMax, int fScorrGia, int fUseCS
Synopsis [Returns AIG with WB after fraiging.]
Synopsis [Returns AIG with WB after fraiging.]
Description []
Description [
Consumes the input NTL to save memory.
]
SideEffects []
SideEffects []
...
@@ -716,6 +722,7 @@ Ntl_Man_t * Ntl_ManSsw( Ntl_Man_t * p, Fra_Ssw_t * pPars )
...
@@ -716,6 +722,7 @@ Ntl_Man_t * Ntl_ManSsw( Ntl_Man_t * p, Fra_Ssw_t * pPars )
// collapse the AIG
// collapse the AIG
pAig
=
Ntl_ManExtract
(
p
);
pAig
=
Ntl_ManExtract
(
p
);
pNew
=
Ntl_ManInsertAig
(
p
,
pAig
);
pNew
=
Ntl_ManInsertAig
(
p
,
pAig
);
Ntl_ManFree
(
p
);
pAigCol
=
Ntl_ManCollapseSeq
(
pNew
,
pPars
->
nMinDomSize
,
pPars
->
fVerbose
);
pAigCol
=
Ntl_ManCollapseSeq
(
pNew
,
pPars
->
nMinDomSize
,
pPars
->
fVerbose
);
if
(
pAigCol
==
NULL
)
if
(
pAigCol
==
NULL
)
{
{
...
@@ -739,7 +746,7 @@ Ntl_Man_t * Ntl_ManSsw( Ntl_Man_t * p, Fra_Ssw_t * pPars )
...
@@ -739,7 +746,7 @@ Ntl_Man_t * Ntl_ManSsw( Ntl_Man_t * p, Fra_Ssw_t * pPars )
Synopsis [Returns AIG with WB after fraiging.]
Synopsis [Returns AIG with WB after fraiging.]
Description []
Description [
Consumes the input NTL to save memory.
]
SideEffects []
SideEffects []
...
@@ -754,6 +761,7 @@ Ntl_Man_t * Ntl_ManScorr( Ntl_Man_t * p, Ssw_Pars_t * pPars )
...
@@ -754,6 +761,7 @@ Ntl_Man_t * Ntl_ManScorr( Ntl_Man_t * p, Ssw_Pars_t * pPars )
// collapse the AIG
// collapse the AIG
pAig
=
Ntl_ManExtract
(
p
);
pAig
=
Ntl_ManExtract
(
p
);
pNew
=
Ntl_ManInsertAig
(
p
,
pAig
);
pNew
=
Ntl_ManInsertAig
(
p
,
pAig
);
Ntl_ManFree
(
p
);
pAigCol
=
Ntl_ManCollapseSeq
(
pNew
,
pPars
->
nMinDomSize
,
pPars
->
fVerbose
);
pAigCol
=
Ntl_ManCollapseSeq
(
pNew
,
pPars
->
nMinDomSize
,
pPars
->
fVerbose
);
if
(
pAigCol
==
NULL
)
if
(
pAigCol
==
NULL
)
{
{
...
@@ -762,7 +770,7 @@ Ntl_Man_t * Ntl_ManScorr( Ntl_Man_t * p, Ssw_Pars_t * pPars )
...
@@ -762,7 +770,7 @@ Ntl_Man_t * Ntl_ManScorr( Ntl_Man_t * p, Ssw_Pars_t * pPars )
}
}
// perform SCL
// perform SCL
if
(
p
->
pNal
)
if
(
p
New
->
pNal
)
{
{
Aig_Man_t
*
pAigRst
;
Aig_Man_t
*
pAigRst
;
pAigRst
=
Ntl_ManAigToRst
(
pNew
,
pAigCol
);
pAigRst
=
Ntl_ManAigToRst
(
pNew
,
pAigCol
);
...
...
src/aig/ntl/ntlMan.c
View file @
270f6db2
...
@@ -124,7 +124,7 @@ Ntl_Man_t * Ntl_ManStartFrom( Ntl_Man_t * pOld )
...
@@ -124,7 +124,7 @@ Ntl_Man_t * Ntl_ManStartFrom( Ntl_Man_t * pOld )
{
{
((
Ntl_Obj_t
*
)
pBox
->
pCopy
)
->
pImplem
=
pBox
->
pImplem
->
pCopy
;
((
Ntl_Obj_t
*
)
pBox
->
pCopy
)
->
pImplem
=
pBox
->
pImplem
->
pCopy
;
((
Ntl_Obj_t
*
)
pBox
->
pCopy
)
->
iTemp
=
pBox
->
iTemp
;
((
Ntl_Obj_t
*
)
pBox
->
pCopy
)
->
iTemp
=
pBox
->
iTemp
;
((
Ntl_Obj_t
*
)
pBox
->
pCopy
)
->
Reset
=
pBox
->
Reset
;
//
((Ntl_Obj_t *)pBox->pCopy)->Reset = pBox->Reset;
}
}
Ntl_ManForEachCiNet
(
pOld
,
pNet
,
i
)
Ntl_ManForEachCiNet
(
pOld
,
pNet
,
i
)
Vec_PtrPush
(
pNew
->
vCis
,
pNet
->
pCopy
);
Vec_PtrPush
(
pNew
->
vCis
,
pNet
->
pCopy
);
...
...
src/aig/ntl/ntlObj.c
View file @
270f6db2
...
@@ -47,7 +47,7 @@ Ntl_Obj_t * Ntl_ModelCreatePi( Ntl_Mod_t * pModel )
...
@@ -47,7 +47,7 @@ Ntl_Obj_t * Ntl_ModelCreatePi( Ntl_Mod_t * pModel )
p
->
Id
=
Vec_PtrSize
(
pModel
->
vObjs
);
p
->
Id
=
Vec_PtrSize
(
pModel
->
vObjs
);
Vec_PtrPush
(
pModel
->
vObjs
,
p
);
Vec_PtrPush
(
pModel
->
vObjs
,
p
);
Vec_PtrPush
(
pModel
->
vPis
,
p
);
Vec_PtrPush
(
pModel
->
vPis
,
p
);
p
->
pModel
=
pModel
;
//
p->pModel = pModel;
p
->
Type
=
NTL_OBJ_PI
;
p
->
Type
=
NTL_OBJ_PI
;
p
->
nFanins
=
0
;
p
->
nFanins
=
0
;
p
->
nFanouts
=
1
;
p
->
nFanouts
=
1
;
...
@@ -74,7 +74,7 @@ Ntl_Obj_t * Ntl_ModelCreatePo( Ntl_Mod_t * pModel, Ntl_Net_t * pNet )
...
@@ -74,7 +74,7 @@ Ntl_Obj_t * Ntl_ModelCreatePo( Ntl_Mod_t * pModel, Ntl_Net_t * pNet )
p
->
Id
=
Vec_PtrSize
(
pModel
->
vObjs
);
p
->
Id
=
Vec_PtrSize
(
pModel
->
vObjs
);
Vec_PtrPush
(
pModel
->
vObjs
,
p
);
Vec_PtrPush
(
pModel
->
vObjs
,
p
);
Vec_PtrPush
(
pModel
->
vPos
,
p
);
Vec_PtrPush
(
pModel
->
vPos
,
p
);
p
->
pModel
=
pModel
;
//
p->pModel = pModel;
p
->
Type
=
NTL_OBJ_PO
;
p
->
Type
=
NTL_OBJ_PO
;
p
->
nFanins
=
1
;
p
->
nFanins
=
1
;
p
->
nFanouts
=
0
;
p
->
nFanouts
=
0
;
...
@@ -101,7 +101,7 @@ Ntl_Obj_t * Ntl_ModelCreateLatch( Ntl_Mod_t * pModel )
...
@@ -101,7 +101,7 @@ Ntl_Obj_t * Ntl_ModelCreateLatch( Ntl_Mod_t * pModel )
memset
(
p
,
0
,
sizeof
(
Ntl_Obj_t
)
+
sizeof
(
Ntl_Net_t
*
)
*
3
);
memset
(
p
,
0
,
sizeof
(
Ntl_Obj_t
)
+
sizeof
(
Ntl_Net_t
*
)
*
3
);
p
->
Id
=
Vec_PtrSize
(
pModel
->
vObjs
);
p
->
Id
=
Vec_PtrSize
(
pModel
->
vObjs
);
Vec_PtrPush
(
pModel
->
vObjs
,
p
);
Vec_PtrPush
(
pModel
->
vObjs
,
p
);
p
->
pModel
=
pModel
;
//
p->pModel = pModel;
p
->
Type
=
NTL_OBJ_LATCH
;
p
->
Type
=
NTL_OBJ_LATCH
;
p
->
nFanins
=
1
;
p
->
nFanins
=
1
;
p
->
nFanouts
=
1
;
p
->
nFanouts
=
1
;
...
@@ -127,7 +127,7 @@ Ntl_Obj_t * Ntl_ModelCreateNode( Ntl_Mod_t * pModel, int nFanins )
...
@@ -127,7 +127,7 @@ Ntl_Obj_t * Ntl_ModelCreateNode( Ntl_Mod_t * pModel, int nFanins )
memset
(
p
,
0
,
sizeof
(
Ntl_Obj_t
)
+
sizeof
(
Ntl_Net_t
*
)
*
(
nFanins
+
1
)
);
memset
(
p
,
0
,
sizeof
(
Ntl_Obj_t
)
+
sizeof
(
Ntl_Net_t
*
)
*
(
nFanins
+
1
)
);
p
->
Id
=
Vec_PtrSize
(
pModel
->
vObjs
);
p
->
Id
=
Vec_PtrSize
(
pModel
->
vObjs
);
Vec_PtrPush
(
pModel
->
vObjs
,
p
);
Vec_PtrPush
(
pModel
->
vObjs
,
p
);
p
->
pModel
=
pModel
;
//
p->pModel = pModel;
p
->
Type
=
NTL_OBJ_NODE
;
p
->
Type
=
NTL_OBJ_NODE
;
p
->
nFanins
=
nFanins
;
p
->
nFanins
=
nFanins
;
p
->
nFanouts
=
1
;
p
->
nFanouts
=
1
;
...
@@ -156,11 +156,11 @@ Ntl_Obj_t * Ntl_ModelCreateBox( Ntl_Mod_t * pModel, int nFanins, int nFanouts )
...
@@ -156,11 +156,11 @@ Ntl_Obj_t * Ntl_ModelCreateBox( Ntl_Mod_t * pModel, int nFanins, int nFanouts )
memset
(
p
,
0
,
sizeof
(
Ntl_Obj_t
)
+
sizeof
(
Ntl_Net_t
*
)
*
(
nFanins
+
nFanouts
)
);
memset
(
p
,
0
,
sizeof
(
Ntl_Obj_t
)
+
sizeof
(
Ntl_Net_t
*
)
*
(
nFanins
+
nFanouts
)
);
p
->
Id
=
Vec_PtrSize
(
pModel
->
vObjs
);
p
->
Id
=
Vec_PtrSize
(
pModel
->
vObjs
);
Vec_PtrPush
(
pModel
->
vObjs
,
p
);
Vec_PtrPush
(
pModel
->
vObjs
,
p
);
p
->
pModel
=
pModel
;
//
p->pModel = pModel;
p
->
Type
=
NTL_OBJ_BOX
;
p
->
Type
=
NTL_OBJ_BOX
;
p
->
nFanins
=
nFanins
;
p
->
nFanins
=
nFanins
;
p
->
nFanouts
=
nFanouts
;
p
->
nFanouts
=
nFanouts
;
p
->
Reset
=
-
1
;
//
p->Reset = -1;
pModel
->
nObjs
[
NTL_OBJ_BOX
]
++
;
pModel
->
nObjs
[
NTL_OBJ_BOX
]
++
;
return
p
;
return
p
;
}
}
...
...
src/aig/ntl/ntlUtil.c
View file @
270f6db2
...
@@ -247,10 +247,10 @@ void Ntl_ManSetZeroInitValues( Ntl_Man_t * p )
...
@@ -247,10 +247,10 @@ void Ntl_ManSetZeroInitValues( Ntl_Man_t * p )
SeeAlso []
SeeAlso []
***********************************************************************/
***********************************************************************/
void
Ntl_ManAddInverters
(
Ntl_Obj_t
*
pObj
)
void
Ntl_ManAddInverters
(
Ntl_
Mod_t
*
pRoot
,
Ntl_
Obj_t
*
pObj
)
{
{
char
*
pStore
;
char
*
pStore
;
Ntl_Mod_t
*
pRoot
=
pObj
->
pModel
;
//
Ntl_Mod_t * pRoot = pObj->pModel;
Ntl_Man_t
*
pMan
=
pRoot
->
pMan
;
Ntl_Man_t
*
pMan
=
pRoot
->
pMan
;
Ntl_Net_t
*
pNetLo
,
*
pNetLi
,
*
pNetLoInv
,
*
pNetLiInv
;
Ntl_Net_t
*
pNetLo
,
*
pNetLi
,
*
pNetLoInv
,
*
pNetLiInv
;
Ntl_Obj_t
*
pNode
;
Ntl_Obj_t
*
pNode
;
...
@@ -322,7 +322,7 @@ void Ntl_ManTransformInitValues( Ntl_Man_t * p )
...
@@ -322,7 +322,7 @@ void Ntl_ManTransformInitValues( Ntl_Man_t * p )
Ntl_ModelForEachLatch
(
pRoot
,
pObj
,
i
)
Ntl_ModelForEachLatch
(
pRoot
,
pObj
,
i
)
{
{
if
(
Ntl_ObjIsInit1
(
pObj
)
)
if
(
Ntl_ObjIsInit1
(
pObj
)
)
Ntl_ManAddInverters
(
pObj
);
Ntl_ManAddInverters
(
p
Root
,
p
Obj
);
pObj
->
LatchId
.
regInit
=
0
;
pObj
->
LatchId
.
regInit
=
0
;
}
}
}
}
...
...
src/base/abci/abc.c
View file @
270f6db2
...
@@ -20963,7 +20963,7 @@ usage:
...
@@ -20963,7 +20963,7 @@ usage:
***********************************************************************/
***********************************************************************/
int
Abc_CommandAbc8Fraig
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
int
Abc_CommandAbc8Fraig
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
{
{
void
*
pNtlNew
;
void
*
pNtlNew
,
*
pNtlOld
;
int
c
,
fVerbose
;
int
c
,
fVerbose
;
int
nPartSize
;
int
nPartSize
;
int
nConfLimit
;
int
nConfLimit
;
...
@@ -21037,7 +21037,8 @@ int Abc_CommandAbc8Fraig( Abc_Frame_t * pAbc, int argc, char ** argv )
...
@@ -21037,7 +21037,8 @@ int Abc_CommandAbc8Fraig( Abc_Frame_t * pAbc, int argc, char ** argv )
}
}
// get the input file name
// get the input file name
pNtlNew
=
Ntl_ManFraig
(
pAbc
->
pAbc8Ntl
,
nPartSize
,
nConfLimit
,
nLevelMax
,
fUseCSat
,
fVerbose
);
pNtlOld
=
pAbc
->
pAbc8Ntl
;
pAbc
->
pAbc8Ntl
=
NULL
;
pNtlNew
=
Ntl_ManFraig
(
pNtlOld
,
nPartSize
,
nConfLimit
,
nLevelMax
,
fUseCSat
,
fVerbose
);
if
(
pNtlNew
==
NULL
)
if
(
pNtlNew
==
NULL
)
{
{
printf
(
"Abc_CommandAbc8Fraig(): Tranformation of the AIG has failed.
\n
"
);
printf
(
"Abc_CommandAbc8Fraig(): Tranformation of the AIG has failed.
\n
"
);
...
@@ -21084,7 +21085,7 @@ usage:
...
@@ -21084,7 +21085,7 @@ usage:
***********************************************************************/
***********************************************************************/
int
Abc_CommandAbc8Scl
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
int
Abc_CommandAbc8Scl
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
{
{
void
*
pNtlNew
;
void
*
pNtlNew
,
*
pNtlOld
;
int
c
;
int
c
;
int
fLatchConst
;
int
fLatchConst
;
int
fLatchEqual
;
int
fLatchEqual
;
...
@@ -21131,7 +21132,8 @@ int Abc_CommandAbc8Scl( Abc_Frame_t * pAbc, int argc, char ** argv )
...
@@ -21131,7 +21132,8 @@ int Abc_CommandAbc8Scl( Abc_Frame_t * pAbc, int argc, char ** argv )
}
}
// get the input file name
// get the input file name
pNtlNew
=
Ntl_ManScl
(
pAbc
->
pAbc8Ntl
,
fLatchConst
,
fLatchEqual
,
fVerbose
);
pNtlOld
=
pAbc
->
pAbc8Ntl
;
pAbc
->
pAbc8Ntl
=
NULL
;
pNtlNew
=
Ntl_ManScl
(
pNtlOld
,
fLatchConst
,
fLatchEqual
,
fVerbose
);
if
(
pNtlNew
==
NULL
)
if
(
pNtlNew
==
NULL
)
{
{
printf
(
"Abc_CommandAbc8Scl(): Tranformation of the AIG has failed.
\n
"
);
printf
(
"Abc_CommandAbc8Scl(): Tranformation of the AIG has failed.
\n
"
);
...
@@ -21177,7 +21179,7 @@ usage:
...
@@ -21177,7 +21179,7 @@ usage:
***********************************************************************/
***********************************************************************/
int
Abc_CommandAbc8Lcorr
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
int
Abc_CommandAbc8Lcorr
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
{
{
void
*
pNtlNew
;
void
*
pNtlNew
,
*
pNtlOld
;
int
c
;
int
c
;
int
fScorrGia
;
int
fScorrGia
;
int
fUseCSat
;
int
fUseCSat
;
...
@@ -21250,7 +21252,8 @@ int Abc_CommandAbc8Lcorr( Abc_Frame_t * pAbc, int argc, char ** argv )
...
@@ -21250,7 +21252,8 @@ int Abc_CommandAbc8Lcorr( Abc_Frame_t * pAbc, int argc, char ** argv )
}
}
// get the input file name
// get the input file name
pNtlNew
=
Ntl_ManLcorr
(
pAbc
->
pAbc8Ntl
,
nConfMax
,
fScorrGia
,
fUseCSat
,
fVerbose
);
pNtlOld
=
pAbc
->
pAbc8Ntl
;
pAbc
->
pAbc8Ntl
=
NULL
;
pNtlNew
=
Ntl_ManLcorr
(
pNtlOld
,
nConfMax
,
fScorrGia
,
fUseCSat
,
fVerbose
);
if
(
pNtlNew
==
NULL
)
if
(
pNtlNew
==
NULL
)
{
{
printf
(
"Abc_CommandAbc8Lcorr(): Tranformation of the AIG has failed.
\n
"
);
printf
(
"Abc_CommandAbc8Lcorr(): Tranformation of the AIG has failed.
\n
"
);
...
@@ -21297,7 +21300,7 @@ usage:
...
@@ -21297,7 +21300,7 @@ usage:
***********************************************************************/
***********************************************************************/
int
Abc_CommandAbc8Ssw
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
int
Abc_CommandAbc8Ssw
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
{
{
void
*
pNtlNew
;
void
*
pNtlNew
,
*
pNtlOld
;
Fra_Ssw_t
Pars
,
*
pPars
=
&
Pars
;
Fra_Ssw_t
Pars
,
*
pPars
=
&
Pars
;
int
c
;
int
c
;
extern
Aig_Man_t
*
Ntl_ManExtract
(
void
*
p
);
extern
Aig_Man_t
*
Ntl_ManExtract
(
void
*
p
);
...
@@ -21455,7 +21458,8 @@ int Abc_CommandAbc8Ssw( Abc_Frame_t * pAbc, int argc, char ** argv )
...
@@ -21455,7 +21458,8 @@ int Abc_CommandAbc8Ssw( Abc_Frame_t * pAbc, int argc, char ** argv )
}
}
// get the input file name
// get the input file name
pNtlNew
=
Ntl_ManSsw
(
pAbc
->
pAbc8Ntl
,
pPars
);
pNtlOld
=
pAbc
->
pAbc8Ntl
;
pAbc
->
pAbc8Ntl
=
NULL
;
pNtlNew
=
Ntl_ManSsw
(
pNtlOld
,
pPars
);
if
(
pNtlNew
==
NULL
)
if
(
pNtlNew
==
NULL
)
{
{
printf
(
"Abc_CommandAbc8Ssw(): Tranformation of the AIG has failed.
\n
"
);
printf
(
"Abc_CommandAbc8Ssw(): Tranformation of the AIG has failed.
\n
"
);
...
@@ -21511,7 +21515,7 @@ usage:
...
@@ -21511,7 +21515,7 @@ usage:
***********************************************************************/
***********************************************************************/
int
Abc_CommandAbc8Scorr
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
int
Abc_CommandAbc8Scorr
(
Abc_Frame_t
*
pAbc
,
int
argc
,
char
**
argv
)
{
{
void
*
pNtlNew
;
void
*
pNtlNew
,
*
pNtlOld
;
Ssw_Pars_t
Pars
,
*
pPars
=
&
Pars
;
Ssw_Pars_t
Pars
,
*
pPars
=
&
Pars
;
int
c
;
int
c
;
extern
Aig_Man_t
*
Ntl_ManExtract
(
void
*
p
);
extern
Aig_Man_t
*
Ntl_ManExtract
(
void
*
p
);
...
@@ -21683,7 +21687,8 @@ int Abc_CommandAbc8Scorr( Abc_Frame_t * pAbc, int argc, char ** argv )
...
@@ -21683,7 +21687,8 @@ int Abc_CommandAbc8Scorr( Abc_Frame_t * pAbc, int argc, char ** argv )
}
}
// get the input file name
// get the input file name
pNtlNew
=
Ntl_ManScorr
(
pAbc
->
pAbc8Ntl
,
pPars
);
pNtlOld
=
pAbc
->
pAbc8Ntl
;
pAbc
->
pAbc8Ntl
=
NULL
;
pNtlNew
=
Ntl_ManScorr
(
pNtlOld
,
pPars
);
if
(
pNtlNew
==
NULL
)
if
(
pNtlNew
==
NULL
)
{
{
printf
(
"Abc_CommandAbc8Scorr(): Tranformation of the AIG has failed.
\n
"
);
printf
(
"Abc_CommandAbc8Scorr(): Tranformation of the AIG has failed.
\n
"
);
...
...
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