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
fdc9b180
Commit
fdc9b180
authored
Jul 31, 2016
by
Mathias Soeken
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create network from solution in store.
parent
19e78a35
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
102 additions
and
0 deletions
+102
-0
src/base/abci/abcExact.c
+102
-0
No files found.
src/base/abci/abcExact.c
View file @
fdc9b180
...
@@ -256,6 +256,51 @@ int Ses_StoreAddEntry( Ses_Store_t * pStore, word * pTruth, int nVars, int * pAr
...
@@ -256,6 +256,51 @@ int Ses_StoreAddEntry( Ses_Store_t * pStore, word * pTruth, int nVars, int * pAr
return
0
;
return
0
;
}
}
// pArrTimeProfile is not normalized
// returns 0 if no solution was found
char
*
Ses_StoreGetEntry
(
Ses_Store_t
*
pStore
,
word
*
pTruth
,
int
nVars
,
int
*
pArrTimeProfile
)
{
int
maxNormalized
,
key
;
Ses_TruthEntry_t
*
pTEntry
;
Ses_TimesEntry_t
*
pTiEntry
;
if
(
pStore
->
nNumVars
!=
nVars
)
return
0
;
Abc_NormalizeArrivalTimes
(
pArrTimeProfile
,
nVars
,
&
maxNormalized
);
key
=
Ses_StoreTableHash
(
pStore
,
pTruth
);
pTEntry
=
pStore
->
pEntries
[
key
];
/* find truth table entry */
while
(
pTEntry
)
{
if
(
Ses_StoreTruthEqual
(
pStore
,
pTruth
,
pTEntry
->
pTruth
)
)
break
;
else
pTEntry
=
pTEntry
->
next
;
}
/* no entry found? */
if
(
!
pTEntry
)
return
0
;
/* find times entry */
pTiEntry
=
pTEntry
->
head
;
while
(
pTiEntry
)
{
if
(
Ses_StoreTimesEqual
(
pStore
,
pArrTimeProfile
,
pTiEntry
->
pArrTimeProfile
)
)
break
;
else
pTiEntry
=
pTiEntry
->
next
;
}
/* no entry found? */
if
(
!
pTiEntry
)
return
0
;
return
pTiEntry
->
pNetwork
;
}
static
inline
Ses_Man_t
*
Ses_ManAlloc
(
word
*
pTruth
,
int
nVars
,
int
nFunc
,
int
nMaxDepth
,
int
*
pArrTimeProfile
,
int
fMakeAIG
,
int
fVerbose
)
static
inline
Ses_Man_t
*
Ses_ManAlloc
(
word
*
pTruth
,
int
nVars
,
int
nFunc
,
int
nMaxDepth
,
int
*
pArrTimeProfile
,
int
fMakeAIG
,
int
fVerbose
)
{
{
...
@@ -1304,7 +1349,64 @@ int Abc_ExactDelayCost( word * pTruth, int nVars, int * pArrTimeProfile, char *
...
@@ -1304,7 +1349,64 @@ int Abc_ExactDelayCost( word * pTruth, int nVars, int * pArrTimeProfile, char *
// has the smallest possible arrival time (in agreement with the above Abc_ExactDelayCost)
// has the smallest possible arrival time (in agreement with the above Abc_ExactDelayCost)
Abc_Obj_t
*
Abc_ExactBuildNode
(
word
*
pTruth
,
int
nVars
,
int
*
pArrTimeProfile
,
Abc_Obj_t
**
pFanins
)
Abc_Obj_t
*
Abc_ExactBuildNode
(
word
*
pTruth
,
int
nVars
,
int
*
pArrTimeProfile
,
Abc_Obj_t
**
pFanins
)
{
{
char
*
pSol
;
int
i
;
char
const
*
p
;
Abc_Obj_t
*
pObj
;
Vec_Ptr_t
*
pGates
;
char
pGateTruth
[
5
];
char
*
pSopCover
;
Abc_Ntk_t
*
pNtk
=
NULL
;
/* need that to create node */
pSol
=
Ses_StoreGetEntry
(
s_pSesStore
,
pTruth
,
nVars
,
pArrTimeProfile
);
if
(
!
pSol
)
return
NULL
;
return
NULL
;
assert
(
pSol
[
ABC_EXACT_SOL_NVARS
]
==
nVars
);
assert
(
pSol
[
ABC_EXACT_SOL_NFUNC
]
==
1
);
pGates
=
Vec_PtrAlloc
(
nVars
+
pSol
[
ABC_EXACT_SOL_NGATES
]
);
pGateTruth
[
3
]
=
'0'
;
pGateTruth
[
4
]
=
'\0'
;
/* primary inputs */
for
(
i
=
0
;
i
<
nVars
;
++
i
)
{
Vec_PtrPush
(
pGates
,
pFanins
[
i
]
);
}
/* gates */
p
=
pSol
+
3
;
for
(
i
=
0
;
i
<
pSol
[
ABC_EXACT_SOL_NGATES
];
++
i
)
{
pGateTruth
[
2
]
=
'0'
+
(
*
p
&
1
);
pGateTruth
[
1
]
=
'0'
+
(
(
*
p
>>
1
)
&
1
);
pGateTruth
[
0
]
=
'0'
+
(
(
*
p
>>
2
)
&
1
);
++
p
;
assert
(
*
p
==
2
);
/* binary gate */
++
p
;
pSopCover
=
Abc_SopFromTruthBin
(
pGateTruth
);
pObj
=
Abc_NtkCreateNode
(
pNtk
);
pObj
->
pData
=
Abc_SopRegister
(
(
Mem_Flex_t
*
)
pNtk
->
pManFunc
,
pSopCover
);
Vec_PtrPush
(
pGates
,
pObj
);
ABC_FREE
(
pSopCover
);
Abc_ObjAddFanin
(
pObj
,
(
Abc_Obj_t
*
)
Vec_PtrEntry
(
pGates
,
*
p
++
)
);
Abc_ObjAddFanin
(
pObj
,
(
Abc_Obj_t
*
)
Vec_PtrEntry
(
pGates
,
*
p
++
)
);
}
/* output */
if
(
Abc_LitIsCompl
(
*
p
)
)
pObj
=
Abc_NtkCreateNodeInv
(
pNtk
,
(
Abc_Obj_t
*
)
Vec_PtrEntry
(
pGates
,
nVars
+
Abc_Lit2Var
(
*
p
)
)
);
else
pObj
=
(
Abc_Obj_t
*
)
Vec_PtrEntry
(
pGates
,
nVars
+
Abc_Lit2Var
(
*
p
)
);
Vec_PtrFree
(
pGates
);
return
pObj
;
}
}
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
...
...
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