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
70697f86
Commit
70697f86
authored
Jun 22, 2015
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Version abc90528
committer: Baruch Sterin <baruchs@gmail.com>
parent
d5b0fdee
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
586 additions
and
53 deletions
+586
-53
abclib.dsp
+44
-0
src/aig/cec/cecCec.c
+52
-0
src/aig/gia/module.make
+1
-0
src/aig/ntl/ntl.h
+2
-1
src/aig/ntl/ntlExtract.c
+6
-5
src/aig/ntl/ntlFraig.c
+30
-11
src/aig/ntl/ntlMan.c
+82
-0
src/aig/ntl/ntlTable.c
+24
-0
src/aig/ntl/ntlWriteBlif.c
+1
-1
src/aig/nwk/nwkUtil.c
+0
-12
src/aig/ssw/sswCore.c
+10
-2
src/base/abc/abcLib.c
+1
-1
src/base/abci/abc.c
+108
-13
src/base/abci/abcXsim.c
+10
-4
src/base/io/io.c
+8
-3
src/base/io/ioReadBlif.c
+75
-0
src/base/io/ioReadBlifMv.c
+8
-0
src/base/main/main.c
+124
-0
No files found.
abclib.dsp
View file @
70697f86
...
@@ -3669,6 +3669,46 @@ SOURCE=.\src\aig\cgt\cgtSat.c
...
@@ -3669,6 +3669,46 @@ SOURCE=.\src\aig\cgt\cgtSat.c
# Begin Group "nal"
# Begin Group "nal"
# PROP Default_Filter ""
# PROP Default_Filter ""
# Begin Source File
SOURCE=.\src\aig\nal090422\nal.h
# End Source File
# Begin Source File
SOURCE=.\src\aig\nal090422\nalCore.c
# End Source File
# Begin Source File
SOURCE=.\src\aig\nal090422\nalFlop.c
# End Source File
# Begin Source File
SOURCE=.\src\aig\nal090422\nalFunc.c
# End Source File
# Begin Source File
SOURCE=.\src\aig\nal090422\nalInt.h
# End Source File
# Begin Source File
SOURCE=.\src\aig\nal090422\nalMan.c
# End Source File
# Begin Source File
SOURCE=.\src\aig\nal090422\nalModels.c
# End Source File
# Begin Source File
SOURCE=.\src\aig\nal090422\nalRead.c
# End Source File
# Begin Source File
SOURCE=.\src\aig\nal090422\nalUtil.c
# End Source File
# Begin Source File
SOURCE=.\src\aig\nal090422\nalWrite.c
# End Source File
# End Group
# End Group
# Begin Group "gia"
# Begin Group "gia"
...
@@ -3727,6 +3767,10 @@ SOURCE=.\src\aig\gia\giaEquiv.c
...
@@ -3727,6 +3767,10 @@ SOURCE=.\src\aig\gia\giaEquiv.c
# End Source File
# End Source File
# Begin Source File
# Begin Source File
SOURCE=.\src\aig\gia\giaEra.c
# End Source File
# Begin Source File
SOURCE=.\src\aig\gia\giaFanout.c
SOURCE=.\src\aig\gia\giaFanout.c
# End Source File
# End Source File
# Begin Source File
# Begin Source File
...
...
src/aig/cec/cecCec.c
View file @
70697f86
...
@@ -247,6 +247,33 @@ int Cec_ManVerifyTwoAigs( Aig_Man_t * pAig0, Aig_Man_t * pAig1, int fVerbose )
...
@@ -247,6 +247,33 @@ int Cec_ManVerifyTwoAigs( Aig_Man_t * pAig0, Aig_Man_t * pAig1, int fVerbose )
SeeAlso []
SeeAlso []
***********************************************************************/
***********************************************************************/
Aig_Man_t
*
Cec_LatchCorrespondence
(
Aig_Man_t
*
pAig
,
int
nConfs
,
int
fUseCSat
)
{
extern
int
Cec_ManLSCorrespondenceClasses
(
Gia_Man_t
*
pAig
,
Cec_ParCor_t
*
pPars
);
Gia_Man_t
*
pGia
;
Cec_ParCor_t
CorPars
,
*
pCorPars
=
&
CorPars
;
Cec_ManCorSetDefaultParams
(
pCorPars
);
pCorPars
->
fLatchCorr
=
1
;
pCorPars
->
fUseCSat
=
fUseCSat
;
pCorPars
->
nBTLimit
=
nConfs
;
pGia
=
Gia_ManFromAigSimple
(
pAig
);
Cec_ManLSCorrespondenceClasses
(
pGia
,
pCorPars
);
Gia_ManReprToAigRepr
(
pAig
,
pGia
);
Gia_ManStop
(
pGia
);
return
Aig_ManDupSimple
(
pAig
);
}
/**Function*************************************************************
Synopsis [Implementation of new signal correspodence.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
Aig_Man_t
*
Cec_SignalCorrespondence
(
Aig_Man_t
*
pAig
,
int
nConfs
,
int
fUseCSat
)
Aig_Man_t
*
Cec_SignalCorrespondence
(
Aig_Man_t
*
pAig
,
int
nConfs
,
int
fUseCSat
)
{
{
extern
int
Cec_ManLSCorrespondenceClasses
(
Gia_Man_t
*
pAig
,
Cec_ParCor_t
*
pPars
);
extern
int
Cec_ManLSCorrespondenceClasses
(
Gia_Man_t
*
pAig
,
Cec_ParCor_t
*
pPars
);
...
@@ -262,6 +289,31 @@ Aig_Man_t * Cec_SignalCorrespondence( Aig_Man_t * pAig, int nConfs, int fUseCSat
...
@@ -262,6 +289,31 @@ Aig_Man_t * Cec_SignalCorrespondence( Aig_Man_t * pAig, int nConfs, int fUseCSat
return
Aig_ManDupSimple
(
pAig
);
return
Aig_ManDupSimple
(
pAig
);
}
}
/**Function*************************************************************
Synopsis [Implementation of fraiging.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
Aig_Man_t
*
Cec_FraigCombinational
(
Aig_Man_t
*
pAig
,
int
nConfs
,
int
fVerbose
)
{
Gia_Man_t
*
pGia
;
Cec_ParFra_t
FraPars
,
*
pFraPars
=
&
FraPars
;
Cec_ManFraSetDefaultParams
(
pFraPars
);
pFraPars
->
nBTLimit
=
nConfs
;
pFraPars
->
nItersMax
=
20
;
pFraPars
->
fVerbose
=
fVerbose
;
pGia
=
Gia_ManFromAigSimple
(
pAig
);
Cec_ManSatSweeping
(
pGia
,
pFraPars
);
Gia_ManReprToAigRepr
(
pAig
,
pGia
);
Gia_ManStop
(
pGia
);
return
Aig_ManDupSimple
(
pAig
);
}
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
/// END OF FILE ///
...
...
src/aig/gia/module.make
View file @
70697f86
...
@@ -9,6 +9,7 @@ SRC += src/aig/gia/gia.c \
...
@@ -9,6 +9,7 @@ SRC += src/aig/gia/gia.c \
src/aig/gia/giaEmbed.c
\
src/aig/gia/giaEmbed.c
\
src/aig/gia/giaEnable.c
\
src/aig/gia/giaEnable.c
\
src/aig/gia/giaEquiv.c
\
src/aig/gia/giaEquiv.c
\
src/aig/gia/giaEra.c
\
src/aig/gia/giaFanout.c
\
src/aig/gia/giaFanout.c
\
src/aig/gia/giaForce.c
\
src/aig/gia/giaForce.c
\
src/aig/gia/giaFrames.c
\
src/aig/gia/giaFrames.c
\
...
...
src/aig/ntl/ntl.h
View file @
70697f86
...
@@ -309,7 +309,7 @@ extern ABC_DLL Aig_Man_t * Ntl_ManPrepareSec( char * pFileName1, char * pFil
...
@@ -309,7 +309,7 @@ extern ABC_DLL Aig_Man_t * Ntl_ManPrepareSec( char * pFileName1, char * pFil
extern
ABC_DLL
Aig_Man_t
*
Ntl_ManExtract
(
Ntl_Man_t
*
p
);
extern
ABC_DLL
Aig_Man_t
*
Ntl_ManExtract
(
Ntl_Man_t
*
p
);
extern
ABC_DLL
Aig_Man_t
*
Ntl_ManCollapse
(
Ntl_Man_t
*
p
,
int
fSeq
);
extern
ABC_DLL
Aig_Man_t
*
Ntl_ManCollapse
(
Ntl_Man_t
*
p
,
int
fSeq
);
extern
ABC_DLL
Aig_Man_t
*
Ntl_ManCollapseComb
(
Ntl_Man_t
*
p
);
extern
ABC_DLL
Aig_Man_t
*
Ntl_ManCollapseComb
(
Ntl_Man_t
*
p
);
extern
ABC_DLL
Aig_Man_t
*
Ntl_ManCollapseSeq
(
Ntl_Man_t
*
p
,
int
nMinDomSize
);
extern
ABC_DLL
Aig_Man_t
*
Ntl_ManCollapseSeq
(
Ntl_Man_t
*
p
,
int
nMinDomSize
,
int
fVerbose
);
extern
ABC_DLL
Nwk_Man_t
*
Ntl_ManExtractNwk
(
Ntl_Man_t
*
p
,
Aig_Man_t
*
pAig
,
Tim_Man_t
*
pManTime
);
extern
ABC_DLL
Nwk_Man_t
*
Ntl_ManExtractNwk
(
Ntl_Man_t
*
p
,
Aig_Man_t
*
pAig
,
Tim_Man_t
*
pManTime
);
/*=== ntlInsert.c ==========================================================*/
/*=== ntlInsert.c ==========================================================*/
extern
ABC_DLL
Ntl_Man_t
*
Ntl_ManInsertMapping
(
Ntl_Man_t
*
p
,
Vec_Ptr_t
*
vMapping
,
Aig_Man_t
*
pAig
);
extern
ABC_DLL
Ntl_Man_t
*
Ntl_ManInsertMapping
(
Ntl_Man_t
*
p
,
Vec_Ptr_t
*
vMapping
,
Aig_Man_t
*
pAig
);
...
@@ -354,6 +354,7 @@ extern ABC_DLL char * Ntl_ManStoreFileName( Ntl_Man_t * p, char * pFile
...
@@ -354,6 +354,7 @@ extern ABC_DLL char * Ntl_ManStoreFileName( Ntl_Man_t * p, char * pFile
extern
ABC_DLL
int
Ntl_ManSweep
(
Ntl_Man_t
*
p
,
int
fVerbose
);
extern
ABC_DLL
int
Ntl_ManSweep
(
Ntl_Man_t
*
p
,
int
fVerbose
);
/*=== ntlTable.c ==========================================================*/
/*=== ntlTable.c ==========================================================*/
extern
ABC_DLL
Ntl_Net_t
*
Ntl_ModelFindNet
(
Ntl_Mod_t
*
p
,
const
char
*
pName
);
extern
ABC_DLL
Ntl_Net_t
*
Ntl_ModelFindNet
(
Ntl_Mod_t
*
p
,
const
char
*
pName
);
extern
ABC_DLL
char
*
Ntl_ModelCreateNetName
(
Ntl_Mod_t
*
p
,
const
char
*
pName
,
int
Num
);
extern
ABC_DLL
Ntl_Net_t
*
Ntl_ModelFindOrCreateNet
(
Ntl_Mod_t
*
p
,
const
char
*
pName
);
extern
ABC_DLL
Ntl_Net_t
*
Ntl_ModelFindOrCreateNet
(
Ntl_Mod_t
*
p
,
const
char
*
pName
);
extern
ABC_DLL
Ntl_Net_t
*
Ntl_ModelDontFindCreateNet
(
Ntl_Mod_t
*
p
,
const
char
*
pName
);
extern
ABC_DLL
Ntl_Net_t
*
Ntl_ModelDontFindCreateNet
(
Ntl_Mod_t
*
p
,
const
char
*
pName
);
extern
ABC_DLL
void
Ntl_ModelSetPioNumbers
(
Ntl_Mod_t
*
p
);
extern
ABC_DLL
void
Ntl_ModelSetPioNumbers
(
Ntl_Mod_t
*
p
);
...
...
src/aig/ntl/ntlExtract.c
View file @
70697f86
...
@@ -623,7 +623,7 @@ Aig_Man_t * Ntl_ManCollapseComb( Ntl_Man_t * p )
...
@@ -623,7 +623,7 @@ Aig_Man_t * Ntl_ManCollapseComb( Ntl_Man_t * p )
SeeAlso []
SeeAlso []
***********************************************************************/
***********************************************************************/
Aig_Man_t
*
Ntl_ManCollapseSeq
(
Ntl_Man_t
*
p
,
int
nMinDomSize
)
Aig_Man_t
*
Ntl_ManCollapseSeq
(
Ntl_Man_t
*
p
,
int
nMinDomSize
,
int
fVerbose
)
{
{
Aig_Man_t
*
pAig
;
Aig_Man_t
*
pAig
;
Ntl_Mod_t
*
pRoot
;
Ntl_Mod_t
*
pRoot
;
...
@@ -645,7 +645,7 @@ Aig_Man_t * Ntl_ManCollapseSeq( Ntl_Man_t * p, int nMinDomSize )
...
@@ -645,7 +645,7 @@ Aig_Man_t * Ntl_ManCollapseSeq( Ntl_Man_t * p, int nMinDomSize )
// perform the traversal
// perform the traversal
pAig
=
Ntl_ManCollapse
(
p
,
1
);
pAig
=
Ntl_ManCollapse
(
p
,
1
);
// check if there are register classes
// check if there are register classes
pAig
->
vClockDoms
=
Ntl_ManTransformRegClasses
(
p
,
nMinDomSize
,
1
);
pAig
->
vClockDoms
=
Ntl_ManTransformRegClasses
(
p
,
nMinDomSize
,
fVerbose
);
if
(
pAig
->
vClockDoms
)
if
(
pAig
->
vClockDoms
)
{
{
if
(
Vec_VecSize
(
pAig
->
vClockDoms
)
==
0
)
if
(
Vec_VecSize
(
pAig
->
vClockDoms
)
==
0
)
...
@@ -654,9 +654,10 @@ Aig_Man_t * Ntl_ManCollapseSeq( Ntl_Man_t * p, int nMinDomSize )
...
@@ -654,9 +654,10 @@ Aig_Man_t * Ntl_ManCollapseSeq( Ntl_Man_t * p, int nMinDomSize )
Aig_ManStop
(
pAig
);
Aig_ManStop
(
pAig
);
pAig
=
NULL
;
pAig
=
NULL
;
}
}
else
else
if
(
fVerbose
)
printf
(
"Performing seq synthesis for %d register classes.
\n
"
,
Vec_VecSize
(
pAig
->
vClockDoms
)
);
printf
(
"Performing seq synthesis for %d register classes.
\n
"
,
Vec_VecSize
(
pAig
->
vClockDoms
)
);
printf
(
"
\n
"
);
if
(
fVerbose
)
printf
(
"
\n
"
);
}
}
return
pAig
;
return
pAig
;
}
}
...
@@ -706,7 +707,7 @@ Nwk_Obj_t * Ntl_ManExtractNwk_rec( Ntl_Man_t * p, Ntl_Net_t * pNet, Nwk_Man_t *
...
@@ -706,7 +707,7 @@ Nwk_Obj_t * Ntl_ManExtractNwk_rec( Ntl_Man_t * p, Ntl_Net_t * pNet, Nwk_Man_t *
Ntl_ManExtractNwk_rec
(
p
,
pFaninNet
,
pNtk
,
vCover
,
vMemory
);
Ntl_ManExtractNwk_rec
(
p
,
pFaninNet
,
pNtk
,
vCover
,
vMemory
);
Nwk_ObjAddFanin
(
pNode
,
pFaninNet
->
pCopy2
);
Nwk_ObjAddFanin
(
pNode
,
pFaninNet
->
pCopy2
);
}
}
if
(
Ntl_ObjFaninNum
(
pNet
->
pDriver
)
==
0
)
if
(
Ntl_ObjFaninNum
(
pNet
->
pDriver
)
==
0
||
Kit_PlaGetVarNum
(
pNet
->
pDriver
->
pSop
)
==
0
)
pNode
->
pFunc
=
Hop_NotCond
(
Hop_ManConst1
(
pNtk
->
pManHop
),
Kit_PlaIsConst0
(
pNet
->
pDriver
->
pSop
)
);
pNode
->
pFunc
=
Hop_NotCond
(
Hop_ManConst1
(
pNtk
->
pManHop
),
Kit_PlaIsConst0
(
pNet
->
pDriver
->
pSop
)
);
else
else
{
{
...
...
src/aig/ntl/ntlFraig.c
View file @
70697f86
...
@@ -219,6 +219,8 @@ void Ntl_ManReduce( Ntl_Man_t * p, Aig_Man_t * pAig )
...
@@ -219,6 +219,8 @@ void Ntl_ManReduce( Ntl_Man_t * p, Aig_Man_t * pAig )
Ntl_Mod_t
*
pRoot
;
Ntl_Mod_t
*
pRoot
;
Ntl_Obj_t
*
pNode
,
*
pNodeOld
;
Ntl_Obj_t
*
pNode
,
*
pNodeOld
;
int
i
,
fCompl
,
Counter
=
0
;
int
i
,
fCompl
,
Counter
=
0
;
char
*
pNameNew
;
// int Lenght;
assert
(
pAig
->
pReprs
);
assert
(
pAig
->
pReprs
);
pRoot
=
Ntl_ManRootModel
(
p
);
pRoot
=
Ntl_ManRootModel
(
p
);
Aig_ManForEachObj
(
pAig
,
pObj
,
i
)
Aig_ManForEachObj
(
pAig
,
pObj
,
i
)
...
@@ -276,13 +278,17 @@ void Ntl_ManReduce( Ntl_Man_t * p, Aig_Man_t * pAig )
...
@@ -276,13 +278,17 @@ void Ntl_ManReduce( Ntl_Man_t * p, Aig_Man_t * pAig )
printf
(
"Ntl_ManReduce(): Internal error! Net already has no driver.
\n
"
);
printf
(
"Ntl_ManReduce(): Internal error! Net already has no driver.
\n
"
);
if
(
!
Ntl_ModelSetNetDriver
(
pNode
,
pNet
)
)
if
(
!
Ntl_ModelSetNetDriver
(
pNode
,
pNet
)
)
printf
(
"Ntl_ManReduce(): Internal error! Net already has a driver.
\n
"
);
printf
(
"Ntl_ManReduce(): Internal error! Net already has a driver.
\n
"
);
/*
// remove this net from the hash table (but do not remove from the array)
// remove this net from the hash table (but do not remove from the array)
Ntl_ModelDeleteNet( pRoot, pNet );
Ntl_ModelDeleteNet( pRoot, pNet );
// create new net with the same name
// create new net with the same name
pNetNew = Ntl_ModelFindOrCreateNet( pRoot, pNet->pName );
pNetNew = Ntl_ModelFindOrCreateNet( pRoot, pNet->pName );
// clean the name
// clean the name
pNet->pName[0] = 0;
pNet->pName[0] = 0;
*/
// create new net with a new name
pNameNew
=
Ntl_ModelCreateNetName
(
pRoot
,
"noname"
,
(
int
)(
ABC_PTRINT_T
)
pNet
);
pNetNew
=
Ntl_ModelFindOrCreateNet
(
pRoot
,
pNameNew
);
// make the old node drive the new net without fanouts
// make the old node drive the new net without fanouts
if
(
!
Ntl_ModelSetNetDriver
(
pNodeOld
,
pNetNew
)
)
if
(
!
Ntl_ModelSetNetDriver
(
pNodeOld
,
pNetNew
)
)
...
@@ -290,6 +296,7 @@ void Ntl_ManReduce( Ntl_Man_t * p, Aig_Man_t * pAig )
...
@@ -290,6 +296,7 @@ void Ntl_ManReduce( Ntl_Man_t * p, Aig_Man_t * pAig )
Counter
++
;
Counter
++
;
}
}
// printf( "Nets without names = %d.\n", Counter );
}
}
/**Function*************************************************************
/**Function*************************************************************
...
@@ -373,7 +380,7 @@ if ( fVerbose )
...
@@ -373,7 +380,7 @@ if ( fVerbose )
SeeAlso []
SeeAlso []
***********************************************************************/
***********************************************************************/
Ntl_Man_t
*
Ntl_ManFraig
(
Ntl_Man_t
*
p
,
int
nPartSize
,
int
nConfLimit
,
int
nLevelMax
,
int
fVerbose
)
Ntl_Man_t
*
Ntl_ManFraig
(
Ntl_Man_t
*
p
,
int
nPartSize
,
int
nConfLimit
,
int
nLevelMax
,
int
f
UseCSat
,
int
f
Verbose
)
{
{
Ntl_Man_t
*
pNew
,
*
pAux
;
Ntl_Man_t
*
pNew
,
*
pAux
;
Aig_Man_t
*
pAig
,
*
pAigCol
,
*
pTemp
;
Aig_Man_t
*
pAig
,
*
pAigCol
,
*
pTemp
;
...
@@ -392,9 +399,19 @@ Ntl_Man_t * Ntl_ManFraig( Ntl_Man_t * p, int nPartSize, int nConfLimit, int nLev
...
@@ -392,9 +399,19 @@ Ntl_Man_t * Ntl_ManFraig( Ntl_Man_t * p, int nPartSize, int nConfLimit, int nLev
}
}
// perform fraiging for the given design
// perform fraiging for the given design
nPartSize
=
nPartSize
?
nPartSize
:
Aig_ManPoNum
(
pAigCol
);
// if ( fUseCSat )
pTemp
=
Aig_ManFraigPartitioned
(
pAigCol
,
nPartSize
,
nConfLimit
,
nLevelMax
,
fVerbose
);
if
(
0
)
Aig_ManStop
(
pTemp
);
{
extern
Aig_Man_t
*
Cec_FraigCombinational
(
Aig_Man_t
*
pAig
,
int
nConfs
,
int
fVerbose
);
pTemp
=
Cec_FraigCombinational
(
pAigCol
,
nConfLimit
,
fVerbose
);
Aig_ManStop
(
pTemp
);
}
else
{
nPartSize
=
nPartSize
?
nPartSize
:
Aig_ManPoNum
(
pAigCol
);
pTemp
=
Aig_ManFraigPartitioned
(
pAigCol
,
nPartSize
,
nConfLimit
,
nLevelMax
,
fVerbose
);
Aig_ManStop
(
pTemp
);
}
// finalize the transformation
// finalize the transformation
pNew
=
Ntl_ManFinalize
(
pAux
=
pNew
,
pAig
,
pAigCol
,
fVerbose
);
pNew
=
Ntl_ManFinalize
(
pAux
=
pNew
,
pAig
,
pAigCol
,
fVerbose
);
...
@@ -425,7 +442,7 @@ Ntl_Man_t * Ntl_ManScl( Ntl_Man_t * p, int fLatchConst, int fLatchEqual, int fVe
...
@@ -425,7 +442,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
);
pAigCol
=
Ntl_ManCollapseSeq
(
pNew
,
0
);
pAigCol
=
Ntl_ManCollapseSeq
(
pNew
,
0
,
fVerbose
);
if
(
pAigCol
==
NULL
)
if
(
pAigCol
==
NULL
)
{
{
Aig_ManStop
(
pAig
);
Aig_ManStop
(
pAig
);
...
@@ -457,7 +474,7 @@ Ntl_Man_t * Ntl_ManScl( Ntl_Man_t * p, int fLatchConst, int fLatchEqual, int fVe
...
@@ -457,7 +474,7 @@ Ntl_Man_t * Ntl_ManScl( Ntl_Man_t * p, int fLatchConst, int fLatchEqual, int fVe
SeeAlso []
SeeAlso []
***********************************************************************/
***********************************************************************/
Ntl_Man_t
*
Ntl_ManLcorr
(
Ntl_Man_t
*
p
,
int
nConfMax
,
int
fVerbose
)
Ntl_Man_t
*
Ntl_ManLcorr
(
Ntl_Man_t
*
p
,
int
nConfMax
,
int
f
ScorrGia
,
int
fUseCSat
,
int
f
Verbose
)
{
{
Ntl_Man_t
*
pNew
,
*
pAux
;
Ntl_Man_t
*
pNew
,
*
pAux
;
Aig_Man_t
*
pAig
,
*
pAigCol
,
*
pTemp
;
Aig_Man_t
*
pAig
,
*
pAigCol
,
*
pTemp
;
...
@@ -469,7 +486,7 @@ Ntl_Man_t * Ntl_ManLcorr( Ntl_Man_t * p, int nConfMax, int fVerbose )
...
@@ -469,7 +486,7 @@ Ntl_Man_t * Ntl_ManLcorr( Ntl_Man_t * p, int nConfMax, int fVerbose )
// collapse the AIG
// collapse the AIG
pAig
=
Ntl_ManExtract
(
p
);
pAig
=
Ntl_ManExtract
(
p
);
pNew
=
Ntl_ManInsertAig
(
p
,
pAig
);
pNew
=
Ntl_ManInsertAig
(
p
,
pAig
);
pAigCol
=
Ntl_ManCollapseSeq
(
pNew
,
pPars
->
nMinDomSize
);
pAigCol
=
Ntl_ManCollapseSeq
(
pNew
,
pPars
->
nMinDomSize
,
pPars
->
fVerbose
);
if
(
pAigCol
==
NULL
)
if
(
pAigCol
==
NULL
)
{
{
Aig_ManStop
(
pAig
);
Aig_ManStop
(
pAig
);
...
@@ -477,6 +494,8 @@ Ntl_Man_t * Ntl_ManLcorr( Ntl_Man_t * p, int nConfMax, int fVerbose )
...
@@ -477,6 +494,8 @@ Ntl_Man_t * Ntl_ManLcorr( Ntl_Man_t * p, int nConfMax, int fVerbose )
}
}
// perform LCORR for the given design
// perform LCORR for the given design
pPars
->
fScorrGia
=
fScorrGia
;
pPars
->
fUseCSat
=
fUseCSat
;
pTemp
=
Ssw_LatchCorrespondence
(
pAigCol
,
pPars
);
pTemp
=
Ssw_LatchCorrespondence
(
pAigCol
,
pPars
);
Aig_ManStop
(
pTemp
);
Aig_ManStop
(
pTemp
);
...
@@ -507,7 +526,7 @@ Ntl_Man_t * Ntl_ManSsw( Ntl_Man_t * p, Fra_Ssw_t * pPars )
...
@@ -507,7 +526,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
);
pAigCol
=
Ntl_ManCollapseSeq
(
pNew
,
pPars
->
nMinDomSize
);
pAigCol
=
Ntl_ManCollapseSeq
(
pNew
,
pPars
->
nMinDomSize
,
pPars
->
fVerbose
);
if
(
pAigCol
==
NULL
)
if
(
pAigCol
==
NULL
)
{
{
Aig_ManStop
(
pAig
);
Aig_ManStop
(
pAig
);
...
@@ -545,7 +564,7 @@ Ntl_Man_t * Ntl_ManScorr( Ntl_Man_t * p, Ssw_Pars_t * pPars )
...
@@ -545,7 +564,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
);
pAigCol
=
Ntl_ManCollapseSeq
(
pNew
,
pPars
->
nMinDomSize
);
pAigCol
=
Ntl_ManCollapseSeq
(
pNew
,
pPars
->
nMinDomSize
,
pPars
->
fVerbose
);
if
(
pAigCol
==
NULL
)
if
(
pAigCol
==
NULL
)
{
{
Aig_ManStop
(
pAig
);
Aig_ManStop
(
pAig
);
...
@@ -724,7 +743,7 @@ Ntl_Man_t * Ntl_ManSsw2( Ntl_Man_t * p, Fra_Ssw_t * pPars )
...
@@ -724,7 +743,7 @@ Ntl_Man_t * Ntl_ManSsw2( Ntl_Man_t * p, Fra_Ssw_t * pPars )
Ntl_Man_t
*
pNew
;
Ntl_Man_t
*
pNew
;
Aig_Man_t
*
pAigRed
,
*
pAigCol
;
Aig_Man_t
*
pAigRed
,
*
pAigCol
;
// collapse the AIG
// collapse the AIG
pAigCol
=
Ntl_ManCollapseSeq
(
p
,
pPars
->
nMinDomSize
);
pAigCol
=
Ntl_ManCollapseSeq
(
p
,
pPars
->
nMinDomSize
,
pPars
->
fVerbose
);
// transform the collapsed AIG
// transform the collapsed AIG
pAigRed
=
Fra_FraigInduction
(
pAigCol
,
pPars
);
pAigRed
=
Fra_FraigInduction
(
pAigCol
,
pPars
);
Aig_ManStop
(
pAigRed
);
Aig_ManStop
(
pAigRed
);
...
...
src/aig/ntl/ntlMan.c
View file @
70697f86
...
@@ -285,6 +285,88 @@ void Nwk_ManPrintStatsShort( Ntl_Man_t * p, Aig_Man_t * pAig, Nwk_Man_t * pNtk )
...
@@ -285,6 +285,88 @@ void Nwk_ManPrintStatsShort( Ntl_Man_t * p, Aig_Man_t * pAig, Nwk_Man_t * pNtk )
/**Function*************************************************************
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int
Nwk_ManStatsRegs
(
Ntl_Man_t
*
p
)
{
Ntl_Mod_t
*
pRoot
;
Ntl_Obj_t
*
pObj
;
int
i
,
Counter
=
0
;
pRoot
=
Ntl_ManRootModel
(
p
);
Ntl_ModelForEachBox
(
pRoot
,
pObj
,
i
)
if
(
strcmp
(
pObj
->
pImplem
->
pName
,
"dff"
)
==
0
)
Counter
++
;
return
Counter
;
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int
Nwk_ManStatsLuts
(
Nwk_Man_t
*
pNtk
)
{
return
pNtk
?
Nwk_ManNodeNum
(
pNtk
)
:
-
1
;
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int
Nwk_ManStatsLevs
(
Nwk_Man_t
*
pNtk
)
{
return
pNtk
?
Nwk_ManLevel
(
pNtk
)
:
-
1
;
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void
Nwk_ManPrintStatsUpdate
(
Ntl_Man_t
*
p
,
Aig_Man_t
*
pAig
,
Nwk_Man_t
*
pNtk
,
int
nRegInit
,
int
nLutInit
,
int
nLevInit
,
int
Time
)
{
printf
(
"FF =%7d (%4.1f%%) "
,
Nwk_ManStatsRegs
(
p
),
100
.
0
*
(
nRegInit
-
Nwk_ManStatsRegs
(
p
))
/
nRegInit
);
if
(
pNtk
==
NULL
)
printf
(
"Mapping is not available. "
);
else
{
printf
(
"Lut =%7d (%4.1f%%) "
,
Nwk_ManStatsLuts
(
pNtk
),
100
.
0
*
(
nLutInit
-
Nwk_ManStatsLuts
(
pNtk
))
/
nLutInit
);
printf
(
"Lev =%4d (%4.1f%%) "
,
Nwk_ManStatsLevs
(
pNtk
),
100
.
0
*
(
nLevInit
-
Nwk_ManStatsLevs
(
pNtk
))
/
nLevInit
);
}
ABC_PRT
(
"Time"
,
clock
()
-
Time
);
}
/**Function*************************************************************
Synopsis [Deallocates the netlist manager.]
Synopsis [Deallocates the netlist manager.]
Description []
Description []
...
...
src/aig/ntl/ntlTable.c
View file @
70697f86
...
@@ -65,6 +65,30 @@ Ntl_Net_t * Ntl_ModelCreateNet( Ntl_Mod_t * p, const char * pName )
...
@@ -65,6 +65,30 @@ Ntl_Net_t * Ntl_ModelCreateNet( Ntl_Mod_t * p, const char * pName )
/**Function*************************************************************
/**Function*************************************************************
Synopsis [Allocates memory for the net.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
char
*
Ntl_ModelCreateNetName
(
Ntl_Mod_t
*
p
,
const
char
*
pName
,
int
Num
)
{
char
*
pResult
;
char
Buffer
[
1000
];
assert
(
strlen
(
pName
)
<
900
);
do
{
sprintf
(
Buffer
,
"%s%d"
,
pName
,
Num
++
);
}
while
(
Ntl_ModelFindNet
(
p
,
Buffer
)
!=
NULL
);
pResult
=
(
char
*
)
Aig_MmFlexEntryFetch
(
p
->
pMan
->
pMemObjs
,
strlen
(
Buffer
)
+
1
);
strcpy
(
pResult
,
Buffer
);
return
pResult
;
}
/**Function*************************************************************
Synopsis [Resizes the table.]
Synopsis [Resizes the table.]
Description []
Description []
...
...
src/aig/ntl/ntlWriteBlif.c
View file @
70697f86
...
@@ -631,7 +631,7 @@ void Ioa_WriteBlif( Ntl_Man_t * p, char * pFileName )
...
@@ -631,7 +631,7 @@ void Ioa_WriteBlif( Ntl_Man_t * p, char * pFileName )
Ntl_Mod_t
*
pModel
;
Ntl_Mod_t
*
pModel
;
int
i
,
bzError
;
int
i
,
bzError
;
bz2file
b
;
bz2file
b
;
if
(
p
->
pNal
)
if
(
p
->
pNal
&&
strncmp
(
pFileName
+
strlen
(
pFileName
)
-
5
,
".blif"
,
5
)
)
{
{
p
->
pNalW
(
p
,
pFileName
);
p
->
pNalW
(
p
,
pFileName
);
return
;
return
;
...
...
src/aig/nwk/nwkUtil.c
View file @
70697f86
...
@@ -518,21 +518,9 @@ void Nwk_ManMinimumBase( Nwk_Man_t * pNtk, int fVerbose )
...
@@ -518,21 +518,9 @@ void Nwk_ManMinimumBase( Nwk_Man_t * pNtk, int fVerbose )
Vec_Int_t
*
vTruth
;
Vec_Int_t
*
vTruth
;
Nwk_Obj_t
*
pObj
;
Nwk_Obj_t
*
pObj
;
int
i
,
Counter
=
0
;
int
i
,
Counter
=
0
;
Nwk_Obj_t
*
pNodeThis
=
pNtk
->
vObjs
->
pArray
[
72688
];
vTruth
=
Vec_IntAlloc
(
1
<<
16
);
vTruth
=
Vec_IntAlloc
(
1
<<
16
);
Nwk_ManForEachNode
(
pNtk
,
pObj
,
i
)
Nwk_ManForEachNode
(
pNtk
,
pObj
,
i
)
{
if
(
i
==
641386
)
{
int
x
=
0
;
}
Counter
+=
Nwk_ManMinimumBaseNode
(
pObj
,
vTruth
,
fVerbose
);
Counter
+=
Nwk_ManMinimumBaseNode
(
pObj
,
vTruth
,
fVerbose
);
if
(
pNodeThis
->
nFanouts
!=
15
)
{
int
s
=
0
;
}
}
if
(
fVerbose
&&
Counter
)
if
(
fVerbose
&&
Counter
)
printf
(
"Support minimization reduced support of %d nodes.
\n
"
,
Counter
);
printf
(
"Support minimization reduced support of %d nodes.
\n
"
,
Counter
);
Vec_IntFree
(
vTruth
);
Vec_IntFree
(
vTruth
);
...
...
src/aig/ssw/sswCore.c
View file @
70697f86
...
@@ -280,8 +280,16 @@ Aig_Man_t * Ssw_SignalCorrespondence( Aig_Man_t * pAig, Ssw_Pars_t * pPars )
...
@@ -280,8 +280,16 @@ Aig_Man_t * Ssw_SignalCorrespondence( Aig_Man_t * pAig, Ssw_Pars_t * pPars )
if
(
pPars
->
fScorrGia
)
if
(
pPars
->
fScorrGia
)
{
{
extern
Aig_Man_t
*
Cec_SignalCorrespondence
(
Aig_Man_t
*
pAig
,
int
nConfs
,
int
fUseCSat
);
if
(
pPars
->
fLatchCorrOpt
)
return
Cec_SignalCorrespondence
(
pAig
,
pPars
->
nBTLimit
,
pPars
->
fUseCSat
);
{
extern
Aig_Man_t
*
Cec_LatchCorrespondence
(
Aig_Man_t
*
pAig
,
int
nConfs
,
int
fUseCSat
);
return
Cec_LatchCorrespondence
(
pAig
,
pPars
->
nBTLimit
,
pPars
->
fUseCSat
);
}
else
{
extern
Aig_Man_t
*
Cec_SignalCorrespondence
(
Aig_Man_t
*
pAig
,
int
nConfs
,
int
fUseCSat
);
return
Cec_SignalCorrespondence
(
pAig
,
pPars
->
nBTLimit
,
pPars
->
fUseCSat
);
}
}
}
// start the induction manager
// start the induction manager
...
...
src/base/abc/abcLib.c
View file @
70697f86
...
@@ -82,7 +82,7 @@ void Abc_LibFree( Abc_Lib_t * pLib, Abc_Ntk_t * pNtkSave )
...
@@ -82,7 +82,7 @@ void Abc_LibFree( Abc_Lib_t * pLib, Abc_Ntk_t * pNtkSave )
continue
;
continue
;
// pNtk->pManFunc = NULL;
// pNtk->pManFunc = NULL;
pNtk
->
pDesign
=
NULL
;
pNtk
->
pDesign
=
NULL
;
if
(
pNtk
->
pManFunc
==
pNtkSave
->
pManFunc
)
if
(
pNtk
Save
&&
pNtk
->
pManFunc
==
pNtkSave
->
pManFunc
)
pNtk
->
pManFunc
=
NULL
;
pNtk
->
pManFunc
=
NULL
;
Abc_NtkDelete
(
pNtk
);
Abc_NtkDelete
(
pNtk
);
}
}
...
...
src/base/abci/abc.c
View file @
70697f86
This diff is collapsed.
Click to expand it.
src/base/abci/abcXsim.c
View file @
70697f86
...
@@ -20,6 +20,8 @@
...
@@ -20,6 +20,8 @@
#include "abc.h"
#include "abc.h"
extern
unsigned
Gia_ManRandom
(
int
fReset
);
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
...
@@ -50,13 +52,15 @@ static inline int Abc_XsimAnd( int Value0, int Value1 )
...
@@ -50,13 +52,15 @@ static inline int Abc_XsimAnd( int Value0, int Value1 )
}
}
static
inline
int
Abc_XsimRand2
()
static
inline
int
Abc_XsimRand2
()
{
{
return
(
rand
()
&
1
)
?
XVS1
:
XVS0
;
// return (rand() & 1) ? XVS1 : XVS0;
return
(
Gia_ManRandom
(
0
)
&
1
)
?
XVS1
:
XVS0
;
}
}
static
inline
int
Abc_XsimRand3
()
static
inline
int
Abc_XsimRand3
()
{
{
int
RetValue
;
int
RetValue
;
do
{
do
{
RetValue
=
rand
()
&
3
;
// RetValue = rand() & 3;
RetValue
=
Gia_ManRandom
(
0
)
&
3
;
}
while
(
RetValue
==
0
);
}
while
(
RetValue
==
0
);
return
RetValue
;
return
RetValue
;
}
}
...
@@ -108,7 +112,8 @@ void Abc_NtkXValueSimulate( Abc_Ntk_t * pNtk, int nFrames, int fXInputs, int fXS
...
@@ -108,7 +112,8 @@ void Abc_NtkXValueSimulate( Abc_Ntk_t * pNtk, int nFrames, int fXInputs, int fXS
Abc_Obj_t
*
pObj
;
Abc_Obj_t
*
pObj
;
int
i
,
f
;
int
i
,
f
;
assert
(
Abc_NtkIsStrash
(
pNtk
)
);
assert
(
Abc_NtkIsStrash
(
pNtk
)
);
srand
(
0x12341234
);
// srand( 0x12341234 );
Gia_ManRandom
(
1
);
// start simulation
// start simulation
Abc_ObjSetXsim
(
Abc_AigConst1
(
pNtk
),
XVS1
);
Abc_ObjSetXsim
(
Abc_AigConst1
(
pNtk
),
XVS1
);
if
(
fXInputs
)
if
(
fXInputs
)
...
@@ -194,7 +199,8 @@ void Abc_NtkCycleInitState( Abc_Ntk_t * pNtk, int nFrames, int fUseXval, int fVe
...
@@ -194,7 +199,8 @@ void Abc_NtkCycleInitState( Abc_Ntk_t * pNtk, int nFrames, int fUseXval, int fVe
Abc_Obj_t
*
pObj
;
Abc_Obj_t
*
pObj
;
int
i
,
f
;
int
i
,
f
;
assert
(
Abc_NtkIsStrash
(
pNtk
)
);
assert
(
Abc_NtkIsStrash
(
pNtk
)
);
srand
(
0x12341234
);
// srand( 0x12341234 );
Gia_ManRandom
(
1
);
// initialize the values
// initialize the values
Abc_ObjSetXsim
(
Abc_AigConst1
(
pNtk
),
XVS1
);
Abc_ObjSetXsim
(
Abc_AigConst1
(
pNtk
),
XVS1
);
Abc_NtkForEachLatch
(
pNtk
,
pObj
,
i
)
Abc_NtkForEachLatch
(
pNtk
,
pObj
,
i
)
...
...
src/base/io/io.c
View file @
70697f86
...
@@ -2343,13 +2343,17 @@ int IoCommandWriteTruth( Abc_Frame_t * pAbc, int argc, char **argv )
...
@@ -2343,13 +2343,17 @@ int IoCommandWriteTruth( Abc_Frame_t * pAbc, int argc, char **argv )
char
*
pFileName
;
char
*
pFileName
;
FILE
*
pFile
;
FILE
*
pFile
;
unsigned
*
pTruth
;
unsigned
*
pTruth
;
int
fReverse
=
0
;
int
c
;
int
c
;
Extra_UtilGetoptReset
();
Extra_UtilGetoptReset
();
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"h"
)
)
!=
EOF
)
while
(
(
c
=
Extra_UtilGetopt
(
argc
,
argv
,
"
r
h"
)
)
!=
EOF
)
{
{
switch
(
c
)
switch
(
c
)
{
{
case
'r'
:
fReverse
^=
1
;
break
;
case
'h'
:
case
'h'
:
goto
usage
;
goto
usage
;
default:
default:
...
@@ -2394,7 +2398,7 @@ int IoCommandWriteTruth( Abc_Frame_t * pAbc, int argc, char **argv )
...
@@ -2394,7 +2398,7 @@ int IoCommandWriteTruth( Abc_Frame_t * pAbc, int argc, char **argv )
// convert to logic
// convert to logic
Abc_NtkToAig
(
pNtk
);
Abc_NtkToAig
(
pNtk
);
vTruth
=
Vec_IntAlloc
(
0
);
vTruth
=
Vec_IntAlloc
(
0
);
pTruth
=
Hop_ManConvertAigToTruth
(
pNtk
->
pManFunc
,
pNode
->
pData
,
Abc_ObjFaninNum
(
pNode
),
vTruth
,
0
);
pTruth
=
Hop_ManConvertAigToTruth
(
pNtk
->
pManFunc
,
pNode
->
pData
,
Abc_ObjFaninNum
(
pNode
),
vTruth
,
fReverse
);
pFile
=
fopen
(
pFileName
,
"w"
);
pFile
=
fopen
(
pFileName
,
"w"
);
if
(
pFile
==
NULL
)
if
(
pFile
==
NULL
)
{
{
...
@@ -2408,8 +2412,9 @@ int IoCommandWriteTruth( Abc_Frame_t * pAbc, int argc, char **argv )
...
@@ -2408,8 +2412,9 @@ int IoCommandWriteTruth( Abc_Frame_t * pAbc, int argc, char **argv )
return
0
;
return
0
;
usage:
usage:
fprintf
(
pAbc
->
Err
,
"usage: write_truth [-h] <file>
\n
"
);
fprintf
(
pAbc
->
Err
,
"usage: write_truth [-
r
h] <file>
\n
"
);
fprintf
(
pAbc
->
Err
,
"
\t
writes truth table into a file
\n
"
);
fprintf
(
pAbc
->
Err
,
"
\t
writes truth table into a file
\n
"
);
fprintf
(
pAbc
->
Err
,
"
\t
-r : toggle reversing bits in the truth table [default = %s]
\n
"
,
fReverse
?
"yes"
:
"no"
);
fprintf
(
pAbc
->
Err
,
"
\t
-h : print the help massage
\n
"
);
fprintf
(
pAbc
->
Err
,
"
\t
-h : print the help massage
\n
"
);
fprintf
(
pAbc
->
Err
,
"
\t
file : the name of the file to write
\n
"
);
fprintf
(
pAbc
->
Err
,
"
\t
file : the name of the file to write
\n
"
);
return
1
;
return
1
;
...
...
src/base/io/ioReadBlif.c
View file @
70697f86
...
@@ -535,6 +535,71 @@ int Io_ReadBlifNetworkNames( Io_ReadBlif_t * p, Vec_Ptr_t ** pvTokens )
...
@@ -535,6 +535,71 @@ int Io_ReadBlifNetworkNames( Io_ReadBlif_t * p, Vec_Ptr_t ** pvTokens )
SeeAlso []
SeeAlso []
***********************************************************************/
***********************************************************************/
int
Io_ReadBlifReorderFormalNames
(
Vec_Ptr_t
*
vTokens
,
Mio_Gate_t
*
pGate
)
{
Mio_Pin_t
*
pGatePin
;
char
*
pName
,
*
pNamePin
;
int
i
,
k
,
nSize
,
Length
;
nSize
=
Vec_PtrSize
(
vTokens
);
if
(
nSize
-
3
!=
Mio_GateReadInputs
(
pGate
)
)
return
0
;
// check if the names are in order
for
(
pGatePin
=
Mio_GateReadPins
(
pGate
),
i
=
0
;
pGatePin
;
pGatePin
=
Mio_PinReadNext
(
pGatePin
),
i
++
)
{
pNamePin
=
Mio_PinReadName
(
pGatePin
);
Length
=
strlen
(
pNamePin
);
pName
=
Vec_PtrEntry
(
vTokens
,
i
+
2
);
if
(
!
strncmp
(
pNamePin
,
pName
,
Length
)
&&
pName
[
Length
]
==
'='
)
continue
;
break
;
}
if
(
i
==
nSize
-
3
)
return
1
;
// reorder the pins
for
(
pGatePin
=
Mio_GateReadPins
(
pGate
),
i
=
0
;
pGatePin
;
pGatePin
=
Mio_PinReadNext
(
pGatePin
),
i
++
)
{
pNamePin
=
Mio_PinReadName
(
pGatePin
);
Length
=
strlen
(
pNamePin
);
for
(
k
=
2
;
k
<
nSize
;
k
++
)
{
pName
=
Vec_PtrEntry
(
vTokens
,
k
);
if
(
!
strncmp
(
pNamePin
,
pName
,
Length
)
&&
pName
[
Length
]
==
'='
)
{
Vec_PtrPush
(
vTokens
,
pName
);
break
;
}
}
}
pNamePin
=
Mio_GateReadOutName
(
pGate
);
Length
=
strlen
(
pNamePin
);
for
(
k
=
2
;
k
<
nSize
;
k
++
)
{
pName
=
Vec_PtrEntry
(
vTokens
,
k
);
if
(
!
strncmp
(
pNamePin
,
pName
,
Length
)
&&
pName
[
Length
]
==
'='
)
{
Vec_PtrPush
(
vTokens
,
pName
);
break
;
}
}
if
(
Vec_PtrSize
(
vTokens
)
-
nSize
!=
nSize
-
2
)
return
0
;
Vec_PtrForEachEntryStart
(
vTokens
,
pName
,
k
,
nSize
)
Vec_PtrWriteEntry
(
vTokens
,
k
-
nSize
+
2
,
pName
);
Vec_PtrShrink
(
vTokens
,
nSize
);
return
1
;
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int
Io_ReadBlifNetworkGate
(
Io_ReadBlif_t
*
p
,
Vec_Ptr_t
*
vTokens
)
int
Io_ReadBlifNetworkGate
(
Io_ReadBlif_t
*
p
,
Vec_Ptr_t
*
vTokens
)
{
{
Mio_Library_t
*
pGenlib
;
Mio_Library_t
*
pGenlib
;
...
@@ -581,6 +646,16 @@ int Io_ReadBlifNetworkGate( Io_ReadBlif_t * p, Vec_Ptr_t * vTokens )
...
@@ -581,6 +646,16 @@ int Io_ReadBlifNetworkGate( Io_ReadBlif_t * p, Vec_Ptr_t * vTokens )
p
->
pNtkCur
->
pManFunc
=
pGenlib
;
p
->
pNtkCur
->
pManFunc
=
pGenlib
;
}
}
// reorder the formal inputs to be in the same order as in the gate
if
(
!
Io_ReadBlifReorderFormalNames
(
vTokens
,
pGate
)
)
{
p
->
LineCur
=
Extra_FileReaderGetLineNumber
(
p
->
pReader
,
0
);
sprintf
(
p
->
sError
,
"Mismatch in the fanins of gate
\"
%s
\"
."
,
(
char
*
)
vTokens
->
pArray
[
1
]
);
Io_ReadBlifPrintErrorMessage
(
p
);
return
1
;
}
// remove the formal parameter names
// remove the formal parameter names
for
(
i
=
2
;
i
<
vTokens
->
nSize
;
i
++
)
for
(
i
=
2
;
i
<
vTokens
->
nSize
;
i
++
)
{
{
...
...
src/base/io/ioReadBlifMv.c
View file @
70697f86
...
@@ -1828,6 +1828,7 @@ static char * Io_ReadBlifCleanName( char * pName )
...
@@ -1828,6 +1828,7 @@ static char * Io_ReadBlifCleanName( char * pName )
***********************************************************************/
***********************************************************************/
static
int
Io_MvParseLineGateBlif
(
Io_MvMod_t
*
p
,
Vec_Ptr_t
*
vTokens
)
static
int
Io_MvParseLineGateBlif
(
Io_MvMod_t
*
p
,
Vec_Ptr_t
*
vTokens
)
{
{
extern
int
Io_ReadBlifReorderFormalNames
(
Vec_Ptr_t
*
vTokens
,
Mio_Gate_t
*
pGate
);
Mio_Library_t
*
pGenlib
;
Mio_Library_t
*
pGenlib
;
Mio_Gate_t
*
pGate
;
Mio_Gate_t
*
pGate
;
Abc_Obj_t
*
pNode
;
Abc_Obj_t
*
pNode
;
...
@@ -1868,6 +1869,13 @@ static int Io_MvParseLineGateBlif( Io_MvMod_t * p, Vec_Ptr_t * vTokens )
...
@@ -1868,6 +1869,13 @@ static int Io_MvParseLineGateBlif( Io_MvMod_t * p, Vec_Ptr_t * vTokens )
p
->
pNtk
->
pManFunc
=
pGenlib
;
p
->
pNtk
->
pManFunc
=
pGenlib
;
}
}
// reorder the formal inputs to be in the same order as in the gate
if
(
!
Io_ReadBlifReorderFormalNames
(
vTokens
,
pGate
)
)
{
sprintf
(
p
->
pMan
->
sError
,
"Line %d: Mismatch in the fanins of gate
\"
%s
\"
."
,
Io_MvGetLine
(
p
->
pMan
,
pName
),
(
char
*
)
vTokens
->
pArray
[
1
]
);
return
0
;
}
// remove the formal parameter names
// remove the formal parameter names
for
(
i
=
2
;
i
<
vTokens
->
nSize
;
i
++
)
for
(
i
=
2
;
i
<
vTokens
->
nSize
;
i
++
)
{
{
...
...
src/base/main/main.c
View file @
70697f86
...
@@ -310,6 +310,130 @@ static int TypeCheck( Abc_Frame_t * pAbc, char * s )
...
@@ -310,6 +310,130 @@ static int TypeCheck( Abc_Frame_t * pAbc, char * s )
}
}
}
}
/**Function*************************************************************
Synopsis [Find the file name.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
char
*
Abc_MainFileName
(
char
*
pFileName
)
{
static
char
Buffer
[
200
];
char
*
pExtension
;
assert
(
strlen
(
pFileName
)
<
190
);
pExtension
=
Extra_FileNameExtension
(
pFileName
);
if
(
pExtension
==
NULL
)
sprintf
(
Buffer
,
"%s.opt"
,
pFileName
);
else
{
strncpy
(
Buffer
,
pFileName
,
pExtension
-
pFileName
-
1
);
sprintf
(
Buffer
+
(
pExtension
-
pFileName
-
1
),
".opt.%s"
,
pExtension
);
}
return
Buffer
;
}
/**Function*************************************************************
Synopsis [The main() procedure.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int
main_
(
int
argc
,
char
*
argv
[]
)
{
extern
void
Nwk_ManPrintStatsUpdate
(
void
*
p
,
void
*
pAig
,
void
*
pNtk
,
int
nRegInit
,
int
nLutInit
,
int
nLevInit
,
int
Time
);
char
*
pComs
[
20
]
=
{
/*00*/
"*r -am "
,
/*01*/
"*w -abc 1.aig"
,
/*02*/
"*lcorr -nc"
,
//; *ps",
/*03*/
"*scorr -nc"
,
//; *ps",
/*04*/
"*dch; *if -K 4 -C 16 -F 3 -A 2; *sw -m"
,
//; *ps",
/*05*/
"*dch; *if -K 4 -C 16 -F 3 -A 2; *sw -m"
,
//; *ps",
/*06*/
"*w "
,
/*07*/
"*w -abc 2.aig"
,
/*08*/
"miter -mc 1.aig 2.aig; sim -F 4 -W 4 -mv"
};
char
Command
[
1000
];
int
i
,
nComs
;
Abc_Frame_t
*
pAbc
;
FILE
*
pFile
;
int
nRegInit
,
nLutInit
,
nLevInit
;
int
clkStart
=
clock
();
// added to detect memory leaks:
#if defined(_DEBUG) && defined(_MSC_VER)
_CrtSetDbgFlag
(
_CRTDBG_ALLOC_MEM_DF
|
_CRTDBG_LEAK_CHECK_DF
);
#endif
// check that the file is present
if
(
argc
!=
2
)
{
printf
(
"Expecting one command argument (file name).
\n
"
);
return
0
;
}
pFile
=
fopen
(
argv
[
1
],
"r"
);
if
(
pFile
==
NULL
)
{
printf
(
"Cannot open file
\"
%s
\"
.
\n
"
,
argv
[
1
]
);
return
0
;
}
fclose
(
pFile
);
// count the number of commands
for
(
nComs
=
0
;
nComs
<
20
;
nComs
++
)
if
(
pComs
[
nComs
]
==
NULL
)
break
;
// perform the commands
printf
(
"Reading design
\"
%s
\"
...
\n
"
,
argv
[
1
]
);
pAbc
=
Abc_FrameGetGlobalFrame
();
for
(
i
=
0
;
i
<
nComs
;
i
++
)
{
if
(
i
==
0
)
sprintf
(
Command
,
"%s%s"
,
pComs
[
i
],
argv
[
1
]
);
else
if
(
i
==
6
)
sprintf
(
Command
,
"%s%s"
,
pComs
[
i
],
Abc_MainFileName
(
argv
[
1
])
);
else
sprintf
(
Command
,
"%s"
,
pComs
[
i
]
);
if
(
Cmd_CommandExecute
(
pAbc
,
Command
)
)
{
printf
(
"Internal command %d failed.
\n
"
,
i
);
return
0
;
}
if
(
i
==
0
)
{
extern
int
Nwk_ManStatsRegs
(
void
*
p
);
extern
int
Nwk_ManStatsLuts
(
void
*
pNtk
);
extern
int
Nwk_ManStatsLevs
(
void
*
pNtk
);
nRegInit
=
Nwk_ManStatsRegs
(
pAbc
->
pAbc8Ntl
);
nLutInit
=
Nwk_ManStatsLuts
(
pAbc
->
pAbc8Nwk
);
nLevInit
=
Nwk_ManStatsLevs
(
pAbc
->
pAbc8Nwk
);
}
if
(
i
>=
1
&&
i
<=
5
)
Nwk_ManPrintStatsUpdate
(
pAbc
->
pAbc8Ntl
,
pAbc
->
pAbc8Aig
,
pAbc
->
pAbc8Nwk
,
nRegInit
,
nLutInit
,
nLevInit
,
clkStart
);
}
Abc_Stop
();
printf
(
"Writing optimized design
\"
%s
\"
...
\n
"
,
Abc_MainFileName
(
argv
[
1
])
);
ABC_PRT
(
"Total time"
,
clock
()
-
clkStart
);
printf
(
"
\n
"
);
return
0
;
}
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
/// 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