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
21b847a8
Commit
21b847a8
authored
Jul 08, 2012
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updating truth table computation for GIA to work for internal nodes as well.
parent
ff0ec52d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
16 deletions
+20
-16
src/aig/gia/gia.h
+1
-1
src/aig/gia/giaUtil.c
+19
-15
No files found.
src/aig/gia/gia.h
View file @
21b847a8
...
...
@@ -945,7 +945,7 @@ extern Vec_Int_t * Gia_VtaConvertToGla( Gia_Man_t * p, Vec_Int_t * vVta
extern
Vec_Int_t
*
Gia_VtaConvertFromGla
(
Gia_Man_t
*
p
,
Vec_Int_t
*
vGla
,
int
nFrames
);
extern
Vec_Int_t
*
Gia_FlaConvertToGla
(
Gia_Man_t
*
p
,
Vec_Int_t
*
vFla
);
extern
Vec_Int_t
*
Gia_GlaConvertToFla
(
Gia_Man_t
*
p
,
Vec_Int_t
*
vGla
);
extern
unsigned
*
Gia_
ManComputePoTt
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
);
extern
unsigned
*
Gia_
ObjComputeTruthTable
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
);
/*=== giaCTas.c ===========================================================*/
typedef
struct
Tas_Man_t_
Tas_Man_t
;
...
...
src/aig/gia/giaUtil.c
View file @
21b847a8
...
...
@@ -1510,15 +1510,15 @@ unsigned * Gia_ManComputePoTruthTables( Gia_Man_t * p, int nBytesMax )
SeeAlso []
***********************************************************************/
int
Gia_
ManComputePoTt
_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
;
if
(
Gia_ObjIsTravIdCurrent
(
p
,
pObj
)
)
return
pObj
->
Value
;
Gia_ObjSetTravIdCurrent
(
p
,
pObj
);
assert
(
Gia_ObjIsAnd
(
pObj
)
);
pTruth0
=
Vec_WrdArray
(
p
->
vTtMemory
)
+
p
->
nTtWords
*
Gia_
ManComputePoTt
_rec
(
p
,
Gia_ObjFanin0
(
pObj
)
);
pTruth1
=
Vec_WrdArray
(
p
->
vTtMemory
)
+
p
->
nTtWords
*
Gia_
ManComputePoTt
_rec
(
p
,
Gia_ObjFanin1
(
pObj
)
);
pTruth0
=
Vec_WrdArray
(
p
->
vTtMemory
)
+
p
->
nTtWords
*
Gia_
ObjComputeTruthTable
_rec
(
p
,
Gia_ObjFanin0
(
pObj
)
);
pTruth1
=
Vec_WrdArray
(
p
->
vTtMemory
)
+
p
->
nTtWords
*
Gia_
ObjComputeTruthTable
_rec
(
p
,
Gia_ObjFanin1
(
pObj
)
);
assert
(
p
->
nTtWords
*
p
->
iTtNum
<
Vec_WrdSize
(
p
->
vTtMemory
)
);
pTruth
=
Vec_WrdArray
(
p
->
vTtMemory
)
+
p
->
nTtWords
*
p
->
iTtNum
++
;
pTruthL
=
Vec_WrdArray
(
p
->
vTtMemory
)
+
p
->
nTtWords
*
p
->
iTtNum
;
...
...
@@ -1542,13 +1542,12 @@ int Gia_ManComputePoTt_rec( Gia_Man_t * p, Gia_Obj_t * pObj )
}
return
p
->
iTtNum
-
1
;
}
unsigned
*
Gia_
ManComputePoTt
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
)
unsigned
*
Gia_
ObjComputeTruthTable
(
Gia_Man_t
*
p
,
Gia_Obj_t
*
pObj
)
{
Gia_Obj_t
*
pTemp
;
word
*
pTruth
;
int
i
,
k
;
// this procedure works only for primary outputs
assert
(
Gia_ObjIsCo
(
pObj
)
);
if
(
p
->
vTtMemory
==
NULL
)
{
word
Truth6
[
7
]
=
{
...
...
@@ -1584,16 +1583,21 @@ unsigned * Gia_ManComputePoTt( Gia_Man_t * p, Gia_Obj_t * pObj )
}
p
->
iTtNum
=
7
;
// compute truth table for the fanin node
pTruth
=
Vec_WrdArray
(
p
->
vTtMemory
)
+
p
->
nTtWords
*
Gia_ManComputePoTt_rec
(
p
,
Gia_ObjFanin0
(
pObj
));
// complement if needed
if
(
Gia_ObjFaninC0
(
pObj
)
)
if
(
Gia_ObjIsCo
(
pObj
)
)
{
word
*
pTemp
=
pTruth
;
assert
(
p
->
nTtWords
*
p
->
iTtNum
<
Vec_WrdSize
(
p
->
vTtMemory
)
);
pTruth
=
Vec_WrdArray
(
p
->
vTtMemory
)
+
p
->
nTtWords
*
p
->
iTtNum
;
for
(
k
=
0
;
k
<
p
->
nTtWords
;
k
++
)
pTruth
[
k
]
=
~
pTemp
[
k
];
pTruth
=
Vec_WrdArray
(
p
->
vTtMemory
)
+
p
->
nTtWords
*
Gia_ObjComputeTruthTable_rec
(
p
,
Gia_ObjFanin0
(
pObj
));
// complement if needed
if
(
Gia_ObjFaninC0
(
pObj
)
)
{
word
*
pTemp
=
pTruth
;
assert
(
p
->
nTtWords
*
p
->
iTtNum
<
Vec_WrdSize
(
p
->
vTtMemory
)
);
pTruth
=
Vec_WrdArray
(
p
->
vTtMemory
)
+
p
->
nTtWords
*
p
->
iTtNum
;
for
(
k
=
0
;
k
<
p
->
nTtWords
;
k
++
)
pTruth
[
k
]
=
~
pTemp
[
k
];
}
}
else
pTruth
=
Vec_WrdArray
(
p
->
vTtMemory
)
+
p
->
nTtWords
*
Gia_ObjComputeTruthTable_rec
(
p
,
pObj
);
return
(
unsigned
*
)
pTruth
;
}
...
...
@@ -1608,7 +1612,7 @@ unsigned * Gia_ManComputePoTt( Gia_Man_t * p, Gia_Obj_t * pObj )
SeeAlso []
***********************************************************************/
void
Gia_
ManComputePoTt
Test
(
Gia_Man_t
*
p
)
void
Gia_
ObjComputeTruthTable
Test
(
Gia_Man_t
*
p
)
{
Gia_Obj_t
*
pObj
;
unsigned
*
pTruth
;
...
...
@@ -1616,7 +1620,7 @@ void Gia_ManComputePoTtTest( Gia_Man_t * p )
int
i
;
Gia_ManForEachPo
(
p
,
pObj
,
i
)
{
pTruth
=
Gia_
ManComputePoTt
(
p
,
pObj
);
pTruth
=
Gia_
ObjComputeTruthTable
(
p
,
pObj
);
// Extra_PrintHex( stdout, pTruth, Gia_ManPiNum(p) ); printf( "\n" );
}
Abc_PrintTime
(
1
,
"Time"
,
clock
()
-
clk
);
...
...
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