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

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

1) Platforms : add new organization for test
2) Load_Store_Unit : add array to count nb_check in store_queue
3) Issue_queue and Core_Glue : rewrite the issue network
4) Special_Register_Unit : add reset value to register CID
5) Softwares : add multicontext test
6) Softwares : add SPECINT
7) Softwares : add MiBench?
7) Read_queue : inhib access for r0
8) Change Core_Glue (network) - dont yet support priority and load balancing scheme

  • Property svn:keywords set to Id
File size: 5.9 KB
Line 
1#ifdef SYSTEMC
2/*
3 * $Id: Read_unit_to_Execution_unit_genMealy.cpp 117 2009-05-16 14:42:39Z rosiere $
4 *
5 * [ Description ]
6 *
7 */
8
9#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Network/Read_unit_to_Execution_unit/include/Read_unit_to_Execution_unit.h"
10
11namespace morpheo                    {
12namespace behavioural {
13namespace core {
14namespace multi_execute_loop {
15namespace execute_loop {
16namespace network {
17namespace read_unit_to_execution_unit {
18
19
20#undef  FUNCTION
21#define FUNCTION "Read_unit_to_Execution_unit::genMealy"
22  void Read_unit_to_Execution_unit::genMealy (void)
23  {
24    log_begin(Read_unit_to_Execution_unit,FUNCTION);
25    log_function(Read_unit_to_Execution_unit,FUNCTION,_name.c_str());
26
27    bool execute_unit_use [_param->_nb_execute_unit][_param->_max_nb_execute_unit_port];
28
29    for (uint32_t i=0; i<_param->_nb_execute_unit; i++)
30      for (uint32_t j=0; j<_param->_nb_execute_unit_port[i]; j++)
31        execute_unit_use[i][j] = false;
32
33    for (uint32_t i=0; i<_param->_nb_read_unit; i++)
34      for (uint32_t j=0; j<_param->_nb_read_unit_port[i]; j++)
35        {
36          bool       ack = false;
37         
38          log_printf(TRACE,Read_unit_to_Execution_unit,FUNCTION,"  * Test Read_unit[%d][%d]",i,j);
39         
40          if (PORT_READ(in_READ_UNIT_OUT_VAL [i][j]) == true)
41            {
42              log_printf(TRACE,Read_unit_to_Execution_unit,FUNCTION,"    * have a valid entry.");
43             
44              Tcontext_t context_id    = (_param->_have_port_context_id   )?PORT_READ(in_READ_UNIT_OUT_CONTEXT_ID    [i][j]):0;
45              Tcontext_t front_end_id  = (_param->_have_port_front_end_id )?PORT_READ(in_READ_UNIT_OUT_FRONT_END_ID  [i][j]):0;
46              Tcontext_t ooo_engine_id = (_param->_have_port_ooo_engine_id)?PORT_READ(in_READ_UNIT_OUT_OOO_ENGINE_ID [i][j]):0;
47              Tcontext_t num_thread    = get_num_thread(context_id   , _param->_size_context_id   ,
48                                                        front_end_id , _param->_size_front_end_id ,
49                                                        ooo_engine_id, _param->_size_ooo_engine_id);
50              Ttype_t    type          = PORT_READ(in_READ_UNIT_OUT_TYPE [i][j]);
51             
52#ifdef DEBUG_TEST
53              if (_destination[i][num_thread][type].empty())
54                throw ERRORMORPHEO(FUNCTION,toString(_("Invalid Operation : They have no execute_unit to receive a operation from the read_unit [%d], thread [%d] and a operation's type [%s]."),i,num_thread,toString(type).c_str()));
55#endif
56             
57              // find a free execute_unit
58              for (std::list<destination_t>::iterator it=_destination[i][num_thread][type].begin();
59                   (it != _destination[i][num_thread][type].end()) and (ack == false);
60                   it++)
61                {
62                  uint32_t dest = (*it).grp;
63                  uint32_t port = (*it).elt;
64                 
65                  log_printf(TRACE,Read_unit_to_Execution_unit,FUNCTION,"      * Test destination [%d][%d].",dest,port);
66                 
67                  if (execute_unit_use [dest][port] == false)
68                    {
69                      log_printf(TRACE,Read_unit_to_Execution_unit,FUNCTION,"        * Is ok! Link.");
70                     
71                      // have find !!!
72                      ack                           = PORT_READ(in_EXECUTE_UNIT_IN_ACK [dest][port]);
73                      execute_unit_use [dest][port] = true;
74
75                      if (_param->_have_port_context_id)
76                      PORT_WRITE(out_EXECUTE_UNIT_IN_CONTEXT_ID            [dest][port], PORT_READ(in_READ_UNIT_OUT_CONTEXT_ID            [i][j]));
77                      if (_param->_have_port_front_end_id)
78                      PORT_WRITE(out_EXECUTE_UNIT_IN_FRONT_END_ID          [dest][port], PORT_READ(in_READ_UNIT_OUT_FRONT_END_ID          [i][j]));
79                      if (_param->_have_port_ooo_engine_id)
80                      PORT_WRITE(out_EXECUTE_UNIT_IN_OOO_ENGINE_ID         [dest][port], PORT_READ(in_READ_UNIT_OUT_OOO_ENGINE_ID         [i][j]));
81                      if (_param->_have_port_rob_ptr  )
82                      PORT_WRITE(out_EXECUTE_UNIT_IN_PACKET_ID             [dest][port], PORT_READ(in_READ_UNIT_OUT_PACKET_ID             [i][j]));
83                      PORT_WRITE(out_EXECUTE_UNIT_IN_OPERATION             [dest][port], PORT_READ(in_READ_UNIT_OUT_OPERATION             [i][j]));
84                      PORT_WRITE(out_EXECUTE_UNIT_IN_TYPE                  [dest][port], PORT_READ(in_READ_UNIT_OUT_TYPE                  [i][j]));
85                      PORT_WRITE(out_EXECUTE_UNIT_IN_HAS_IMMEDIAT          [dest][port], PORT_READ(in_READ_UNIT_OUT_HAS_IMMEDIAT          [i][j]));
86                      PORT_WRITE(out_EXECUTE_UNIT_IN_DATA_RC               [dest][port], PORT_READ(in_READ_UNIT_OUT_DATA_RC               [i][j]));
87                      PORT_WRITE(out_EXECUTE_UNIT_IN_WRITE_RD              [dest][port], PORT_READ(in_READ_UNIT_OUT_WRITE_RD              [i][j]));
88                      PORT_WRITE(out_EXECUTE_UNIT_IN_WRITE_RE              [dest][port], PORT_READ(in_READ_UNIT_OUT_WRITE_RE              [i][j]));
89                      PORT_WRITE(out_EXECUTE_UNIT_IN_NUM_REG_RE            [dest][port], PORT_READ(in_READ_UNIT_OUT_NUM_REG_RE            [i][j]));
90                      PORT_WRITE(out_EXECUTE_UNIT_IN_STORE_QUEUE_PTR_WRITE [dest][port], PORT_READ(in_READ_UNIT_OUT_STORE_QUEUE_PTR_WRITE [i][j]));
91                      if (_param->_have_port_load_queue_ptr)
92                      PORT_WRITE(out_EXECUTE_UNIT_IN_LOAD_QUEUE_PTR_WRITE  [dest][port], PORT_READ(in_READ_UNIT_OUT_LOAD_QUEUE_PTR_WRITE  [i][j]));
93                      PORT_WRITE(out_EXECUTE_UNIT_IN_IMMEDIAT              [dest][port], PORT_READ(in_READ_UNIT_OUT_IMMEDIAT              [i][j]));
94                      PORT_WRITE(out_EXECUTE_UNIT_IN_DATA_RA               [dest][port], PORT_READ(in_READ_UNIT_OUT_DATA_RA               [i][j]));
95                      PORT_WRITE(out_EXECUTE_UNIT_IN_DATA_RB               [dest][port], PORT_READ(in_READ_UNIT_OUT_DATA_RB               [i][j]));
96                      PORT_WRITE(out_EXECUTE_UNIT_IN_NUM_REG_RD            [dest][port], PORT_READ(in_READ_UNIT_OUT_NUM_REG_RD            [i][j]));
97                    }
98                }
99            }
100          PORT_WRITE(out_READ_UNIT_OUT_ACK [i][j], ack);
101        }
102
103    for (uint32_t i=0; i<_param->_nb_execute_unit; i++)
104      for (uint32_t j=0; j<_param->_nb_execute_unit_port[i]; j++)
105        PORT_WRITE(out_EXECUTE_UNIT_IN_VAL[i][j], execute_unit_use[i][j]);
106
107    log_end(Read_unit_to_Execution_unit,FUNCTION);
108  };
109
110}; // end namespace read_unit_to_execution_unit
111}; // end namespace network
112}; // end namespace execute_loop
113}; // end namespace multi_execute_loop
114}; // end namespace core
115
116}; // end namespace behavioural
117}; // end namespace morpheo             
118#endif
Note: See TracBrowser for help on using the repository browser.