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
cb65ccd2
Commit
cb65ccd2
authored
Mar 14, 2014
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Experiments with simulation.
parent
eae04552
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
src/map/if/ifTest.c
+9
-6
No files found.
src/map/if/ifTest.c
View file @
cb65ccd2
...
@@ -154,7 +154,7 @@ void Gia_ParTestSimulate( Gia_Man_t * p, int nWords )
...
@@ -154,7 +154,7 @@ void Gia_ParTestSimulate( Gia_Man_t * p, int nWords )
Gia_ParTestSimulateInit
(
p
);
Gia_ParTestSimulateInit
(
p
);
Gia_ManForEachObj
(
p
,
pObj
,
i
)
Gia_ManForEachObj
(
p
,
pObj
,
i
)
Gia_ParTestSimulateObj
(
p
,
i
);
Gia_ParTestSimulateObj
(
p
,
i
);
Gia_ParComputeSignature
(
p
,
nWords
);
printf
(
" "
);
//
Gia_ParComputeSignature( p, nWords ); printf( " " );
Gia_ParTestFree
(
p
);
Gia_ParTestFree
(
p
);
}
}
...
@@ -229,7 +229,7 @@ void * Gia_ParWorkerThread( void * pArg )
...
@@ -229,7 +229,7 @@ void * Gia_ParWorkerThread( void * pArg )
}
}
assert
(
Counter
!=
0
);
assert
(
Counter
!=
0
);
assert
(
0
);
assert
(
0
);
return
(
void
*
)
Counter
;
return
NULL
;
}
}
void
Gia_ParTestSimulate2
(
Gia_Man_t
*
p
,
int
nWords
,
int
nProcs
)
void
Gia_ParTestSimulate2
(
Gia_Man_t
*
p
,
int
nWords
,
int
nProcs
)
{
{
...
@@ -237,6 +237,7 @@ void Gia_ParTestSimulate2( Gia_Man_t * p, int nWords, int nProcs )
...
@@ -237,6 +237,7 @@ void Gia_ParTestSimulate2( Gia_Man_t * p, int nWords, int nProcs )
Par_ThData_t
ThData
[
PAR_THR_MAX
];
Par_ThData_t
ThData
[
PAR_THR_MAX
];
Vec_Int_t
*
vStack
,
*
vFanins
;
Vec_Int_t
*
vStack
,
*
vFanins
;
int
i
,
k
,
iFan
,
status
,
nCountFanins
;
int
i
,
k
,
iFan
,
status
,
nCountFanins
;
assert
(
nProcs
<=
PAR_THR_MAX
);
Gia_ManRandom
(
1
);
Gia_ManRandom
(
1
);
Gia_ParTestAlloc
(
p
,
nWords
);
Gia_ParTestAlloc
(
p
,
nWords
);
Gia_ParTestSimulateInit
(
p
);
Gia_ParTestSimulateInit
(
p
);
...
@@ -249,7 +250,6 @@ void Gia_ParTestSimulate2( Gia_Man_t * p, int nWords, int nProcs )
...
@@ -249,7 +250,6 @@ void Gia_ParTestSimulate2( Gia_Man_t * p, int nWords, int nProcs )
vFanins
=
Gia_ManCreateFaninCounts
(
p
);
vFanins
=
Gia_ManCreateFaninCounts
(
p
);
nCountFanins
=
Vec_IntSum
(
vFanins
);
nCountFanins
=
Vec_IntSum
(
vFanins
);
// start the threads
// start the threads
assert
(
nProcs
<=
PAR_THR_MAX
);
for
(
i
=
0
;
i
<
nProcs
;
i
++
)
for
(
i
=
0
;
i
<
nProcs
;
i
++
)
{
{
ThData
[
i
].
p
=
p
;
ThData
[
i
].
p
=
p
;
...
@@ -310,7 +310,7 @@ void Gia_ParTestSimulate2( Gia_Man_t * p, int nWords, int nProcs )
...
@@ -310,7 +310,7 @@ void Gia_ParTestSimulate2( Gia_Man_t * p, int nWords, int nProcs )
Gia_ManStaticFanoutStop
(
p
);
Gia_ManStaticFanoutStop
(
p
);
Vec_IntFree
(
vStack
);
Vec_IntFree
(
vStack
);
Vec_IntFree
(
vFanins
);
Vec_IntFree
(
vFanins
);
Gia_ParComputeSignature
(
p
,
nWords
);
printf
(
" "
);
//
Gia_ParComputeSignature( p, nWords ); printf( " " );
Gia_ParTestFree
(
p
);
Gia_ParTestFree
(
p
);
}
}
...
@@ -328,11 +328,14 @@ void Gia_ParTestSimulate2( Gia_Man_t * p, int nWords, int nProcs )
...
@@ -328,11 +328,14 @@ void Gia_ParTestSimulate2( Gia_Man_t * p, int nWords, int nProcs )
***********************************************************************/
***********************************************************************/
void
Gia_ParTest
(
Gia_Man_t
*
p
,
int
nWords
,
int
nProcs
)
void
Gia_ParTest
(
Gia_Man_t
*
p
,
int
nWords
,
int
nProcs
)
{
{
abctime
clk
=
Abc_Clock
()
;
abctime
clk
;
printf
(
"Trying with %d words and %d
proc
s.
\n
"
,
nWords
,
nProcs
);
printf
(
"Trying with %d words and %d
thread
s.
\n
"
,
nWords
,
nProcs
);
printf
(
"Memory usage = %.2f MB
\n
"
,
(
8
.
0
*
nWords
*
Gia_ManObjNum
(
p
))
/
(
1
<<
20
)
);
printf
(
"Memory usage = %.2f MB
\n
"
,
(
8
.
0
*
nWords
*
Gia_ManObjNum
(
p
))
/
(
1
<<
20
)
);
clk
=
Abc_Clock
();
Gia_ParTestSimulate2
(
p
,
nWords
,
nProcs
);
Gia_ParTestSimulate2
(
p
,
nWords
,
nProcs
);
Abc_PrintTime
(
1
,
"Time"
,
Abc_Clock
()
-
clk
);
Abc_PrintTime
(
1
,
"Time"
,
Abc_Clock
()
-
clk
);
clk
=
Abc_Clock
();
clk
=
Abc_Clock
();
Gia_ParTestSimulate
(
p
,
nWords
);
Gia_ParTestSimulate
(
p
,
nWords
);
Abc_PrintTime
(
1
,
"Time"
,
Abc_Clock
()
-
clk
);
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