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
7d56aaba
Commit
7d56aaba
authored
Oct 09, 2013
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upgrading 'mfs2' to consider some nodes as having no level.
parent
608fe4e3
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
22 additions
and
17 deletions
+22
-17
src/aig/gia/giaMfs.c
+1
-1
src/base/abci/abcMfs.c
+1
-1
src/base/main/mainInit.c
+1
-1
src/opt/sfm/sfm.h
+1
-1
src/opt/sfm/sfmInt.h
+3
-0
src/opt/sfm/sfmNtk.c
+15
-13
No files found.
src/aig/gia/giaMfs.c
View file @
7d56aaba
...
...
@@ -247,7 +247,7 @@ Sfm_Ntk_t * Gia_ManExtractMfs( Gia_Man_t * p, Gia_Man_t * pBoxes, Vec_Int_t ** p
Vec_IntFree
(
vPoNodes
);
Vec_WrdFree
(
vTruthsTemp
);
*
pvId2Mfs
=
vId2Mfs
;
return
Sfm_NtkConstruct
(
vFanins
,
nPiNum
,
nPoNum
,
vFixed
,
vTruths
);
return
Sfm_NtkConstruct
(
vFanins
,
nPiNum
,
nPoNum
,
vFixed
,
NULL
,
vTruths
);
}
/**Function*************************************************************
...
...
src/base/abci/abcMfs.c
View file @
7d56aaba
...
...
@@ -134,7 +134,7 @@ Sfm_Ntk_t * Abc_NtkExtractMfs( Abc_Ntk_t * pNtk, int nFirstFixed )
// for ( i = Abc_NtkCiNum(pNtk); i + Abc_NtkCoNum(pNtk) < Abc_NtkObjNum(pNtk); i++ )
// if ( rand() % 10 == 0 )
// Vec_StrWriteEntry( vFixed, i, (char)1 );
return
Sfm_NtkConstruct
(
vFanins
,
Abc_NtkCiNum
(
pNtk
),
Abc_NtkCoNum
(
pNtk
),
vFixed
,
vTruths
);
return
Sfm_NtkConstruct
(
vFanins
,
Abc_NtkCiNum
(
pNtk
),
Abc_NtkCoNum
(
pNtk
),
vFixed
,
NULL
,
vTruths
);
}
/**Function*************************************************************
...
...
src/base/main/mainInit.c
View file @
7d56aaba
...
...
@@ -23,7 +23,7 @@
ABC_NAMESPACE_IMPL_START
//
#define USE_ABC2
#define USE_ABC2
//#define USE_ABC85
////////////////////////////////////////////////////////////////////////
...
...
src/opt/sfm/sfm.h
View file @
7d56aaba
...
...
@@ -69,7 +69,7 @@ struct Sfm_Par_t_
extern
void
Sfm_ParSetDefault
(
Sfm_Par_t
*
pPars
);
extern
int
Sfm_NtkPerform
(
Sfm_Ntk_t
*
p
,
Sfm_Par_t
*
pPars
);
/*=== sfmNtk.c ==========================================================*/
extern
Sfm_Ntk_t
*
Sfm_NtkConstruct
(
Vec_Wec_t
*
vFanins
,
int
nPis
,
int
nPos
,
Vec_Str_t
*
vFixed
,
Vec_Wrd_t
*
vTruths
);
extern
Sfm_Ntk_t
*
Sfm_NtkConstruct
(
Vec_Wec_t
*
vFanins
,
int
nPis
,
int
nPos
,
Vec_Str_t
*
vFixed
,
Vec_
Str_t
*
vEmpty
,
Vec_
Wrd_t
*
vTruths
);
extern
void
Sfm_NtkFree
(
Sfm_Ntk_t
*
p
);
extern
Vec_Int_t
*
Sfm_NodeReadFanins
(
Sfm_Ntk_t
*
p
,
int
i
);
extern
word
*
Sfm_NodeReadTruth
(
Sfm_Ntk_t
*
p
,
int
i
);
...
...
src/opt/sfm/sfmInt.h
View file @
7d56aaba
...
...
@@ -61,6 +61,7 @@ struct Sfm_Ntk_t_
int
nLevelMax
;
// maximum level
// user data
Vec_Str_t
*
vFixed
;
// persistent objects
Vec_Str_t
*
vEmpty
;
// transparent objects
Vec_Wrd_t
*
vTruths
;
// truth tables
Vec_Wec_t
vFanins
;
// fanins
// attributes
...
...
@@ -129,6 +130,8 @@ static inline int Sfm_ObjIsPi( Sfm_Ntk_t * p, int i ) { return
static
inline
int
Sfm_ObjIsPo
(
Sfm_Ntk_t
*
p
,
int
i
)
{
return
i
+
p
->
nPos
>=
p
->
nObjs
;
}
static
inline
int
Sfm_ObjIsNode
(
Sfm_Ntk_t
*
p
,
int
i
)
{
return
i
>=
p
->
nPis
&&
i
+
p
->
nPos
<
p
->
nObjs
;
}
static
inline
int
Sfm_ObjIsFixed
(
Sfm_Ntk_t
*
p
,
int
i
)
{
return
Vec_StrEntry
(
p
->
vFixed
,
i
);
}
static
inline
int
Sfm_ObjAddsLevelArray
(
Vec_Str_t
*
p
,
int
i
)
{
return
p
==
NULL
||
Vec_StrEntry
(
p
,
i
)
==
0
;
}
static
inline
int
Sfm_ObjAddsLevel
(
Sfm_Ntk_t
*
p
,
int
i
)
{
return
Sfm_ObjAddsLevelArray
(
p
->
vEmpty
,
i
);
}
static
inline
Vec_Int_t
*
Sfm_ObjFiArray
(
Sfm_Ntk_t
*
p
,
int
i
)
{
return
Vec_WecEntry
(
&
p
->
vFanins
,
i
);
}
static
inline
Vec_Int_t
*
Sfm_ObjFoArray
(
Sfm_Ntk_t
*
p
,
int
i
)
{
return
Vec_WecEntry
(
&
p
->
vFanouts
,
i
);
}
...
...
src/opt/sfm/sfmNtk.c
View file @
7d56aaba
...
...
@@ -107,21 +107,21 @@ void Sfm_CreateFanout( Vec_Wec_t * vFanins, Vec_Wec_t * vFanouts )
SeeAlso []
***********************************************************************/
static
inline
int
Sfm_ObjLevelNew
(
Vec_Int_t
*
vArray
,
Vec_Int_t
*
vLevels
)
static
inline
int
Sfm_ObjLevelNew
(
Vec_Int_t
*
vArray
,
Vec_Int_t
*
vLevels
,
int
fAddLevel
)
{
int
k
,
Fanin
,
Level
=
0
;
Vec_IntForEachEntry
(
vArray
,
Fanin
,
k
)
Level
=
Abc_MaxInt
(
Level
,
Vec_IntEntry
(
vLevels
,
Fanin
)
);
return
Level
+
1
;
return
Level
+
fAddLevel
;
}
void
Sfm_CreateLevel
(
Vec_Wec_t
*
vFanins
,
Vec_Int_t
*
vLevels
)
void
Sfm_CreateLevel
(
Vec_Wec_t
*
vFanins
,
Vec_Int_t
*
vLevels
,
Vec_Str_t
*
vEmpty
)
{
Vec_Int_t
*
vArray
;
int
i
;
assert
(
Vec_IntSize
(
vLevels
)
==
0
);
Vec_IntFill
(
vLevels
,
Vec_WecSize
(
vFanins
),
0
);
Vec_WecForEachLevel
(
vFanins
,
vArray
,
i
)
Vec_IntWriteEntry
(
vLevels
,
i
,
Sfm_ObjLevelNew
(
vArray
,
vLevels
)
);
Vec_IntWriteEntry
(
vLevels
,
i
,
Sfm_ObjLevelNew
(
vArray
,
vLevels
,
Sfm_ObjAddsLevelArray
(
vEmpty
,
i
)
)
);
}
/**Function*************************************************************
...
...
@@ -135,21 +135,21 @@ void Sfm_CreateLevel( Vec_Wec_t * vFanins, Vec_Int_t * vLevels )
SeeAlso []
***********************************************************************/
static
inline
int
Sfm_ObjLevelNewR
(
Vec_Int_t
*
vArray
,
Vec_Int_t
*
vLevelsR
)
static
inline
int
Sfm_ObjLevelNewR
(
Vec_Int_t
*
vArray
,
Vec_Int_t
*
vLevelsR
,
int
fAddLevel
)
{
int
k
,
Fanout
,
LevelR
=
0
;
Vec_IntForEachEntry
(
vArray
,
Fanout
,
k
)
LevelR
=
Abc_MaxInt
(
LevelR
,
Vec_IntEntry
(
vLevelsR
,
Fanout
)
);
return
LevelR
+
1
;
return
LevelR
+
fAddLevel
;
}
void
Sfm_CreateLevelR
(
Vec_Wec_t
*
vFanouts
,
Vec_Int_t
*
vLevelsR
)
void
Sfm_CreateLevelR
(
Vec_Wec_t
*
vFanouts
,
Vec_Int_t
*
vLevelsR
,
Vec_Str_t
*
vEmpty
)
{
Vec_Int_t
*
vArray
;
int
i
;
assert
(
Vec_IntSize
(
vLevelsR
)
==
0
);
Vec_IntFill
(
vLevelsR
,
Vec_WecSize
(
vFanouts
),
0
);
Vec_WecForEachLevelReverse
(
vFanouts
,
vArray
,
i
)
Vec_IntWriteEntry
(
vLevelsR
,
i
,
Sfm_ObjLevelNewR
(
vArray
,
vLevelsR
)
);
Vec_IntWriteEntry
(
vLevelsR
,
i
,
Sfm_ObjLevelNewR
(
vArray
,
vLevelsR
,
Sfm_ObjAddsLevelArray
(
vEmpty
,
i
)
)
);
}
/**Function*************************************************************
...
...
@@ -163,7 +163,7 @@ void Sfm_CreateLevelR( Vec_Wec_t * vFanouts, Vec_Int_t * vLevelsR )
SeeAlso []
***********************************************************************/
Sfm_Ntk_t
*
Sfm_NtkConstruct
(
Vec_Wec_t
*
vFanins
,
int
nPis
,
int
nPos
,
Vec_Str_t
*
vFixed
,
Vec_Wrd_t
*
vTruths
)
Sfm_Ntk_t
*
Sfm_NtkConstruct
(
Vec_Wec_t
*
vFanins
,
int
nPis
,
int
nPos
,
Vec_Str_t
*
vFixed
,
Vec_
Str_t
*
vEmpty
,
Vec_
Wrd_t
*
vTruths
)
{
Sfm_Ntk_t
*
p
;
Sfm_CheckConsistency
(
vFanins
,
nPis
,
nPos
,
vFixed
);
...
...
@@ -174,13 +174,14 @@ Sfm_Ntk_t * Sfm_NtkConstruct( Vec_Wec_t * vFanins, int nPis, int nPos, Vec_Str_t
p
->
nNodes
=
p
->
nObjs
-
p
->
nPis
-
p
->
nPos
;
// user data
p
->
vFixed
=
vFixed
;
p
->
vEmpty
=
vEmpty
;
p
->
vTruths
=
vTruths
;
p
->
vFanins
=
*
vFanins
;
ABC_FREE
(
vFanins
);
// attributes
Sfm_CreateFanout
(
&
p
->
vFanins
,
&
p
->
vFanouts
);
Sfm_CreateLevel
(
&
p
->
vFanins
,
&
p
->
vLevels
);
Sfm_CreateLevelR
(
&
p
->
vFanouts
,
&
p
->
vLevelsR
);
Sfm_CreateLevel
(
&
p
->
vFanins
,
&
p
->
vLevels
,
vEmpty
);
Sfm_CreateLevelR
(
&
p
->
vFanouts
,
&
p
->
vLevelsR
,
vEmpty
);
Vec_IntFill
(
&
p
->
vCounts
,
p
->
nObjs
,
0
);
Vec_IntFill
(
&
p
->
vTravIds
,
p
->
nObjs
,
0
);
Vec_IntFill
(
&
p
->
vTravIds2
,
p
->
nObjs
,
0
);
...
...
@@ -212,6 +213,7 @@ void Sfm_NtkFree( Sfm_Ntk_t * p )
{
// user data
Vec_StrFree
(
p
->
vFixed
);
Vec_StrFree
(
p
->
vEmpty
);
Vec_WrdFree
(
p
->
vTruths
);
Vec_WecErase
(
&
p
->
vFanins
);
// attributes
...
...
@@ -291,7 +293,7 @@ void Sfm_NtkDeleteObj_rec( Sfm_Ntk_t * p, int iNode )
void
Sfm_NtkUpdateLevel_rec
(
Sfm_Ntk_t
*
p
,
int
iNode
)
{
int
i
,
iFanout
;
int
LevelNew
=
Sfm_ObjLevelNew
(
Sfm_ObjFiArray
(
p
,
iNode
),
&
p
->
vLevels
);
int
LevelNew
=
Sfm_ObjLevelNew
(
Sfm_ObjFiArray
(
p
,
iNode
),
&
p
->
vLevels
,
Sfm_ObjAddsLevel
(
p
,
iNode
)
);
if
(
LevelNew
==
Sfm_ObjLevel
(
p
,
iNode
)
)
return
;
Sfm_ObjSetLevel
(
p
,
iNode
,
LevelNew
);
...
...
@@ -301,7 +303,7 @@ void Sfm_NtkUpdateLevel_rec( Sfm_Ntk_t * p, int iNode )
void
Sfm_NtkUpdateLevelR_rec
(
Sfm_Ntk_t
*
p
,
int
iNode
)
{
int
i
,
iFanin
;
int
LevelNew
=
Sfm_ObjLevelNewR
(
Sfm_ObjFoArray
(
p
,
iNode
),
&
p
->
vLevelsR
);
int
LevelNew
=
Sfm_ObjLevelNewR
(
Sfm_ObjFoArray
(
p
,
iNode
),
&
p
->
vLevelsR
,
Sfm_ObjAddsLevel
(
p
,
iNode
)
);
if
(
LevelNew
==
Sfm_ObjLevelR
(
p
,
iNode
)
)
return
;
Sfm_ObjSetLevelR
(
p
,
iNode
,
LevelNew
);
...
...
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