source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Network/Read_unit_to_Execution_unit/src/Parameters_msg_error.cpp @ 109

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

1) Configuration : instance configuration file : regroup similar instance
2) Configuration : timing default = 0
3) Debug/Commit_unit : Add watch dog timer
4) Issue_queue : Test parameters : add test if type is optionnal
5) Cor_glue : Fix insert index
6) Free_list : remove bank_by_pop (else deadlock)
7) Update Free List : add register to source event

  • Property svn:keywords set to Id
File size: 4.4 KB
Line 
1/*
2 * $Id: Parameters_msg_error.cpp 109 2009-02-16 20:28:31Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/include/Types.h"
9#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Network/Read_unit_to_Execution_unit/include/Parameters.h"
10#include <sstream>
11
12namespace morpheo                    {
13namespace behavioural {
14namespace core {
15namespace multi_execute_loop {
16namespace execute_loop {
17namespace network {
18namespace read_unit_to_execution_unit {
19
20
21#undef  FUNCTION
22#define FUNCTION "Read_unit_to_Execution_unit::msg_error"
23  Parameters_test Parameters::msg_error(void)
24  {
25    log_printf(FUNC,Read_unit_to_Execution_unit,FUNCTION,"Begin");
26
27    Parameters_test test ("Read_unit_to_Execution_unit");
28
29    // TYPE         | multiple? | Optionnal? | Exclusive? | Comment
30    //--------------+-----------+------------+------------+---------
31    // TYPE_ALU     |     X     |            |            |
32    // TYPE_SHIFT   |     X     |            |            | ror is optionnal
33    // TYPE_MOVE    |     X     |            |            | cmov is optionnal
34    // TYPE_TEST    |     X     |            |            |
35    // TYPE_MUL     |     X     |            |            |
36    // TYPE_DIV     |     X     |     X      |            |
37    // TYPE_EXTEND  |     X     |     X      |            |
38    // TYPE_FIND    |     X     |     X      |            |
39    // TYPE_SPECIAL |           |            |            | mac unit is optionnal
40    // TYPE_CUSTOM  |           |     X      |            |
41    // TYPE_BRANCH  |     X     |            |            |
42    // TYPE_MEMORY  |           |            |     X      |
43   
44    bool type_present [_nb_thread][_nb_type];
45    for (uint32_t i=0; i<_nb_thread; i++)
46      for (Ttype_t j=0; j<_nb_type; j++)
47        type_present [i][j] = false;
48   
49    for (uint32_t i=0; i<_nb_execute_unit; i++)
50      for (uint32_t j=0; j<_nb_thread; j++)
51        if (_table_execute_thread [i][j] == true)
52          // this execute_unit execute this thread !
53          for (Ttype_t k=0; k<_nb_type; k++)
54            if (_table_execute_type[i][k] == true)
55              {
56//                 test.information(toString(_("Execute_unit [%d], Thread [%d], Type [%d], type_valid %d, type_present %d, type_uniq %d\n"),i,j,k,type_valid[k],type_present[j][k],type_uniq[k]));
57               
58                // Test uniq type
59                if (type_present [j][k] and is_type_uniq(k))
60                  test.error(toString(_("The execute_unit '%d' can execute operation of type '%s' at the thread '%d'. But an another execute_unit can be execute the same type for the same thread. And the type must be single !.\n"),i,toString(k).c_str(),j));
61               
62                type_present [j][k] = true;
63              }
64
65    for (Ttype_t j=0; j<_nb_type; j++)
66      if (not is_type_valid(j))
67        for (uint32_t i=0; i<_nb_thread; i++)
68          if (type_present [i][j])
69            test.error(toString(_("The thread '%d' can execute the type's operation '%s' but this type is invalid.\n"),i,toString(j).c_str()));
70
71    for (Ttype_t j=0; j<_nb_type; j++)
72      if (is_type_valid(j) and not is_type_optionnal(j))
73        for (uint32_t i=0; i<_nb_thread; i++)
74          if (not type_present [i][j])
75            test.error(toString(_("The thread '%d' can't access at the execute_unit to execute the type's operation '%s' (and this type is not optional !).\n"),i,toString(j).c_str()));
76           
77    // Test all excluve type
78    for (uint32_t i=0; i<_nb_execute_unit; i++)
79      for (Ttype_t j=0; j<_nb_type; j++)
80        if (is_type_exclusive(j) and _table_execute_type[i][j])
81          for (Ttype_t k=0; k<_nb_type; k++)
82            if ((j != k) and (_table_execute_type[i][k] == true))
83              {
84                test.error(toString(_("The execute_unit [%d] implement the type '%s', and this type is exclusive with all others type.\n"),i,toString(j).c_str()));
85                break;
86              }
87
88    for (uint32_t i=0; i<_nb_execute_unit; i++)
89      {
90        uint32_t j;
91        for (j=0; j<_nb_thread; j++)
92          if (_table_execute_thread [i][j] == true)
93            break;
94
95        if (j == _nb_thread)
96          test.error(toString(_("The execute_unit [%d] have none source's thread.\n"),i));
97      }   
98
99    if ( (_priority != PRIORITY_STATIC     ) and
100         (_priority != PRIORITY_ROUND_ROBIN))
101      test.error(_("Unsupported priority scheme. It must be Static or Round Robin.\n"));
102       
103    log_printf(FUNC,Read_unit_to_Execution_unit,FUNCTION,"End");
104
105    return test;
106  };
107
108}; // end namespace read_unit_to_execution_unit
109}; // end namespace network
110}; // end namespace execute_loop
111}; // end namespace multi_execute_loop
112}; // end namespace core
113
114}; // end namespace behavioural
115}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.