source: trunk/platforms/caba-ring-ccxcachev4_memcachev4-mips32el/soft/benchmark/benchmark.c @ 140

Last change on this file since 140 was 140, checked in by kane, 13 years ago

yAjout du multi_cache : plusieurs processeur peuvent ce partager le même cache L1.
2 remarques, (1) deux nouveaux paramètres : nb_cpu, nb_cache. Pour avoir un cache dont le comportement est identique à la version d'avant, mettre ces paramètres à 1.
(2) le port d'interruption est maintenant un tableau dépendant du nombre de processeur.
Voir le fichier "platforms/caba-ring-ccxcachev4_memcachev4-mips32el/top.cpp" pour plus de détails.

--Cette ligne, et les suivantes ci-dessous, seront ignorées--

M platforms/tsarv4_dspin_generic_32/tsarv4_dspin_generic_32_top.cpp
M platforms/caba-ring-ccxcachev4_memcachev4-mips32el/segmentation.h
M platforms/caba-ring-ccxcachev4_memcachev4-mips32el/top.cpp
M platforms/caba-ring-ccxcachev4_memcachev4-mips32el/configuration/default.cfg
M platforms/caba-ring-ccxcachev4_memcachev4-mips32el/configuration/gen_config.sh
M platforms/caba-ring-ccxcachev4_memcachev4-mips32el/soft/dhrystone/dhry21a.c
M platforms/caba-ring-ccxcachev4_memcachev4-mips32el/soft/define.h
M platforms/caba-ring-ccxcachev4_memcachev4-mips32el/soft/matrix_multiplication/matrix_multiplication.c
M platforms/caba-ring-ccxcachev4_memcachev4-mips32el/soft/common/common.c
A platforms/caba-ring-ccxcachev4_memcachev4-mips32el/soft/self_code_modifying
A platforms/caba-ring-ccxcachev4_memcachev4-mips32el/soft/self_code_modifying/self_code_modifying.c
A platforms/caba-ring-ccxcachev4_memcachev4-mips32el/soft/self_code_modifying/self_code_modifying.h
M platforms/caba-ring-ccxcachev4_memcachev4-mips32el/soft/benchmark/benchmark.h
M platforms/caba-ring-ccxcachev4_memcachev4-mips32el/soft/benchmark/benchmark_sort.c
A platforms/caba-ring-ccxcachev4_memcachev4-mips32el/soft/benchmark/benchmark_self_code_modifying.c
M platforms/caba-ring-ccxcachev4_memcachev4-mips32el/soft/benchmark/benchmark.c
M platforms/caba-ring-ccxcachev4_memcachev4-mips32el/soft/benchmark/benchmark_matrix_multiplication.c
M platforms/caba-ring-ccxcachev4_memcachev4-mips32el/soft/Makefile
M platforms/caba-ring-ccxcachev4_memcachev4-mips32el/Makefile
M platforms/tsarv4_vgmn_generic_32/tsarv4_vgmn_generic_32_top.cpp
M modules/vci_cc_xcache_wrapper_v4/caba/source/include/vci_cc_xcache_wrapper_v4.h
M modules/vci_cc_xcache_wrapper_v4/caba/source/src/vci_cc_xcache_wrapper_v4.cpp
M modules/vci_mem_cache_v4/caba/source/include/vci_mem_cache_v4.h
M modules/vci_mem_cache_v4/caba/source/include/mem_cache_directory_v4.h
M modules/vci_mem_cache_v4/caba/source/src/vci_mem_cache_v4.cpp

File size: 2.9 KB
Line 
1#include "benchmark.h"
2#include "system.h"
3#include "stdio.h"
4#include "../common/common.h"
5
6void benchmark (void)
7{
8  int result      = 0;
9  int num_cpu     = procnum();
10  int cycle_begin = cycle_begin = cpu_cycles();
11 
12  if (num_cpu < BENCHMARK_NB_THREAD)
13   switch (num_cpu)
14     {
15     default :
16        {
17#if BENCHMARK_MATRIX_MULTIPLICATION_MT
18          int result_mm_mt = benchmark_matrix_multiplication_mt();
19          result += result_mm_mt;
20#endif
21#if BENCHMARK_DHRYSTONE
22          int result_dhrystone = benchmark_dhrystone();
23          result += result_dhrystone;
24#endif
25#if BENCHMARK_SORT_ALL
26          int result_sort_all = benchmark_sort_all();
27          result += result_sort_all;
28#endif
29#if BENCHMARK_SORT_BUBBLE
30          int result_sort_bubble = benchmark_sort_bubble();
31          result += result_sort_bubble;
32#endif
33#if BENCHMARK_SORT_INSERTION
34          int result_sort_insertion = benchmark_sort_insertion();
35          result += result_sort_insertion;
36#endif
37#if BENCHMARK_SORT_SELECTION
38          int result_sort_selection = benchmark_sort_selection();
39          result += result_sort_selection;
40#endif
41#if BENCHMARK_SORT_SHELL
42          int result_sort_shell = benchmark_sort_shell();
43          result += result_sort_shell;
44#endif
45#if BENCHMARK_MATRIX_MULTIPLICATION_ST
46          int result_mm_st = benchmark_matrix_multiplication_st();
47          result += result_mm_st;
48#endif
49#if BENCHMARK_SELF_CODE_MODIFYING
50          int result_self_code_modifying = benchmark_self_code_modifying();
51          result += result_self_code_modifying;
52#endif
53         
54          printf("\n");
55          printf("--------------------------------\n");
56          printf( "Partial results :\n");
57#if BENCHMARK_MATRIX_MULTIPLICATION_MT
58          printf(" * MM MT               : %d\n",result_mm_mt);
59#endif
60#if BENCHMARK_DHRYSTONE
61          printf(" * DHRYSTONE           : %d\n",result_dhrystone);
62#endif
63#if BENCHMARK_SORT_ALL
64          printf(" * SORT_ALL            : %d\n",result_sort_all);
65#endif
66#if BENCHMARK_SORT_BUBBLE
67          printf(" * SORT_BUBBLE         : %d\n",result_sort_bubble);
68#endif
69#if BENCHMARK_SORT_INSERTION
70          printf(" * SORT_INSERTION      : %d\n",result_sort_insertion);
71#endif
72#if BENCHMARK_SORT_SELECTION
73          printf(" * SORT_SELECTION      : %d\n",result_sort_selection);
74#endif
75#if BENCHMARK_SORT_SHELL
76          printf(" * SORT_SHELL          : %d\n",result_sort_shell);
77#endif
78#if BENCHMARK_MATRIX_MULTIPLICATION_ST
79          printf(" * MM ST               : %d\n",result_mm_st);
80#endif
81#if BENCHMARK_SELF_CODE_MODIFYING
82          printf(" * SELF_CODE_MODIFYING : %d\n",result_self_code_modifying);
83#endif
84          printf("--------------------------------\n");
85          break;
86        }
87      }
88
89  printf("\n");
90  printf("================================\n");
91  printf( "Results :\n");
92  printf( " * Score           : %d\n", result);
93  printf( " * Total CPU Cycle : %d\n", cpu_cycles()-cycle_begin);
94  printf("================================\n");
95}
Note: See TracBrowser for help on using the repository browser.