Ignore:
Timestamp:
Mar 9, 2011, 4:11:43 PM (13 years ago)
Author:
kane
Message:

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

Location:
trunk/platforms/caba-ring-ccxcachev4_memcachev4-mips32el/soft
Files:
4 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/platforms/caba-ring-ccxcachev4_memcachev4-mips32el/soft/Makefile

    r134 r140  
    1 ADD_OBJS        =       stdio.o stdlib.o exception.o system.o \
    2                         $(patsubst %.c,%.o,$(wildcard *.c)) \
    3                         $(patsubst common/%.c,common/%.o,$(wildcard common/*.c)) \
    4                         $(patsubst irq/%.c,irq/%.o,$(wildcard irq/*.c)) \
    5                         $(patsubst benchmark/%.c,benchmark/%.o,$(wildcard benchmark/*.c)) \
     1ADD_OBJS        =       \
     2                        $(patsubst self_code_modifying/%.c,self_code_modifying/%.o,$(wildcard self_code_modifying/*.c))  \
    63                        $(patsubst matrix_multiplication/%.c,matrix_multiplication/%.o,$(wildcard matrix_multiplication/*.c)) \
    74                        $(patsubst sort/%.c,sort/%.o,$(wildcard sort/*.c)) \
    8                         $(patsubst dhrystone/%.c,dhrystone/%.o,$(wildcard dhrystone/*.c))
     5                        $(patsubst dhrystone/%.c,dhrystone/%.o,$(wildcard dhrystone/*.c)) \
     6                        $(patsubst benchmark/%.c,benchmark/%.o,$(wildcard benchmark/*.c)) \
     7                        $(patsubst irq/%.c,irq/%.o,$(wildcard irq/*.c)) \
     8                        $(patsubst common/%.c,common/%.o,$(wildcard common/*.c)) \
     9                        $(patsubst %.c,%.o,$(wildcard *.c)) \
     10                        stdio.o stdlib.o exception.o system.o
     11
    912
    1013ADD_CFLAGS      =
     14ADD_LDFLAGS     =
    1115SOCLIB          ?=      $(shell soclib-cc --getpath)
    1216
  • trunk/platforms/caba-ring-ccxcachev4_memcachev4-mips32el/soft/benchmark/benchmark.c

    r134 r140  
    66void benchmark (void)
    77{
    8   /* if(procnum() != 0) */
    9   /*   EXIT(0); */
    10 
    11   int result = 0;
     8  int result      = 0;
     9  int num_cpu     = procnum();
    1210  int cycle_begin = cycle_begin = cpu_cycles();
    13 
    14   switch (procnum())
    15     {
    16     default :
    17       {
     11 
     12  if (num_cpu < BENCHMARK_NB_THREAD)
     13   switch (num_cpu)
     14     {
     15     default :
     16        {
    1817#if BENCHMARK_MATRIX_MULTIPLICATION_MT
    19         int result_mm_mt = benchmark_matrix_multiplication_mt();
    20         result += result_mm_mt;
     18          int result_mm_mt = benchmark_matrix_multiplication_mt();
     19          result += result_mm_mt;
    2120#endif
    2221#if BENCHMARK_DHRYSTONE
    23         int result_dhrystone = benchmark_dhrystone();
    24         result += result_dhrystone;
     22          int result_dhrystone = benchmark_dhrystone();
     23          result += result_dhrystone;
    2524#endif
    26 #if BENCHMARK_SORT
    27         int result_sort = benchmark_sort();
    28         result += result_sort;
     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;
    2944#endif
    3045#if BENCHMARK_MATRIX_MULTIPLICATION_ST
    31         int result_mm_st = benchmark_matrix_multiplication_st();
    32         result += result_mm_st;
     46          int result_mm_st = benchmark_matrix_multiplication_st();
     47          result += result_mm_st;
    3348#endif
    34 
    35         printf("\n");
    36         printf("--------------------------------\n");
    37         printf( "Partial results :\n");
     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");
    3857#if BENCHMARK_MATRIX_MULTIPLICATION_MT
    39         printf(" * MM MT           : %d\n",result_mm_mt);
     58          printf(" * MM MT               : %d\n",result_mm_mt);
    4059#endif
    4160#if BENCHMARK_DHRYSTONE
    42         printf(" * DHRYSTONE       : %d\n",result_dhrystone);
     61          printf(" * DHRYSTONE           : %d\n",result_dhrystone);
    4362#endif
    44 #if BENCHMARK_SORT
    45         printf(" * SORT            : %d\n",result_sort);
     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);
    4677#endif
    4778#if BENCHMARK_MATRIX_MULTIPLICATION_ST
    48         printf(" * MM ST           : %d\n",result_mm_st);
     79          printf(" * MM ST               : %d\n",result_mm_st);
    4980#endif
    50         printf("--------------------------------\n");
    51        break;
     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        }
    5287      }
    53     }
    5488
    5589  printf("\n");
  • trunk/platforms/caba-ring-ccxcachev4_memcachev4-mips32el/soft/benchmark/benchmark.h

    r134 r140  
    55
    66void benchmark                         (void);
    7 int  benchmark_sort                    (void);
     7int  benchmark_sort_all                (void);
     8int  benchmark_sort_bubble             (void);
     9int  benchmark_sort_insert             (void);
     10int  benchmark_sort_selection          (void);
     11int  benchmark_sort_shell              (void);
    812int  benchmark_dhrystone               (void);
    913int  benchmark_matrix_multiplication_st(void);
  • trunk/platforms/caba-ring-ccxcachev4_memcachev4-mips32el/soft/benchmark/benchmark_matrix_multiplication.c

    r134 r140  
    127127  /* matrix_multiplication_print(matrix_local_d, size); */
    128128 
     129#if VERIFICATION_MATRIX_MULTIPLICATION
    129130  printf(" * Verification... ");
    130131 
    131132  benchmark_matrix_validation (matrix_local_d, size);
     133#endif
    132134 
    133135  printf(" * Free...\n");
     
    230232  if (matrix_nb_thread_stop == matrix_nb_thread_start)
    231233    {
     234#if VERIFICATION_MATRIX_MULTIPLICATION
    232235      printf(" * Verification... ");
    233236
    234237      benchmark_matrix_validation (matrix_global_d, size);
     238#endif
    235239     
    236240      printf(" * Free...\n");
  • trunk/platforms/caba-ring-ccxcachev4_memcachev4-mips32el/soft/benchmark/benchmark_sort.c

    r134 r140  
    99static uint32_t sort_lock;
    1010
    11 int _benchmark_sort (unsigned int size)
     11int _benchmark_sort (sort_t sort_type,
     12                     unsigned int size)
     13{
     14  printf(" * Size : %d\n",size);
     15
     16  unsigned int* SortArray;
     17 
     18  int cycle_begin;
     19
     20  int num_cpu=procnum();
     21 
     22  printf(" * Algo : %s\n",sort_str(sort_type));
     23 
     24  printf("   * Init...\n");
     25 
     26  lock_lock(&sort_lock);
     27  SortArray = (unsigned int*) malloc(size*sizeof(unsigned int));
     28  lock_unlock(&sort_lock);
     29 
     30  unsigned int seed = num_cpu;
     31  int i;
     32  for (i=0; i<size; ++i)
     33    {
     34      seed = seed * 1103515245 + 12345;
     35      SortArray[i] = seed&0xff;
     36    }
     37  printf("   * Sort... \n");
     38 
     39  cycle_begin = cpu_cycles();
     40  sort((unsigned int *) (SortArray), (unsigned int) size, sort_type);
     41  int cycle_exec = cpu_cycles()-cycle_begin;
     42 
     43  printf("   * Executed in %d cycles\n",cycle_exec);
     44 
     45  int result = cycle_exec;
     46 
     47#if VERIFICATION_SORT     
     48  printf("   * Verification... ");
     49 
     50  for (i = 1; i < size; i++)
     51    {
     52      /* printf("%d ",SortArray[i-1]); */
     53     
     54      if (SortArray[i] < SortArray[i-1])
     55        {
     56          printf("KO !!!\n");
     57          EXIT(1);
     58        }
     59    }
     60  printf("OK\n");
     61#endif
     62 
     63  free (SortArray);
     64
     65  return result;
     66}
     67
     68int _benchmark_sort_all (unsigned int size)
     69{
     70  printf("\n");
     71  printf("================================\n");
     72  printf("Benchmark Sort (ALL)\n");
     73  printf("================================\n");
     74  printf("\n");
     75
     76  int result = 0;
     77  int num_cpu=procnum();
     78  sort_t _sort_type;
     79  const sort_t nb_sort_type = 4;
     80 
     81  for (_sort_type=0; _sort_type < nb_sort_type; _sort_type++)
     82    result += _benchmark_sort((_sort_type+num_cpu)%nb_sort_type,size);
     83 
     84  return result;
     85}
     86
     87int _benchmark_sort_one (sort_t sort_type,
     88                         unsigned int size)
    1289{
    1390  printf("\n");
     
    1794  printf("\n");
    1895
    19   printf(" * Size : %d\n",size);
    20 
    21   unsigned int* SortArray;
    22  
    23   int cycle_begin, result;
    24 
    25   result = 0;
    26  
    27   int p=procnum();
    28  
    29   sort_t _sort_type;
    30   const sort_t nb_sort_type = 4;
    31  
    32   for (_sort_type=0; _sort_type < nb_sort_type; _sort_type++)
    33     {
    34       sort_t sort_type = (_sort_type+p)%nb_sort_type;
    35      
    36       printf(" * Algo : %s\n",sort_str(sort_type));
    37      
    38       printf("   * Init...\n");
    39      
    40       lock_lock(&sort_lock);
    41       SortArray = (unsigned int*) malloc(size*sizeof(unsigned int));
    42       lock_unlock(&sort_lock);
    43      
    44       unsigned int seed = p;
    45       int i;
    46       for (i=0; i<size; ++i)
    47         {
    48           seed = seed * 1103515245 + 12345;
    49           SortArray[i] = seed&0xff;
    50         }
    51       printf("   * Sort... \n");
    52      
    53       cycle_begin = cpu_cycles();
    54       sort((unsigned int *) (SortArray), (unsigned int) size, sort_type);
    55       int cycle_exec = cpu_cycles()-cycle_begin;
    56      
    57       printf("   * Executed in %d cycles\n",cycle_exec);
    58      
    59       result += cycle_exec;
    60      
    61       printf("   * Verification... ");
    62      
    63       for (i = 1; i < size; i++)
    64         {
    65           /* printf("%d ",SortArray[i-1]); */
    66          
    67           if (SortArray[i] < SortArray[i-1])
    68             {
    69               printf("KO !!!\n");
    70               EXIT(1);
    71             }
    72         }
    73       printf("OK\n");
    74 
    75       free (SortArray);
    76 
    77     }
    78  
    79   return result;
     96  return _benchmark_sort(sort_type,size);
    8097}
    8198
    82 int benchmark_sort (void) { return _benchmark_sort(SORT_SIZE); }
    83 
    84  
     99int benchmark_sort_all       (void) { return _benchmark_sort_all(SORT_ALL_SIZE); }
     100int benchmark_sort_bubble    (void) { return _benchmark_sort_one(SORT_BUBBLE   ,SORT_BUBBLE_SIZE   ); }
     101int benchmark_sort_insertion (void) { return _benchmark_sort_one(SORT_INSERTION,SORT_INSERTION_SIZE); }
     102int benchmark_sort_selection (void) { return _benchmark_sort_one(SORT_SELECTION,SORT_SELECTION_SIZE); }
     103int benchmark_sort_shell     (void) { return _benchmark_sort_one(SORT_SHELL    ,SORT_SHELL_SIZE    ); }
  • trunk/platforms/caba-ring-ccxcachev4_memcachev4-mips32el/soft/common/common.c

    r134 r140  
    4141    }
    4242
     43  pause();
     44 
    4345  while(1);
    4446}
  • trunk/platforms/caba-ring-ccxcachev4_memcachev4-mips32el/soft/define.h

    r134 r140  
    33
    44// List of benchmark
     5#define BENCHMARK_NB_THREAD                   4
     6
    57#define BENCHMARK_DHRYSTONE                   0
    6 #define BENCHMARK_SORT                        0
     8#define BENCHMARK_SORT_ALL                    0
     9#define BENCHMARK_SORT_BUBBLE                 0
     10#define BENCHMARK_SORT_INSERTION              0
     11#define BENCHMARK_SORT_SELECTION              0
     12#define BENCHMARK_SORT_SHELL                  1
    713#define BENCHMARK_MATRIX_MULTIPLICATION_ST    0
    8 #define BENCHMARK_MATRIX_MULTIPLICATION_MT    1
     14#define BENCHMARK_MATRIX_MULTIPLICATION_MT    0
     15#define BENCHMARK_SELF_CODE_MODIFYING         0
    916
    1017#define VERBOSE_SORT                          0
    1118
     19#define VERIFICATION_SORT                     0
     20#define VERIFICATION_MATRIX_MULTIPLICATION    0
     21
    1222// Benchmark size
    1323#define DHRYSTONE_NB_RUNS                     5000
    14 #define SORT_SIZE                             850
     24#define SORT_ALL_SIZE                         1000
     25#define SORT_BUBBLE_SIZE                      1500
     26#define SORT_INSERTION_SIZE                   2300
     27#define SORT_SELECTION_SIZE                   1600
     28#define SORT_SHELL_SIZE                       4000
    1529#define MATRIX_MULTIPLICATION_ST_SIZE         50
    16 #define MATRIX_MULTIPLICATION_MT_SIZE         75
     30#define MATRIX_MULTIPLICATION_MT_SIZE         96
    1731#define MATRIX_MULTIPLICATION_MT_LOCK_BY_LINE 1
     32#define SELF_CODE_MODIFYING_NB_RUNS           10
    1833
    1934// Timer configuration
  • trunk/platforms/caba-ring-ccxcachev4_memcachev4-mips32el/soft/dhrystone/dhry21a.c

    r134 r140  
    7676  DOUBLE   dtime();
    7777
    78         One_Fifty       Int_1_Loc;
    79   REG   One_Fifty       Int_2_Loc;
     78        One_Fifty       Int_1_Loc = 0;
     79  REG   One_Fifty       Int_2_Loc = 0;
    8080        One_Fifty       Int_3_Loc;
    8181  REG   char            Ch_Index;
  • trunk/platforms/caba-ring-ccxcachev4_memcachev4-mips32el/soft/matrix_multiplication/matrix_multiplication.c

    r134 r140  
    22#include "stdio.h"
    33#include "system.h"
     4#include "stdint.h"
    45
    56void matrix_multiplication_st (int ** a,
     
    89                               unsigned int n)
    910{
    10   int x, y;
     11  uint32_t x, y;
    1112
    1213  for (x=0; x<n; ++x)
     
    1617      for (y=0; y<n; ++y)
    1718        {
    18           int i;
     19          uint32_t i;
    1920
    2021          int tmp = 0;
     
    2829}
    2930
    30 static int lock;
    31 static int next;
     31static uint32_t lock;
     32static uint32_t next;
    3233
    3334void matrix_multiplication_mt (int ** a,
     
    3738                               int lock_by_line)
    3839{
    39   int x, y;
     40  uint32_t x, y;
    4041
    4142  while (1)
Note: See TracChangeset for help on using the changeset viewer.