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_insert.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: 3.0 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_insert"
22  void Load_Store_pointer_unit::genMealy_insert (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_insert; i++)
31      {
32        Tcontrol_t ack                   = false;
33        Tlsq_ptr_t store_queue_ptr_write = 0;
34        Tlsq_ptr_t load_queue_ptr_write  = 0;
35
36        if ( (PORT_READ(in_INSERT_VAL  [i]) == true       ) and
37             (PORT_READ(in_INSERT_TYPE [i]) == TYPE_MEMORY))
38          {
39            Tcontext_t front_end_id = (_param->_have_port_front_end_id)?PORT_READ(in_INSERT_FRONT_END_ID [i]):0;
40            Tcontext_t context_id   = (_param->_have_port_context_id  )?PORT_READ(in_INSERT_CONTEXT_ID   [i]):0;
41           
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
50                uint32_t   ptr;
51               
52                store_queue_ptr_write   = reg_STORE_QUEUE_PTR_WRITE [lsq];
53                load_queue_ptr_write    = reg_LOAD_QUEUE_PTR_WRITE  [lsq];
54               
55                // operation became of decod_stage. Also operation is != store_head_ok and store_head_ko
56                if (is_operation_memory_store(PORT_READ(in_INSERT_OPERATION [i])))
57                  {
58                    internal_INSERT_OPERATION_USE [i] = OPERATION_USE_STORE_QUEUE;
59                   
60                    ptr = reg_STORE_QUEUE_PTR_WRITE [lsq];
61
62                    ack = not reg_STORE_QUEUE_USE [lsq][ptr] and (static_cast<uint32_t>(reg_STORE_QUEUE_NB_USE [lsq]+1) < _param->_size_store_queue[lsq]);
63                  }
64                else
65                  {
66                    internal_INSERT_OPERATION_USE [i] = OPERATION_USE_LOAD_QUEUE;
67                   
68                    ptr = reg_LOAD_QUEUE_PTR_WRITE [lsq];
69
70                    ack = (not reg_LOAD_QUEUE_USE [lsq][ptr]);
71                  }
72               
73                internal_INSERT_LSQ [i] = lsq;
74                internal_INSERT_PTR [i] = ptr;
75              }
76          }
77        else
78          {
79            ack = true;
80
81            internal_INSERT_OPERATION_USE [i] = OPERATION_USE_NONE;
82          }
83
84        // Write output
85        internal_INSERT_ACK [i] = ack;
86        PORT_WRITE(out_INSERT_ACK                   [i], ack);
87        PORT_WRITE(out_INSERT_STORE_QUEUE_PTR_WRITE [i], store_queue_ptr_write);
88        if (_param->_have_port_load_queue_ptr)
89        PORT_WRITE(out_INSERT_LOAD_QUEUE_PTR_WRITE  [i], load_queue_ptr_write );
90      }
91
92    log_printf(FUNC,Load_Store_pointer_unit,FUNCTION,"End");
93  };
94
95}; // end namespace load_store_pointer_unit
96}; // end namespace rename_unit
97}; // end namespace ooo_engine
98}; // end namespace multi_ooo_engine
99}; // end namespace core
100
101}; // end namespace behavioural
102}; // end namespace morpheo             
103#endif
Note: See TracBrowser for help on using the repository browser.