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
0cad45fa
Commit
0cad45fa
authored
May 27, 2013
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New MFS package.
parent
fb6eaaf5
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
9 deletions
+35
-9
src/base/abci/abcMfs.c
+7
-3
src/misc/vec/vecStr.h
+19
-0
src/opt/sfm/sfmCore.c
+6
-1
src/opt/sfm/sfmNtk.c
+3
-5
No files found.
src/base/abci/abcMfs.c
View file @
0cad45fa
...
...
@@ -126,10 +126,13 @@ Sfm_Ntk_t * Abc_NtkExtractMfs( Abc_Ntk_t * pNtk, int nFirstFixed )
Vec_IntPush
(
vArray
,
pFanin
->
iTemp
);
}
Vec_PtrFree
(
vNodes
);
// update fixed
assert
(
nFirstFixed
>=
0
&&
nFirstFixed
<
Abc_NtkNodeNum
(
pNtk
)
);
for
(
i
=
Abc_NtkCiNum
(
pNtk
);
i
<
Abc_NtkCiNum
(
pNtk
)
+
nFirstFixed
;
i
++
)
Vec_StrWriteEntry
(
vFixed
,
i
,
(
char
)
1
);
// update fixed
assert
(
nFirstFixed
>=
0
&&
nFirstFixed
<
Abc_NtkNodeNum
(
pNtk
)
);
// 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
);
}
...
...
@@ -159,7 +162,8 @@ void Abc_NtkInsertMfs( Abc_Ntk_t * pNtk, Sfm_Ntk_t * p )
Vec_IntWriteEntry
(
vMap
,
pNode
->
iTemp
,
Abc_ObjId
(
pNode
)
);
// remove old fanins
Abc_NtkForEachNode
(
pNtk
,
pNode
,
i
)
Abc_ObjRemoveFanins
(
pNode
);
if
(
!
Sfm_NodeReadFixed
(
p
,
pNode
->
iTemp
)
)
Abc_ObjRemoveFanins
(
pNode
);
// create new fanins
vCover
=
Vec_IntAlloc
(
1
<<
16
);
Abc_NtkForEachNode
(
pNtk
,
pNode
,
i
)
...
...
src/misc/vec/vecStr.h
View file @
0cad45fa
...
...
@@ -638,6 +638,25 @@ static inline void Vec_StrReverseOrder( Vec_Str_t * p )
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
static
inline
int
Vec_StrSum
(
Vec_Str_t
*
p
)
{
int
i
,
Counter
=
0
;
for
(
i
=
0
;
i
<
p
->
nSize
;
i
++
)
Counter
+=
(
int
)
p
->
pArray
[
i
];
return
Counter
;
}
/**Function*************************************************************
Synopsis [Compares two strings.]
Description []
...
...
src/opt/sfm/sfmCore.c
View file @
0cad45fa
...
...
@@ -255,6 +255,8 @@ int Sfm_NtkPerform( Sfm_Ntk_t * p, Sfm_Par_t * pPars )
{
int
i
,
k
,
Counter
=
0
;
p
->
timeTotal
=
clock
();
if
(
pPars
->
fVerbose
)
printf
(
"Performing MFS with %d fixed objected.
\n
"
,
Vec_StrSum
(
p
->
vFixed
)
);
p
->
pPars
=
pPars
;
Sfm_NtkPrepare
(
p
);
// Sfm_ComputeInterpolantCheck( p );
...
...
@@ -270,7 +272,10 @@ int Sfm_NtkPerform( Sfm_Ntk_t * p, Sfm_Par_t * pPars )
if
(
Sfm_ObjFaninNum
(
p
,
i
)
<
2
||
Sfm_ObjFaninNum
(
p
,
i
)
>
6
)
continue
;
for
(
k
=
0
;
Sfm_NodeResub
(
p
,
i
);
k
++
)
;
{
// Counter++;
// break;
}
Counter
+=
(
k
>
0
);
}
p
->
nTotalNodesEnd
=
Vec_WecSizeUsed
(
&
p
->
vFanins
)
-
Sfm_NtkPoNum
(
p
);
...
...
src/opt/sfm/sfmNtk.c
View file @
0cad45fa
...
...
@@ -57,7 +57,7 @@ void Sfm_CheckConsistency( Vec_Wec_t * vFanins, int nPis, int nPos, Vec_Str_t *
assert
(
Fanin
<
i
&&
Fanin
+
nPos
<
Vec_WecSize
(
vFanins
)
);
// POs have one fanout
if
(
i
+
nPos
>=
Vec_WecSize
(
vFanins
)
)
assert
(
Vec_StrEntry
(
vFixed
,
i
)
==
(
char
)
0
);
assert
(
Vec_
IntSize
(
vArray
)
==
1
&&
Vec_
StrEntry
(
vFixed
,
i
)
==
(
char
)
0
);
}
}
...
...
@@ -254,8 +254,7 @@ void Sfm_NtkDeleteObj_rec( Sfm_Ntk_t * p, int iNode )
Sfm_ObjForEachFanin
(
p
,
iNode
,
iFanin
,
i
)
{
int
RetValue
=
Vec_IntRemove
(
Sfm_ObjFoArray
(
p
,
iFanin
),
iNode
);
assert
(
RetValue
);
if
(
Sfm_ObjFanoutNum
(
p
,
iFanin
)
==
0
)
Sfm_NtkDeleteObj_rec
(
p
,
iFanin
);
Sfm_NtkDeleteObj_rec
(
p
,
iFanin
);
}
Vec_IntClear
(
Sfm_ObjFiArray
(
p
,
iNode
)
);
Vec_WrdWriteEntry
(
p
->
vTruths
,
iNode
,
(
word
)
0
);
...
...
@@ -281,8 +280,7 @@ void Sfm_NtkUpdate( Sfm_Ntk_t * p, int iNode, int f, int iFaninNew, word uTruth
Sfm_ObjForEachFanin
(
p
,
iNode
,
iFanin
,
f
)
{
int
RetValue
=
Vec_IntRemove
(
Sfm_ObjFoArray
(
p
,
iFanin
),
iNode
);
assert
(
RetValue
);
if
(
Sfm_ObjFanoutNum
(
p
,
iFanin
)
==
0
)
Sfm_NtkDeleteObj_rec
(
p
,
iFanin
);
Sfm_NtkDeleteObj_rec
(
p
,
iFanin
);
}
Vec_IntClear
(
Sfm_ObjFiArray
(
p
,
iNode
)
);
}
...
...
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