source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Network/Execution_unit_to_Write_unit/src/Execution_unit_to_Write_unit_transition.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: 2.5 KB
Line 
1#ifdef SYSTEMC
2/*
3 * $Id$
4 *
5 * [ Description ]
6 *
7 */
8
9#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Network/Execution_unit_to_Write_unit/include/Execution_unit_to_Write_unit.h"
10
11namespace morpheo                    {
12namespace behavioural {
13namespace core {
14namespace multi_execute_loop {
15namespace execute_loop {
16namespace network {
17namespace execution_unit_to_write_unit {
18
19
20#undef  FUNCTION
21#define FUNCTION "Execution_unit_to_Write_unit::transition"
22  void Execution_unit_to_Write_unit::transition (void)
23  {
24    log_printf(FUNC,Execution_unit_to_Write_unit,FUNCTION,"Begin");
25
26    if (PORT_READ(in_NRESET) == 0)
27      {
28        // Flush routing_table
29        for (uint32_t i=0; i<_param->_nb_execute_unit; i++)
30          for (uint32_t j=0; j<_param->_nb_thread; j++)
31              _destination [i][j].clear();
32       
33        // Fill routing table
34        for (uint32_t i=0; i<_param->_nb_execute_unit; i++)
35          for (uint32_t j=0; j<_param->_nb_execute_unit; j++)
36            // Test if link between src and dest
37            if (_param->_table_routing [i][j])
38              // Test the thread accepted by the execute_unit
39              for (uint32_t k=0; k<_param->_nb_thread; k++)
40                if (_param->_table_thread[j][k])
41                  // push_back == minor have a better priority
42                  _destination [i][k].push_back(j);
43      }
44    else
45      {
46        if (_param->_priority == PRIORITY_ROUND_ROBIN)
47          for (uint32_t i=0; i<_param->_nb_execute_unit; i++)
48            for (uint32_t j=0; j<_param->_nb_thread; j++)
49              if (_destination [i][j].size() > 1)
50                {
51                  // Head queue became the Tail queue
52                  _destination [i][j].push_back(_destination [i][j].front());
53                  _destination [i][j].pop_front();
54                }
55      }
56
57
58#if (DEBUG >= DEBUG_TRACE)
59    // Print
60    log_printf(TRACE,Read_unit_to_Execution_unit,FUNCTION,"Routing Table");
61    for (uint32_t i=0; i<_param->_nb_execute_unit; i++)
62      for (uint32_t j=0; j<_param->_nb_thread; j++)
63        for (std::list<uint32_t>::iterator k=_destination[i][j].begin();
64             k != _destination[i][j].end();
65             k++)
66          log_printf(TRACE,Read_unit_to_Execution_unit,FUNCTION,"  * Execute_unit [%d], send at the write_unit [%d], the operation of thread [%d].",i,*k,j);
67#endif
68
69#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
70    end_cycle ();
71#endif
72
73    log_printf(FUNC,Execution_unit_to_Write_unit,FUNCTION,"End");
74  };
75
76}; // end namespace execution_unit_to_write_unit
77}; // end namespace network
78}; // end namespace execute_loop
79}; // end namespace multi_execute_loop
80}; // end namespace core
81
82}; // end namespace behavioural
83}; // end namespace morpheo             
84#endif
Note: See TracBrowser for help on using the repository browser.