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

Last change on this file since 77 was 77, checked in by rosiere, 16 years ago
  • Add two component :
    • network between read unit and execute unit
    • network between execute unit and write unit
  • remove parameters "nb_operation" and "nb_type"
  • in write_queue add the special case : load_speculative
File size: 4.8 KB
Line 
1/*
2 * $Id$
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  std::string Parameters::msg_error(void)
24  {
25    log_printf(FUNC,Read_unit_to_Execution_unit,FUNCTION,"Begin");
26
27    std::string msg = "";
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_DIV |     X     |            |            | div is optionnal
36    // TYPE_EXTEND  |     X     |     X      |            |
37    // TYPE_FIND    |     X     |     X      |            |
38    // TYPE_SPECIAL |           |            |            | mac unit is optionnal
39    // TYPE_CUSTOM  |           |     X      |            |
40    // TYPE_BRANCH  |     X     |            |            |
41    // TYPE_MEMORY  |           |            |     X      |
42   
43    bool type_valid     [_nb_type];
44    bool type_uniq      [_nb_type]; // one thread can have multiple destination for this type ?
45    bool type_optionnal [_nb_type]; // this type is optionnal ?
46    bool type_exclusive [_nb_type]; // a unit that implement this type must be implement an another type ?
47
48    for (Ttype_t i=0; i<_nb_type; i++)
49      {
50        type_valid     [i] = false;
51        type_uniq      [i] = false;
52        type_optionnal [i] = false;
53        type_exclusive [i] = false;
54      }
55
56    type_valid     [TYPE_ALU    ] = true;
57    type_valid     [TYPE_SHIFT  ] = true;
58    type_valid     [TYPE_MOVE   ] = true;
59    type_valid     [TYPE_TEST   ] = true;
60    type_valid     [TYPE_MUL_DIV] = true;
61    type_valid     [TYPE_EXTEND ] = true;
62    type_valid     [TYPE_FIND   ] = true;
63    type_valid     [TYPE_SPECIAL] = true;
64    type_valid     [TYPE_CUSTOM ] = true;
65    type_valid     [TYPE_BRANCH ] = true;
66    type_valid     [TYPE_MEMORY ] = true;
67
68    type_uniq      [TYPE_SPECIAL] = true;
69    type_uniq      [TYPE_CUSTOM ] = true;
70    type_uniq      [TYPE_MEMORY ] = true;
71
72    type_optionnal [TYPE_EXTEND ] = true;
73    type_optionnal [TYPE_FIND   ] = true;
74    type_optionnal [TYPE_CUSTOM ] = true;
75
76    type_exclusive [TYPE_MEMORY ] = true;
77
78    bool type_present [_nb_thread][_nb_type];
79    for (uint32_t i=0; i<_nb_thread; i++)
80      for (Ttype_t j=0; j<_nb_type; j++)
81        type_present [i][j] = false;
82   
83    for (uint32_t i=0; i<_nb_execute_unit; i++)
84      for (uint32_t j=0; j<_nb_thread; j++)
85        if (_table_execute_thread [i][j] == true)
86          // this execute_unit execute this thread !
87          for (Ttype_t k=0; k<=_nb_type; k++)
88            if (_table_execute_type[i][k] == true)
89              {
90                // Test uniq type
91                if (type_present [j][k] and type_uniq[k])
92                  msg += "  - The execute_unit '"+toString(i)+"' can execute operation of type '"+toString_type(k)+"' at the thread '"+toString(j)+"'. But an another execute_unit can be execute the same type for the same thread. And the type must be uniq !.\n";
93               
94                type_present [j][k] = true;
95              }
96
97    for (Ttype_t j=0; j<_nb_type; j++)
98      if (type_valid [j] and not type_optionnal[j])
99        for (uint32_t i=0; i<_nb_thread; i++)
100          if (not type_present [i][j])
101            msg += "  - The thread '"+toString(i)+"' can't access at the execute_unit to execute the type's operation '"+toString_type(j)+"' (and this type is not optionnal !).\n";
102           
103    // Test all excluve type
104    for (uint32_t i=0; i<_nb_execute_unit; i++)
105      for (Ttype_t j=0; j<=_nb_type; j++)
106        if (type_exclusive [j] and _table_execute_type[i][j])
107          for (Ttype_t k=0; k<=_nb_type; k++)
108            if ((j != k) and (_table_execute_type[i][k] == true))
109              {
110                msg += "  - The execute_unit ["+toString(i)+"] implement the type '"+toString_type(j)+"', and this type is exclusive with all others type.\n";
111                break;
112              }
113
114    for (uint32_t i=0; i<_nb_execute_unit; i++)
115      {
116        uint32_t j;
117        for (j=0; j<_nb_thread; j++)
118          if (_table_execute_thread [i][j] == true)
119            break;
120
121        if (j == _nb_thread)
122          msg += "  - The execute_unit ["+toString(i)+"] have none source's thread.\n";
123      }   
124   
125    return msg;
126
127    log_printf(FUNC,Read_unit_to_Execution_unit,FUNCTION,"End");
128  };
129
130}; // end namespace read_unit_to_execution_unit
131}; // end namespace network
132}; // end namespace execute_loop
133}; // end namespace multi_execute_loop
134}; // end namespace core
135
136}; // end namespace behavioural
137}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.