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
eae04552
Commit
eae04552
authored
Mar 14, 2014
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Experiments with simulation.
parent
550b769d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
9 deletions
+47
-9
src/base/abci/abc.c
+1
-1
src/map/if/ifTest.c
+46
-8
No files found.
src/base/abci/abc.c
View file @
eae04552
...
...
@@ -25315,7 +25315,7 @@ int Abc_CommandAbc9Show( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_Print
(
-
1
,
"Abc_CommandAbc9Show(): There is no AIG.
\n
"
);
return
1
;
}
pMan
=
Gia_ManToAig
(
pAbc
->
pGia
,
0
);
pMan
=
Gia_ManToAig
Simple
(
pAbc
->
pGia
);
Aig_ManShow
(
pMan
,
0
,
NULL
);
Aig_ManStop
(
pMan
);
return
0
;
src/map/if/ifTest.c
View file @
eae04552
...
...
@@ -57,6 +57,43 @@ static inline void Gia_ParTestFree( Gia_Man_t * p ) { ABC_FREE(
SeeAlso []
***********************************************************************/
void
Gia_ParComputeSignature
(
Gia_Man_t
*
p
,
int
nWords
)
{
Gia_Obj_t
*
pObj
;
word
*
pData
,
Sign
=
0
;
int
i
,
k
;
Gia_ManForEachCo
(
p
,
pObj
,
k
)
{
pData
=
Gia_ParTestObj
(
p
,
Gia_ObjId
(
p
,
pObj
)
);
for
(
i
=
0
;
i
<
p
->
iData
;
i
++
)
Sign
^=
pData
[
i
];
}
Abc_TtPrintHexRev
(
stdout
,
&
Sign
,
6
);
}
/**Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void
Gia_ParTestSimulateInit
(
Gia_Man_t
*
p
)
{
Gia_Obj_t
*
pObj
;
word
*
pData
;
int
i
,
k
;
Gia_ManForEachCi
(
p
,
pObj
,
k
)
{
pData
=
Gia_ParTestObj
(
p
,
Gia_ObjId
(
p
,
pObj
)
);
for
(
i
=
0
;
i
<
p
->
iData
;
i
++
)
pData
[
i
]
=
Gia_ManRandomW
(
0
);
}
}
void
Gia_ParTestSimulateObj
(
Gia_Man_t
*
p
,
int
Id
)
{
Gia_Obj_t
*
pObj
=
Gia_ManObj
(
p
,
Id
);
...
...
@@ -99,9 +136,6 @@ void Gia_ParTestSimulateObj( Gia_Man_t * p, int Id )
}
else
if
(
Gia_ObjIsCi
(
pObj
)
)
{
pData
=
Gia_ParTestObj
(
p
,
Id
);
for
(
i
=
0
;
i
<
p
->
iData
;
i
++
)
pData
[
i
]
=
Gia_ManRandomW
(
0
);
}
else
if
(
Gia_ObjIsConst0
(
pObj
)
)
{
...
...
@@ -117,8 +151,10 @@ void Gia_ParTestSimulate( Gia_Man_t * p, int nWords )
int
i
;
Gia_ManRandom
(
1
);
Gia_ParTestAlloc
(
p
,
nWords
);
Gia_ParTestSimulateInit
(
p
);
Gia_ManForEachObj
(
p
,
pObj
,
i
)
Gia_ParTestSimulateObj
(
p
,
i
);
Gia_ParComputeSignature
(
p
,
nWords
);
printf
(
" "
);
Gia_ParTestFree
(
p
);
}
...
...
@@ -189,7 +225,6 @@ void * Gia_ParWorkerThread( void * pArg )
}
assert
(
pThData
->
Id
>=
0
);
Gia_ParTestSimulateObj
(
pThData
->
p
,
pThData
->
Id
);
// printf( "Simulated %d \n", pThData->Id ); fflush( stdout );
pThData
->
Status
=
0
;
}
assert
(
Counter
!=
0
);
...
...
@@ -204,10 +239,11 @@ void Gia_ParTestSimulate2( Gia_Man_t * p, int nWords, int nProcs )
int
i
,
k
,
iFan
,
status
,
nCountFanins
;
Gia_ManRandom
(
1
);
Gia_ParTestAlloc
(
p
,
nWords
);
Gia_ParTestSimulateInit
(
p
);
// start the stack
vStack
=
Vec_IntAlloc
(
1000
);
for
(
i
=
Vec_IntSize
(
p
->
vCis
)
-
1
;
i
>=
0
;
i
--
)
Vec_IntPush
(
vStack
,
Vec_IntEntry
(
p
->
vCis
,
i
)
);
Vec_IntForEachEntryReverse
(
p
->
vCis
,
iFan
,
i
)
Vec_IntPush
(
vStack
,
iFan
);
Vec_IntPush
(
vStack
,
0
);
Gia_ManStaticFanoutStart
(
p
);
vFanins
=
Gia_ManCreateFaninCounts
(
p
);
...
...
@@ -266,6 +302,7 @@ void Gia_ParTestSimulate2( Gia_Man_t * p, int nWords, int nProcs )
}
for
(
i
=
0
;
i
<
nProcs
;
i
++
)
{
assert
(
ThData
[
i
].
Status
==
0
);
// printf( "Stopping %d\n", i ); fflush( stdout );
ThData
[
i
].
Id
=
-
1
;
ThData
[
i
].
Status
=
1
;
...
...
@@ -273,6 +310,7 @@ void Gia_ParTestSimulate2( Gia_Man_t * p, int nWords, int nProcs )
Gia_ManStaticFanoutStop
(
p
);
Vec_IntFree
(
vStack
);
Vec_IntFree
(
vFanins
);
Gia_ParComputeSignature
(
p
,
nWords
);
printf
(
" "
);
Gia_ParTestFree
(
p
);
}
...
...
@@ -293,10 +331,10 @@ void Gia_ParTest( Gia_Man_t * p, int nWords, int nProcs )
abctime
clk
=
Abc_Clock
();
printf
(
"Trying with %d words and %d procs.
\n
"
,
nWords
,
nProcs
);
printf
(
"Memory usage = %.2f MB
\n
"
,
(
8
.
0
*
nWords
*
Gia_ManObjNum
(
p
))
/
(
1
<<
20
)
);
Gia_ParTestSimulate
(
p
,
nWord
s
);
Gia_ParTestSimulate
2
(
p
,
nWords
,
nProc
s
);
Abc_PrintTime
(
1
,
"Time"
,
Abc_Clock
()
-
clk
);
clk
=
Abc_Clock
();
Gia_ParTestSimulate
2
(
p
,
nWords
,
nProc
s
);
Gia_ParTestSimulate
(
p
,
nWord
s
);
Abc_PrintTime
(
1
,
"Time"
,
Abc_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