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 @ 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: 2.5 KB
Line 
1#ifdef SYSTEMC
2/*
3 * $Id$
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    bool use_lsq [_param->_nb_load_store_queue];
27    for (uint32_t i=0; i<_param->_nb_load_store_queue; i++)
28      use_lsq [i] = false;
29
30    for (uint32_t i=0; i<_param->_nb_inst_retire; i++)
31      {
32        Tcontrol_t ack = false;
33
34        if ( (PORT_READ(in_RETIRE_VAL  [i]) == true       ) and
35             (PORT_READ(in_RETIRE_TYPE [i]) == TYPE_MEMORY))
36          {
37            Tcontext_t front_end_id = (_param->_have_port_front_end_id)?PORT_READ(in_RETIRE_FRONT_END_ID [i]):0;
38            Tcontext_t context_id   = (_param->_have_port_context_id  )?PORT_READ(in_RETIRE_CONTEXT_ID   [i]):0;
39            uint32_t   lsq          = _param->_link_load_store_unit_with_thread[front_end_id][context_id];
40
41            // Test if a previous instruction use the same lsq
42            // Authorize once memory access by load store unit
43            if (use_lsq [lsq] == false)
44              {
45                use_lsq [lsq] = true;
46                ack = true;
47
48                uint32_t   ptr;
49               
50                // operation became of decod_stage. Also operation is != store_head_ok and store_head_ko
51                if (is_operation_memory_store(PORT_READ(in_RETIRE_OPERATION [i])))
52                  {
53                    internal_RETIRE_OPERATION_USE [i] = OPERATION_USE_STORE_QUEUE;
54                   
55                    ptr = PORT_READ(in_RETIRE_STORE_QUEUE_PTR_WRITE [i]);
56                  }
57                else
58                  {
59                    internal_RETIRE_OPERATION_USE [i] = OPERATION_USE_LOAD_QUEUE;
60                   
61                    ptr = (_param->_have_port_load_queue_ptr)?PORT_READ(in_RETIRE_LOAD_QUEUE_PTR_WRITE [i]):0;
62                  }
63               
64                internal_RETIRE_LSQ [i] = lsq;
65                internal_RETIRE_PTR [i] = ptr;
66              }
67          }
68        else
69          {
70            ack = true;
71
72            internal_RETIRE_OPERATION_USE [i] = OPERATION_USE_NONE;
73          }
74
75        // Write output
76        internal_RETIRE_ACK [i] = ack;
77        PORT_WRITE(out_RETIRE_ACK                   [i], ack);
78      }
79   
80    log_printf(FUNC,Load_Store_pointer_unit,FUNCTION,"End");
81  };
82
83}; // end namespace load_store_pointer_unit
84}; // end namespace rename_unit
85}; // end namespace ooo_engine
86}; // end namespace multi_ooo_engine
87}; // end namespace core
88
89}; // end namespace behavioural
90}; // end namespace morpheo             
91#endif
Note: See TracBrowser for help on using the repository browser.