source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Dcache_Access/src/Parameters_msg_error.cpp @ 128

Last change on this file since 128 was 128, checked in by rosiere, 15 years ago

1) Correct bug in link two signal
2) Fix error detected with valgrind
3) modif distexe script

  • Property svn:keywords set to Id
File size: 2.3 KB
Line 
1/*
2 * $Id: Parameters_msg_error.cpp 128 2009-06-26 08:43:23Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/include/Types.h"
9#include "Behavioural/Core/Dcache_Access/include/Parameters.h"
10#include <sstream>
11
12namespace morpheo                    {
13namespace behavioural {
14namespace core {
15namespace dcache_access {
16
17
18#undef  FUNCTION
19#define FUNCTION "Dcache_Access::msg_error"
20  Parameters_test Parameters::msg_error(void)
21  {
22    log_begin(Dcache_Access,FUNCTION);
23
24    Parameters_test test ("Dcache_Access");
25
26    bool have_link [_nb_dcache_port];
27    for (uint32_t i=0; i<_nb_dcache_port; i++)
28      have_link [i] = 0;
29   
30    for (uint32_t i=0; i<_nb_execute_loop; i++)
31      for (uint32_t j=0; j<_nb_load_store_unit [i]; ++j)
32        for (uint32_t k=0; k<_nb_cache_access [i][j]; ++k)
33          if (_table_routing [i][j][k] >= _nb_dcache_port)
34            test.error(toString(_("table_routing [%d][%d][%d] : invalid value, must be < nb_dcache_port.\n"),i,j,k));
35          else
36            have_link [_table_routing [i][j][k]] = true;
37   
38    for (uint32_t i=0; i<_nb_dcache_port; i++)
39      if (not have_link [i])
40        test.error(toString(_("Port[%d] is not linked.\n"),i));
41
42    bool thread_link [_nb_thread];
43    for (uint32_t i=0; i<_nb_thread; ++i)
44      thread_link [i] = false;
45   
46    for (uint32_t i=0; i<_nb_execute_loop; i++)
47      for (uint32_t j=0; j<_nb_load_store_unit [i]; j++)
48        for (uint32_t k=0; k<_nb_context[i]; k++)
49          {
50            uint32_t num_thread = _translate_load_store_unit_to_thread [i][j][k];
51
52            if (num_thread != _nb_thread)
53              thread_link [num_thread] = true;
54
55//             if (num_thread >= _nb_thread)
56//               test.error(toString(_("Context [%d][%d][%d] is linked with an invalid thread id.\n"),i,j,k));
57//             else
58//               if (thread_link [num_thread] == true)
59//                 test.error(toString(_("Context [%d][%d][%d] is linked with an already used thread id.\n"),i,j,k));
60//               else
61//                 thread_link [num_thread] = true;
62          }
63
64    for (uint32_t i=0; i<_nb_thread; ++i)
65      if (not thread_link [i])
66        test.error(toString(_("Thread [%d] is not linked.\n"),i));
67
68    log_end(Dcache_Access,FUNCTION);
69
70    return test;
71  };
72
73}; // end namespace dcache_access
74}; // end namespace core
75
76}; // end namespace behavioural
77}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.