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_genMealy.cpp @ 78

Last change on this file since 78 was 78, checked in by rosiere, 16 years ago

Add :

  • Execute_loop (must be test systemC)
  • Prediction
    • Direction : predifined scheme
    • Branch Target Buffer
  • iFetch_unit
    • ifetch_queue
    • pc management
  • Decod_unit
    • coming soon : support for custom operation
  • Rename_unit
    • RAT
    • Free_list
    • Dependence RAW check
    • Load store unit pointer
  • New Environnement (hierarchy_memory will remove in a next version)


Modif :

  • Manage Custom Operation
  • All component in execute_loop to use the new statistics management

Not Finish :

  • Return Address Stack
  • Environnement
File size: 4.9 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::genMealy"
22  void Execution_unit_to_Write_unit::genMealy (void)
23  {
24    log_printf(FUNC,Execution_unit_to_Write_unit,FUNCTION,"Begin");
25
26    bool write_unit_use [_param->_nb_write_unit];
27
28    for (uint32_t i=0; i<_param->_nb_write_unit; i++)
29      write_unit_use[i] = (PORT_READ(in_WRITE_UNIT_IN_ACK [i]) == 0);
30
31    for (uint32_t i=0; i<_param->_nb_execute_unit; i++)
32      {
33        bool       ack = false;
34
35        log_printf(TRACE,Execution_unit_to_Write_unit,FUNCTION,"Test execute_unit[%d]",i);
36
37        if (PORT_READ(in_EXECUTE_UNIT_OUT_VAL [i]) == true)
38          {
39            log_printf(TRACE,Execution_unit_to_Write_unit,FUNCTION," * have a valid entry.");
40           
41            Tcontext_t context_id    = (_param->_have_port_context_id   )?PORT_READ(in_EXECUTE_UNIT_OUT_CONTEXT_ID    [i]):0;
42            Tcontext_t front_end_id  = (_param->_have_port_front_end_id )?PORT_READ(in_EXECUTE_UNIT_OUT_FRONT_END_ID  [i]):0;
43            Tcontext_t ooo_engine_id = (_param->_have_port_ooo_engine_id)?PORT_READ(in_EXECUTE_UNIT_OUT_OOO_ENGINE_ID [i]):0;
44            Tcontext_t num_thread    = get_num_thread(context_id   , _param->_size_context_id   ,
45                                                      front_end_id , _param->_size_front_end_id ,
46                                                      ooo_engine_id, _param->_size_ooo_engine_id);
47#ifdef DEBUG_TEST
48            if (_destination[i][num_thread].empty())
49              throw ERRORMORPHEO(FUNCTION,"Invalid Operation : They have no write_unit to receive a operation from the execute_unit ["+toString(i)+"], thread ["+toString(num_thread)+"].");
50#endif
51
52            // find a free write_unit
53            for (std::list<uint32_t>::iterator it=_destination[i][num_thread].begin();
54                 (it != _destination[i][num_thread].end()) and (ack == false);
55                 it++)
56              {
57                uint32_t dest = *it;
58
59                log_printf(TRACE,Execution_unit_to_Write_unit,FUNCTION,"   * Test destination [%d].",dest);
60                           
61                if (write_unit_use [dest] == false)
62                  {
63                    log_printf(TRACE,Execution_unit_to_Write_unit,FUNCTION,"     * Is ok! Link.");
64                    // have find !!!
65                    ack                   = true;
66                    write_unit_use [dest] = true;
67
68                    if (_param->_have_port_context_id)
69                    PORT_WRITE(out_WRITE_UNIT_IN_CONTEXT_ID            [dest], PORT_READ(in_EXECUTE_UNIT_OUT_CONTEXT_ID            [i]));
70                    if (_param->_have_port_front_end_id)
71                    PORT_WRITE(out_WRITE_UNIT_IN_FRONT_END_ID          [dest], PORT_READ(in_EXECUTE_UNIT_OUT_FRONT_END_ID          [i]));
72                    if (_param->_have_port_ooo_engine_id)
73                    PORT_WRITE(out_WRITE_UNIT_IN_OOO_ENGINE_ID         [dest], PORT_READ(in_EXECUTE_UNIT_OUT_OOO_ENGINE_ID         [i]));
74                    if (_param->_have_port_packet_id)
75                    PORT_WRITE(out_WRITE_UNIT_IN_PACKET_ID             [dest], PORT_READ(in_EXECUTE_UNIT_OUT_PACKET_ID             [i]));
76                  //PORT_WRITE(out_WRITE_UNIT_IN_OPERATION             [dest], PORT_READ(in_EXECUTE_UNIT_OUT_OPERATION             [i]));
77                    PORT_WRITE(out_WRITE_UNIT_IN_TYPE                  [dest], PORT_READ(in_EXECUTE_UNIT_OUT_TYPE                  [i]));
78                    PORT_WRITE(out_WRITE_UNIT_IN_WRITE_RD              [dest], PORT_READ(in_EXECUTE_UNIT_OUT_WRITE_RD              [i]));
79                    PORT_WRITE(out_WRITE_UNIT_IN_NUM_REG_RD            [dest], PORT_READ(in_EXECUTE_UNIT_OUT_NUM_REG_RD            [i]));
80                    PORT_WRITE(out_WRITE_UNIT_IN_DATA_RD               [dest], PORT_READ(in_EXECUTE_UNIT_OUT_DATA_RD               [i]));
81                    PORT_WRITE(out_WRITE_UNIT_IN_WRITE_RE              [dest], PORT_READ(in_EXECUTE_UNIT_OUT_WRITE_RE              [i]));
82                    PORT_WRITE(out_WRITE_UNIT_IN_NUM_REG_RE            [dest], PORT_READ(in_EXECUTE_UNIT_OUT_NUM_REG_RE            [i]));
83                    PORT_WRITE(out_WRITE_UNIT_IN_DATA_RE               [dest], PORT_READ(in_EXECUTE_UNIT_OUT_DATA_RE               [i]));
84                    PORT_WRITE(out_WRITE_UNIT_IN_EXCEPTION             [dest], PORT_READ(in_EXECUTE_UNIT_OUT_EXCEPTION             [i]));
85                    PORT_WRITE(out_WRITE_UNIT_IN_NO_SEQUENCE           [dest], PORT_READ(in_EXECUTE_UNIT_OUT_NO_SEQUENCE           [i]));
86                    PORT_WRITE(out_WRITE_UNIT_IN_ADDRESS               [dest], PORT_READ(in_EXECUTE_UNIT_OUT_ADDRESS               [i]));
87                  }
88              }
89          }
90        PORT_WRITE(out_EXECUTE_UNIT_OUT_ACK [i], ack);
91      }
92
93    for (uint32_t i=0; i<_param->_nb_write_unit; i++)
94      {
95        PORT_WRITE(out_WRITE_UNIT_IN_VAL[i], write_unit_use[i]); 
96      }
97
98    log_printf(FUNC,Execution_unit_to_Write_unit,FUNCTION,"End");
99  };
100
101}; // end namespace execution_unit_to_write_unit
102}; // end namespace network
103}; // end namespace execute_loop
104}; // end namespace multi_execute_loop
105}; // end namespace core
106
107}; // end namespace behavioural
108}; // end namespace morpheo             
109#endif
Note: See TracBrowser for help on using the repository browser.