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

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

1) Update Prediction Table : statistics
2) Size instruction address on 30 bits
3) Change Log File
4) Add debug_level in simulation configuration file

  • Property svn:keywords set to Id
File size: 5.7 KB
Line 
1/*
2 * $Id: Parameters_msg_error.cpp 97 2008-12-19 15:34:00Z 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_valid     [_nb_type];
45    bool type_uniq      [_nb_type]; // one thread can have multiple destination for this type ?
46    bool type_optionnal [_nb_type]; // this type is optionnal ?
47    bool type_exclusive [_nb_type]; // a unit that implement this type must be implement an another type ?
48
49    for (Ttype_t i=0; i<_nb_type; i++)
50      {
51        type_valid     [i] = false;
52        type_uniq      [i] = false;
53        type_optionnal [i] = false;
54        type_exclusive [i] = false;
55      }
56
57    type_valid     [TYPE_ALU    ] = true;
58    type_valid     [TYPE_SHIFT  ] = true;
59    type_valid     [TYPE_MOVE   ] = true;
60    type_valid     [TYPE_TEST   ] = true;
61    type_valid     [TYPE_MUL    ] = true;
62    type_valid     [TYPE_DIV    ] = true;
63    type_valid     [TYPE_EXTEND ] = true;
64    type_valid     [TYPE_FIND   ] = true;
65    type_valid     [TYPE_SPECIAL] = true;
66    type_valid     [TYPE_CUSTOM ] = true;
67    type_valid     [TYPE_BRANCH ] = true;
68    type_valid     [TYPE_MEMORY ] = true;
69
70    type_uniq      [TYPE_SPECIAL] = true;
71    type_uniq      [TYPE_CUSTOM ] = true;
72    type_uniq      [TYPE_MEMORY ] = true;
73
74    type_optionnal [TYPE_DIV    ] = true;
75    type_optionnal [TYPE_EXTEND ] = true;
76    type_optionnal [TYPE_FIND   ] = true;
77    type_optionnal [TYPE_CUSTOM ] = true;
78
79    type_exclusive [TYPE_MEMORY ] = true;
80
81    bool type_present [_nb_thread][_nb_type];
82    for (uint32_t i=0; i<_nb_thread; i++)
83      for (Ttype_t j=0; j<_nb_type; j++)
84        type_present [i][j] = false;
85   
86    for (uint32_t i=0; i<_nb_execute_unit; i++)
87      for (uint32_t j=0; j<_nb_thread; j++)
88        if (_table_execute_thread [i][j] == true)
89          // this execute_unit execute this thread !
90          for (Ttype_t k=0; k<_nb_type; k++)
91            if (_table_execute_type[i][k] == true)
92              {
93//                 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]));
94               
95                // Test uniq type
96                if (type_present [j][k] and type_uniq[k])
97                  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));
98               
99                type_present [j][k] = true;
100              }
101
102    for (Ttype_t j=0; j<_nb_type; j++)
103      if (not type_valid [j])
104        for (uint32_t i=0; i<_nb_thread; i++)
105          if (type_present [i][j])
106            test.error(toString(_("The thread '%d' can execute the type's operation '%s' but this type is invalid.\n"),i,toString(j).c_str()));
107
108    for (Ttype_t j=0; j<_nb_type; j++)
109      if (type_valid [j] and not type_optionnal[j])
110        for (uint32_t i=0; i<_nb_thread; i++)
111          if (not type_present [i][j])
112            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()));
113           
114    // Test all excluve type
115    for (uint32_t i=0; i<_nb_execute_unit; i++)
116      for (Ttype_t j=0; j<_nb_type; j++)
117        if (type_exclusive [j] and _table_execute_type[i][j])
118          for (Ttype_t k=0; k<_nb_type; k++)
119            if ((j != k) and (_table_execute_type[i][k] == true))
120              {
121                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()));
122                break;
123              }
124
125    for (uint32_t i=0; i<_nb_execute_unit; i++)
126      {
127        uint32_t j;
128        for (j=0; j<_nb_thread; j++)
129          if (_table_execute_thread [i][j] == true)
130            break;
131
132        if (j == _nb_thread)
133          test.error(toString(_("The execute_unit [%d] have none source's thread.\n"),i));
134      }   
135
136    if ( (_priority != PRIORITY_STATIC     ) and
137         (_priority != PRIORITY_ROUND_ROBIN))
138      test.error(_("Unsupported priority scheme. It must be Static or Round Robin.\n"));
139       
140    log_printf(FUNC,Read_unit_to_Execution_unit,FUNCTION,"End");
141
142    return test;
143  };
144
145}; // end namespace read_unit_to_execution_unit
146}; // end namespace network
147}; // end namespace execute_loop
148}; // end namespace multi_execute_loop
149}; // end namespace core
150
151}; // end namespace behavioural
152}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.