source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Load_Store_pointer_unit/src/Load_Store_pointer_unit_genMealy_retire.cpp @ 123

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

1) Fix performance
2) add auto generation to SPECINT2000
3) add reset in genMoore and genMealy

  • Property svn:keywords set to Id
File size: 2.9 KB
Line 
1#ifdef SYSTEMC
2/*
3 * $Id: Load_Store_pointer_unit_genMealy_retire.cpp 123 2009-06-08 20:43:30Z rosiere $
4 *
5 * [ Description ]
6 *
7 */
8
9#include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Load_Store_pointer_unit/include/Load_Store_pointer_unit.h"
10
11namespace morpheo                    {
12namespace behavioural {
13namespace core {
14namespace multi_ooo_engine {
15namespace ooo_engine {
16namespace rename_unit {
17namespace load_store_pointer_unit {
18
19
20#undef  FUNCTION
21#define FUNCTION "Load_Store_pointer_unit::genMealy_retire"
22  void Load_Store_pointer_unit::genMealy_retire (void)
23  {
24    log_printf(FUNC,Load_Store_pointer_unit,FUNCTION,"Begin");
25   
26    if (PORT_READ(in_NRESET))
27      {
28//     bool use_lsq [_param->_nb_load_store_queue];
29//     for (uint32_t i=0; i<_param->_nb_load_store_queue; i++)
30//       use_lsq [i] = false;
31
32    for (uint32_t i=0; i<_param->_nb_inst_retire; i++)
33      {
34        Tcontrol_t ack = true; // always accept
35        Tcontrol_t use_sq  = PORT_READ(in_RETIRE_USE_STORE_QUEUE [i]);
36        Tcontrol_t use_lq  = PORT_READ(in_RETIRE_USE_LOAD_QUEUE  [i]);
37        if ( (PORT_READ(in_RETIRE_VAL  [i]) == true) and (use_sq or use_lq))
38//           (PORT_READ(in_RETIRE_TYPE [i]) == TYPE_MEMORY))
39          {
40            Tcontext_t front_end_id = (_param->_have_port_front_end_id)?PORT_READ(in_RETIRE_FRONT_END_ID [i]):0;
41            Tcontext_t context_id   = (_param->_have_port_context_id  )?PORT_READ(in_RETIRE_CONTEXT_ID   [i]):0;
42            uint32_t   lsq          = _param->_link_load_store_unit_with_thread[front_end_id][context_id];
43
44            // Test if a previous instruction use the same lsq
45//          // Authorize once memory access by load store unit
46//          if (use_lsq [lsq] == false)
47              {
48//              use_lsq [lsq] = true;
49//              ack = true;
50
51                uint32_t   ptr;
52               
53                // operation became of decod_stage. Also operation is != store_head_ok and store_head_ko
54//              if (is_operation_memory_store(PORT_READ(in_RETIRE_OPERATION [i])))
55                if (use_sq)
56                  {
57                    internal_RETIRE_OPERATION_USE [i] = OPERATION_USE_STORE_QUEUE;
58                   
59                    ptr = PORT_READ(in_RETIRE_STORE_QUEUE_PTR_WRITE [i]);
60                  }
61                else
62                  {
63                    internal_RETIRE_OPERATION_USE [i] = OPERATION_USE_LOAD_QUEUE;
64                   
65                    ptr = (_param->_have_port_load_queue_ptr)?PORT_READ(in_RETIRE_LOAD_QUEUE_PTR_WRITE [i]):0;
66                  }
67               
68                internal_RETIRE_LSQ [i] = lsq;
69                internal_RETIRE_PTR [i] = ptr;
70              }
71          }
72        else
73          {
74//          ack = true;
75
76            internal_RETIRE_OPERATION_USE [i] = OPERATION_USE_NONE;
77          }
78
79        // Write output
80        internal_RETIRE_ACK [i] = ack;
81      }
82      }
83    else
84      {
85        for (uint32_t i=0; i<_param->_nb_inst_retire; i++)
86          internal_RETIRE_ACK [i] = 0;
87      }
88
89    for (uint32_t i=0; i<_param->_nb_inst_retire; i++)
90      PORT_WRITE(out_RETIRE_ACK [i], internal_RETIRE_ACK [i]);
91
92   
93    log_printf(FUNC,Load_Store_pointer_unit,FUNCTION,"End");
94  };
95
96}; // end namespace load_store_pointer_unit
97}; // end namespace rename_unit
98}; // end namespace ooo_engine
99}; // end namespace multi_ooo_engine
100}; // end namespace core
101
102}; // end namespace behavioural
103}; // end namespace morpheo             
104#endif
Note: See TracBrowser for help on using the repository browser.