source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Reservation_station/src/Reservation_station_genMoore.cpp @ 122

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

Modif for performance :
1) Load Store Unit : store send request to valid exeception
2) Commit_unit : retire can bypass store
3) Commit_unit : add stat to manage store instruction
4) Load Store Unit and Load Store Pointer Manager : add store_queue_ptr_read
5) Fix lot of bug

  • Property svn:keywords set to Id
File size: 5.0 KB
Line 
1#ifdef SYSTEMC
2//#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
3/*
4 * $Id: Reservation_station_genMoore.cpp 122 2009-06-03 08:15:51Z rosiere $
5 *
6 * [ Description ]
7 *
8 */
9
10#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Reservation_station/include/Reservation_station.h"
11
12namespace morpheo                    {
13namespace behavioural {
14namespace core {
15namespace multi_execute_loop {
16namespace execute_loop {
17namespace multi_read_unit {
18namespace read_unit {
19namespace reservation_station {
20
21
22#undef  FUNCTION
23#define FUNCTION "Reservation_station::genMoore"
24  void Reservation_station::genMoore (void)
25  {
26    log_begin(Reservation_station,FUNCTION);
27    log_function(Reservation_station,FUNCTION,_name.c_str());
28
29    // ~~~~~[ Interface "insert" ]~~~~~~~~~~~~~~~~~~~~~~~~
30   
31    // accept a new instructions when reservation_station is not full
32#ifdef  SYSTEMC_VHDL_COMPATIBILITY
33    for (internal_INSERT_SLOT=0; (internal_INSERT_SLOT<_param->_size_queue) and (_queue_valid[internal_INSERT_SLOT]==true); internal_INSERT_SLOT++);
34    internal_INSERT_ACK = (internal_INSERT_SLOT<_param->_size_queue);
35#else
36    internal_INSERT_ACK = not _queue_control->full();
37#endif   
38    PORT_WRITE(out_INSERT_ACK, internal_INSERT_ACK);
39
40    // ~~~~~[ Interface "retire" ]~~~~~~~~~~~~~~~~~~~~~~~
41
42    uint32_t index_queue=0;
43    const uint32_t nb_slot_scan = _param->_size_queue-_param->_nb_inst_retire+1;
44
45    for (uint32_t i=0; i<_param->_nb_inst_retire; i++)
46      {
47        bool     val        = false;
48        uint32_t index_find = 0;
49
50        log_printf(TRACE,Reservation_station,FUNCTION,"  * RETIRE [%d]",i);
51
52        for (; (
53#ifndef  SYSTEMC_VHDL_COMPATIBILITY
54                (index_queue<_queue_control->nb_elt()) and
55#endif
56                (index_queue>=i) and
57                (index_queue<nb_slot_scan+i) and
58                (val==false));
59             index_queue++)
60          {
61#ifdef  SYSTEMC_VHDL_COMPATIBILITY
62            index_find = index_queue;
63#else
64            index_find = (*_queue_control)[index_queue];
65#endif
66            internal_RETIRE_SLOT [i] = index_queue;
67
68            val   = 
69              (
70#ifdef  SYSTEMC_VHDL_COMPATIBILITY
71               _queue_valid [index_queue] and
72#endif
73               _queue[index_find]._data_ra_val and
74               _queue[index_find]._data_rb_val and
75               _queue[index_find]._data_rc_val
76               );
77
78            log_printf(
79#ifdef  SYSTEMC_VHDL_COMPATIBILITY
80                       TRACE,Reservation_station,FUNCTION,"    [%d] valid : %d, data ra %d, rb %d, rc %d - %d",
81                       index_find,
82                       _queue_valid [index_queue],
83#else
84                       TRACE,Reservation_station,FUNCTION,"    [%d] data ra %d, rb %d, rc %d - %d",
85                       index_find,
86#endif
87                       _queue[index_find]._data_ra_val,
88                       _queue[index_find]._data_rb_val,
89                       _queue[index_find]._data_rc_val,
90                       val);
91          }
92
93        internal_RETIRE_VAL [i] = val;
94        PORT_WRITE(out_RETIRE_VAL [i], val);
95
96        if (val)
97          {
98
99// #ifdef  SYSTEMC_VHDL_COMPATIBILITY
100//          index_find = internal_RETIRE_SLOT [i];
101// #else
102//          index_find = (*_queue_control)[internal_RETIRE_SLOT [i]];
103// #endif
104            if (_param->_have_port_context_id)
105            PORT_WRITE(out_RETIRE_CONTEXT_ID    [i],_queue[index_find]._context_id);
106            if (_param->_have_port_front_end_id)
107            PORT_WRITE(out_RETIRE_FRONT_END_ID  [i],_queue[index_find]._front_end_id);
108            if (_param->_have_port_ooo_engine_id)
109            PORT_WRITE(out_RETIRE_OOO_ENGINE_ID [i],_queue[index_find]._ooo_engine_id);
110            if (_param->_have_port_rob_ptr)
111            PORT_WRITE(out_RETIRE_ROB_ID        [i],_queue[index_find]._rob_id);
112            PORT_WRITE(out_RETIRE_OPERATION     [i],_queue[index_find]._operation);
113            PORT_WRITE(out_RETIRE_TYPE          [i],_queue[index_find]._type);
114            PORT_WRITE(out_RETIRE_STORE_QUEUE_PTR_WRITE [i],_queue[index_find]._store_queue_ptr_write);
115            PORT_WRITE(out_RETIRE_STORE_QUEUE_PTR_READ  [i],_queue[index_find]._store_queue_ptr_read );
116            PORT_WRITE(out_RETIRE_STORE_QUEUE_EMPTY     [i],_queue[index_find]._store_queue_empty    );
117            if (_param->_have_port_load_queue_ptr)
118            PORT_WRITE(out_RETIRE_LOAD_QUEUE_PTR_WRITE  [i],_queue[index_find]._load_queue_ptr_write );
119            PORT_WRITE(out_RETIRE_HAS_IMMEDIAT  [i],_queue[index_find]._has_immediat);
120            PORT_WRITE(out_RETIRE_IMMEDIAT      [i],_queue[index_find]._immediat);
121            PORT_WRITE(out_RETIRE_DATA_RA       [i],_queue[index_find]._data_ra);
122            PORT_WRITE(out_RETIRE_DATA_RB       [i],_queue[index_find]._data_rb);
123            PORT_WRITE(out_RETIRE_DATA_RC       [i],_queue[index_find]._data_rc);
124            PORT_WRITE(out_RETIRE_WRITE_RD      [i],_queue[index_find]._write_rd);
125            PORT_WRITE(out_RETIRE_NUM_REG_RD    [i],_queue[index_find]._num_reg_rd);
126            PORT_WRITE(out_RETIRE_WRITE_RE      [i],_queue[index_find]._write_re);
127            PORT_WRITE(out_RETIRE_NUM_REG_RE    [i],_queue[index_find]._num_reg_re);
128          }
129      }
130
131    log_end(Reservation_station,FUNCTION);
132  };
133
134}; // end namespace reservation_station
135}; // end namespace read_unit
136}; // end namespace multi_read_unit
137}; // end namespace execute_loop
138}; // end namespace multi_execute_loop
139}; // end namespace core
140
141}; // end namespace behavioural
142}; // end namespace morpheo             
143#endif
144//#endif
Note: See TracBrowser for help on using the repository browser.