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
a8f4d4e6
Commit
a8f4d4e6
authored
Jul 19, 2012
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Making GIA use independent truth table number storage when computing truth tables.
parent
72c09b86
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
6 deletions
+10
-6
src/aig/gia/gia.h
+1
-0
src/aig/gia/giaMan.c
+1
-0
src/aig/gia/giaUtil.c
+8
-6
No files found.
src/aig/gia/gia.h
View file @
a8f4d4e6
...
@@ -154,6 +154,7 @@ struct Gia_Man_t_
...
@@ -154,6 +154,7 @@ struct Gia_Man_t_
word
nHashHit
;
// hash table hit
word
nHashHit
;
// hash table hit
word
nHashMiss
;
// hash table miss
word
nHashMiss
;
// hash table miss
int
fVerbose
;
// verbose reports
int
fVerbose
;
// verbose reports
Vec_Int_t
*
vObjNums
;
// object numbers
Vec_Wrd_t
*
vTtMemory
;
// truth table memory
Vec_Wrd_t
*
vTtMemory
;
// truth table memory
int
nTtVars
;
// truth table variables
int
nTtVars
;
// truth table variables
int
nTtWords
;
// truth table words
int
nTtWords
;
// truth table words
...
...
src/aig/gia/giaMan.c
View file @
a8f4d4e6
...
@@ -87,6 +87,7 @@ void Gia_ManStop( Gia_Man_t * p )
...
@@ -87,6 +87,7 @@ void Gia_ManStop( Gia_Man_t * p )
Vec_IntFreeP
(
&
p
->
vLevels
);
Vec_IntFreeP
(
&
p
->
vLevels
);
Vec_IntFreeP
(
&
p
->
vTruths
);
Vec_IntFreeP
(
&
p
->
vTruths
);
Vec_WrdFreeP
(
&
p
->
vTtMemory
);
Vec_WrdFreeP
(
&
p
->
vTtMemory
);
Vec_IntFreeP
(
&
p
->
vObjNums
);
Vec_IntFree
(
p
->
vCis
);
Vec_IntFree
(
p
->
vCis
);
Vec_IntFree
(
p
->
vCos
);
Vec_IntFree
(
p
->
vCos
);
ABC_FREE
(
p
->
pTravIds
);
ABC_FREE
(
p
->
pTravIds
);
...
...
src/aig/gia/giaUtil.c
View file @
a8f4d4e6
...
@@ -1358,11 +1358,11 @@ unsigned * Gia_ManComputePoTruthTables( Gia_Man_t * p, int nBytesMax )
...
@@ -1358,11 +1358,11 @@ unsigned * Gia_ManComputePoTruthTables( Gia_Man_t * p, int nBytesMax )
***********************************************************************/
***********************************************************************/
int
Gia_ObjComputeTruthTable_rec
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
)
int
Gia_ObjComputeTruthTable_rec
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
)
{
{
word
*
pTruth0
,
*
pTruth1
,
*
pTruth
,
*
pTruthL
;
word
*
pTruth0
,
*
pTruth1
,
*
pTruth
,
*
pTruthL
;
int
Value0
,
Value1
;
int
Value0
,
Value1
;
if
(
Gia_ObjIsTravIdCurrent
(
p
,
pObj
)
)
if
(
Gia_ObjIsTravIdCurrent
(
p
,
pObj
)
)
return
pObj
->
Value
;
return
Vec_IntGetEntry
(
p
->
vObjNums
,
Gia_ObjId
(
p
,
pObj
))
;
Gia_ObjSetTravIdCurrent
(
p
,
pObj
);
Gia_ObjSetTravIdCurrent
(
p
,
pObj
);
assert
(
Gia_ObjIsAnd
(
pObj
)
);
assert
(
Gia_ObjIsAnd
(
pObj
)
);
Value0
=
Gia_ObjComputeTruthTable_rec
(
p
,
Gia_ObjFanin0
(
pObj
)
);
Value0
=
Gia_ObjComputeTruthTable_rec
(
p
,
Gia_ObjFanin0
(
pObj
)
);
...
@@ -1392,14 +1392,14 @@ int Gia_ObjComputeTruthTable_rec( Gia_Man_t * p, Gia_Obj_t * pObj )
...
@@ -1392,14 +1392,14 @@ int Gia_ObjComputeTruthTable_rec( Gia_Man_t * p, Gia_Obj_t * pObj )
while
(
pTruth
<
pTruthL
)
while
(
pTruth
<
pTruthL
)
*
pTruth
++
=
*
pTruth0
++
&
*
pTruth1
++
;
*
pTruth
++
=
*
pTruth0
++
&
*
pTruth1
++
;
}
}
return
(
pObj
->
Value
=
p
->
iTtNum
-
1
);
Vec_IntSetEntry
(
p
->
vObjNums
,
Gia_ObjId
(
p
,
pObj
),
p
->
iTtNum
-
1
);
return
p
->
iTtNum
-
1
;
}
}
unsigned
*
Gia_ObjComputeTruthTable
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
)
unsigned
*
Gia_ObjComputeTruthTable
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
)
{
{
Gia_Obj_t
*
pTemp
;
Gia_Obj_t
*
pTemp
;
word
*
pTruth
;
word
*
pTruth
;
int
i
,
k
;
int
i
,
k
;
// this procedure works only for primary outputs
if
(
p
->
vTtMemory
==
NULL
)
if
(
p
->
vTtMemory
==
NULL
)
{
{
word
Truth6
[
7
]
=
{
word
Truth6
[
7
]
=
{
...
@@ -1417,6 +1417,8 @@ unsigned * Gia_ObjComputeTruthTable( Gia_Man_t * p, Gia_Obj_t * pObj )
...
@@ -1417,6 +1417,8 @@ unsigned * Gia_ObjComputeTruthTable( Gia_Man_t * p, Gia_Obj_t * pObj )
for
(
i
=
0
;
i
<
7
;
i
++
)
for
(
i
=
0
;
i
<
7
;
i
++
)
for
(
k
=
0
;
k
<
p
->
nTtWords
;
k
++
)
for
(
k
=
0
;
k
<
p
->
nTtWords
;
k
++
)
Vec_WrdWriteEntry
(
p
->
vTtMemory
,
i
*
p
->
nTtWords
+
k
,
Truth6
[
i
]
);
Vec_WrdWriteEntry
(
p
->
vTtMemory
,
i
*
p
->
nTtWords
+
k
,
Truth6
[
i
]
);
assert
(
p
->
vObjNums
==
NULL
);
p
->
vObjNums
=
Vec_IntAlloc
(
Gia_ManObjNum
(
p
)
+
1000
);
}
}
else
else
{
{
...
@@ -1427,11 +1429,11 @@ unsigned * Gia_ObjComputeTruthTable( Gia_Man_t * p, Gia_Obj_t * pObj )
...
@@ -1427,11 +1429,11 @@ unsigned * Gia_ObjComputeTruthTable( Gia_Man_t * p, Gia_Obj_t * pObj )
// mark const and PIs
// mark const and PIs
Gia_ManIncrementTravId
(
p
);
Gia_ManIncrementTravId
(
p
);
Gia_ObjSetTravIdCurrent
(
p
,
Gia_ManConst0
(
p
)
);
Gia_ObjSetTravIdCurrent
(
p
,
Gia_ManConst0
(
p
)
);
Gia_ManConst0
(
p
)
->
Value
=
0
;
Vec_IntSetEntry
(
p
->
vObjNums
,
0
,
0
)
;
Gia_ManForEachPi
(
p
,
pTemp
,
i
)
Gia_ManForEachPi
(
p
,
pTemp
,
i
)
{
{
Gia_ObjSetTravIdCurrent
(
p
,
pTemp
);
Gia_ObjSetTravIdCurrent
(
p
,
pTemp
);
pTemp
->
Value
=
i
+
1
;
Vec_IntSetEntry
(
p
->
vObjNums
,
Gia_ObjId
(
p
,
pTemp
),
i
+
1
)
;
}
}
p
->
iTtNum
=
7
;
p
->
iTtNum
=
7
;
// compute truth table for the fanin node
// compute truth table for the fanin node
...
...
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