Last change
on this file since 54 was
50,
checked in by rosiere, 17 years ago
|
Changement dans le répertoire "New_Component" afin que les composants nouvellement crées peuvent compiler
|
File size:
1.1 KB
|
Line | |
---|
1 | /* |
---|
2 | * $Id$ |
---|
3 | * |
---|
4 | * [ Description ] |
---|
5 | * |
---|
6 | * Test "RegisterFile" |
---|
7 | */ |
---|
8 | |
---|
9 | #ifdef SYSTEMC |
---|
10 | #include "systemc.h" |
---|
11 | #endif |
---|
12 | |
---|
13 | #include <string> |
---|
14 | #include <iostream> |
---|
15 | #include <sys/time.h> |
---|
16 | |
---|
17 | #include "Behavioural/@DIRECTORY/include/@COMPONENT.h" |
---|
18 | |
---|
19 | using namespace std; |
---|
20 | using namespace morpheo; |
---|
21 | using namespace morpheo::behavioural; |
---|
22 | @NAMESPACE_USING |
---|
23 | using namespace morpheo::behavioural::@NAMESPACE_USE; |
---|
24 | |
---|
25 | void test (string name, |
---|
26 | morpheo::behavioural::@NAMESPACE_USE::Parameters * param); |
---|
27 | |
---|
28 | class Time |
---|
29 | { |
---|
30 | private : timeval time_begin; |
---|
31 | // private : timeval time_end; |
---|
32 | |
---|
33 | public : Time () |
---|
34 | { |
---|
35 | gettimeofday(&time_begin ,NULL); |
---|
36 | }; |
---|
37 | |
---|
38 | public : ~Time () |
---|
39 | { |
---|
40 | cout << *this; |
---|
41 | }; |
---|
42 | |
---|
43 | public : friend ostream& operator<< (ostream& output_stream, |
---|
44 | const Time & x) |
---|
45 | { |
---|
46 | timeval time_end; |
---|
47 | |
---|
48 | gettimeofday(&time_end ,NULL); |
---|
49 | |
---|
50 | uint32_t nb_cycles = static_cast<uint32_t>(sc_simulation_time()); |
---|
51 | |
---|
52 | double average = static_cast<double>(nb_cycles) / static_cast<double>(time_end.tv_sec-x.time_begin.tv_sec); |
---|
53 | |
---|
54 | output_stream << nb_cycles << "\t(" << average << " cycles / seconds )" << endl; |
---|
55 | |
---|
56 | return output_stream; |
---|
57 | } |
---|
58 | }; |
---|
Note: See
TracBrowser
for help on using the repository browser.