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 @ 69

Last change on this file since 69 was 69, checked in by rosiere, 17 years ago

Station de reservation : systemC et VHDL ok

File size: 3.7 KB
Line 
1#ifdef SYSTEMC
2//#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
3/*
4 * $Id$
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_printf(FUNC,Reservation_station,FUNCTION,"Begin");
27
28    // ~~~~~[ Interface "insert" ]~~~~~~~~~~~~~~~~~~~~~~~~
29   
30    // accept a new instructions when reservation_station is not full
31#ifdef  SYSTEMC_VHDL_COMPATIBILITY
32    for (internal_INSERT_SLOT=0; (internal_INSERT_SLOT<_param->_size_queue) and (_queue_valid[internal_INSERT_SLOT]==true); internal_INSERT_SLOT++);
33    internal_INSERT_ACK = (internal_INSERT_SLOT<_param->_size_queue);
34#else
35    internal_INSERT_ACK = not _queue_control->full();
36#endif   
37    PORT_WRITE(out_INSERT_ACK, internal_INSERT_ACK);
38
39    // ~~~~~[ Interface "retire" ]~~~~~~~~~~~~~~~~~~~~~~~
40
41    uint32_t nb_slot_find = 0;
42    for (uint32_t i=0; (
43#ifdef  SYSTEMC_VHDL_COMPATIBILITY
44                        (i<_param->_size_queue) 
45#else
46                        (i<_queue_control->nb_elt())
47#endif
48                        and (nb_slot_find < _param->_nb_inst_retire)
49
50                        )
51                        ; i++)
52      {
53        uint32_t index;
54#ifdef  SYSTEMC_VHDL_COMPATIBILITY
55        index = i;
56#else
57        index = (*_queue_control)[i];
58#endif
59        bool     val   = 
60          (
61#ifdef  SYSTEMC_VHDL_COMPATIBILITY
62           _queue_valid [i]           and
63#endif
64           _queue[index]._data_ra_val and
65           _queue[index]._data_rb_val and
66           _queue[index]._data_rc_val);
67
68        if (val == true)
69          {
70            internal_RETIRE_SLOT [nb_slot_find] = i;
71            nb_slot_find ++;
72          }
73      }
74
75    for (uint32_t i=0; i<_param->_nb_inst_retire; i++)
76      {
77        bool val                = i<nb_slot_find;
78        internal_RETIRE_VAL [i] = val;
79
80        PORT_WRITE(out_RETIRE_VAL [i], val);
81
82        if (val)
83          {
84            uint32_t index;
85#ifdef  SYSTEMC_VHDL_COMPATIBILITY
86            index = internal_RETIRE_SLOT [i];
87#else
88            index = (*_queue_control)[internal_RETIRE_SLOT [i]];
89#endif
90            if (_param->_have_port_context_id)
91            PORT_WRITE(out_RETIRE_CONTEXT_ID    [i],_queue[index]._context_id);
92            if (_param->_have_port_front_end_id)
93            PORT_WRITE(out_RETIRE_FRONT_END_ID  [i],_queue[index]._front_end_id);
94            if (_param->_have_port_ooo_engine_id)
95            PORT_WRITE(out_RETIRE_OOO_ENGINE_ID [i],_queue[index]._ooo_engine_id);
96            if (_param->_have_port_rob_id)
97            PORT_WRITE(out_RETIRE_ROB_ID        [i],_queue[index]._rob_id);
98            PORT_WRITE(out_RETIRE_OPERATION     [i],_queue[index]._operation);
99            PORT_WRITE(out_RETIRE_TYPE          [i],_queue[index]._type);
100            PORT_WRITE(out_RETIRE_HAS_IMMEDIAT  [i],_queue[index]._has_immediat);
101            PORT_WRITE(out_RETIRE_IMMEDIAT      [i],_queue[index]._immediat);
102            PORT_WRITE(out_RETIRE_DATA_RA       [i],_queue[index]._data_ra);
103            PORT_WRITE(out_RETIRE_DATA_RB       [i],_queue[index]._data_rb);
104            PORT_WRITE(out_RETIRE_DATA_RC       [i],_queue[index]._data_rc);
105            PORT_WRITE(out_RETIRE_WRITE_RD      [i],_queue[index]._write_rd);
106            PORT_WRITE(out_RETIRE_NUM_REG_RD    [i],_queue[index]._num_reg_rd);
107            PORT_WRITE(out_RETIRE_WRITE_RE      [i],_queue[index]._write_re);
108            PORT_WRITE(out_RETIRE_NUM_REG_RE    [i],_queue[index]._num_reg_re);
109          }
110      }
111
112    log_printf(FUNC,Reservation_station,FUNCTION,"End");
113  };
114
115}; // end namespace reservation_station
116}; // end namespace read_unit
117}; // end namespace multi_read_unit
118}; // end namespace execute_loop
119}; // end namespace multi_execute_loop
120}; // end namespace core
121
122}; // end namespace behavioural
123}; // end namespace morpheo             
124#endif
125//#endif
Note: See TracBrowser for help on using the repository browser.