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 @ 88

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

Almost complete design
with Test and test platform

  • Property svn:keywords set to Id
File size: 2.8 KB
Line 
1#ifdef SYSTEMC
2/*
3 * $Id: Execution_unit_to_Write_unit_transition.cpp 88 2008-12-10 18:31:39Z rosiere $
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 x=0; x<_param->_nb_execute_unit; x++)
30          for (uint32_t y=0; y<_param->_nb_execute_unit_port[x]; y++)
31            for (uint32_t j=0; j<_param->_nb_thread; j++)
32              _destination [x][y][j].clear();
33       
34        // Fill routing table
35        for (uint32_t x=0; x<_param->_nb_execute_unit; x++)
36          for (uint32_t y=0; y<_param->_nb_execute_unit_port[x]; y++)
37            for (uint32_t j=0; j<_param->_nb_write_unit; j++)
38              // Test if link between src and dest
39              if (_param->_table_routing [x][y][j])
40                // Test the thread accepted by the execute_unit
41                for (uint32_t k=0; k<_param->_nb_thread; k++)
42                  if (_param->_table_thread[j][k])
43                    // push_back == minor have a better priority
44                    _destination [x][y][k].push_back(j);
45      }
46    else
47      {
48        if (_param->_priority == PRIORITY_ROUND_ROBIN)
49          for (uint32_t x=0; x<_param->_nb_execute_unit; x++)
50            for (uint32_t y=0; y<_param->_nb_execute_unit_port[x]; y++)
51              for (uint32_t j=0; j<_param->_nb_thread; j++)
52                if (_destination [x][y][j].size() > 1)
53                  {
54                    // Head queue became the Tail queue
55                    _destination [x][y][j].push_back(_destination [x][y][j].front());
56                    _destination [x][y][j].pop_front();
57                  }
58      }
59   
60   
61#if (DEBUG >= DEBUG_TRACE)
62    // Print
63    log_printf(TRACE,Read_unit_to_Execution_unit,FUNCTION,"Routing Table");
64    for (uint32_t x=0; x<_param->_nb_execute_unit; x++)
65      for (uint32_t y=0; y<_param->_nb_execute_unit_port[x]; y++)
66        for (uint32_t j=0; j<_param->_nb_thread; j++)
67          for (std::list<uint32_t>::iterator k=_destination[x][y][j].begin();
68               k != _destination[x][y][j].end();
69               k++)
70            log_printf(TRACE,Read_unit_to_Execution_unit,FUNCTION,"  * Execute_unit [%d][%d], send at the write_unit [%d], the operation of thread [%d].",x,y,*k,j);
71#endif
72
73#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
74    end_cycle ();
75#endif
76
77    log_printf(FUNC,Execution_unit_to_Write_unit,FUNCTION,"End");
78  };
79
80}; // end namespace execution_unit_to_write_unit
81}; // end namespace network
82}; // end namespace execute_loop
83}; // end namespace multi_execute_loop
84}; // end namespace core
85
86}; // end namespace behavioural
87}; // end namespace morpheo             
88#endif
Note: See TracBrowser for help on using the repository browser.