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

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

Factorisation du contrôle de file d'attente dans une classe "Queue_Control"

File size: 3.0 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 "reservation_station_in" ]~~~~~~~~~~~~~~~~~~~~~~~~
29   
30    // accept a new instructions when reservation_station is not full
31    internal_RESERVATION_STATION_IN_ACK = not _queue_control->full();
32   
33    PORT_WRITE(out_RESERVATION_STATION_IN_ACK, internal_RESERVATION_STATION_IN_ACK);
34
35    // ~~~~~[ Interface "reservation_station_out" ]~~~~~~~~~~~~~~~~~~~~~~~
36
37    for (uint32_t i=0; i<_param->_size_queue; i++)
38      {
39        bool     val   = i <_queue_control->nb_elt();
40        uint32_t index = (*_queue_control)[i];
41       
42        if (val == true)
43          {
44            // valid if all data is present
45            val = (_queue[index]._data_ra_val and
46                   _queue[index]._data_rb_val and
47                   _queue[index]._data_rc_val);
48
49            PORT_WRITE(out_RESERVATION_STATION_OUT_CONTEXT_ID  [index],_queue[index]._context_id);
50            PORT_WRITE(out_RESERVATION_STATION_OUT_PACKET_ID   [index],_queue[index]._packet_id);
51            PORT_WRITE(out_RESERVATION_STATION_OUT_OPERATION   [index],_queue[index]._operation);
52            PORT_WRITE(out_RESERVATION_STATION_OUT_TYPE        [index],_queue[index]._type);
53            PORT_WRITE(out_RESERVATION_STATION_OUT_HAS_IMMEDIAT[index],_queue[index]._has_immediat);
54            PORT_WRITE(out_RESERVATION_STATION_OUT_IMMEDIAT    [index],_queue[index]._immediat);
55            PORT_WRITE(out_RESERVATION_STATION_OUT_DATA_RA     [index],_queue[index]._data_ra);
56            PORT_WRITE(out_RESERVATION_STATION_OUT_DATA_RB     [index],_queue[index]._data_rb);
57            PORT_WRITE(out_RESERVATION_STATION_OUT_DATA_RC     [index],_queue[index]._data_rc);
58            PORT_WRITE(out_RESERVATION_STATION_OUT_WRITE_RD    [index],_queue[index]._write_rd);
59            PORT_WRITE(out_RESERVATION_STATION_OUT_NUM_REG_RD  [index],_queue[index]._num_reg_rd);
60            PORT_WRITE(out_RESERVATION_STATION_OUT_WRITE_RE    [index],_queue[index]._write_re);
61            PORT_WRITE(out_RESERVATION_STATION_OUT_NUM_REG_RE  [index],_queue[index]._num_reg_re);
62          }
63       
64        internal_RESERVATION_STATION_OUT_VAL [index] = val;
65        PORT_WRITE(out_RESERVATION_STATION_OUT_VAL [index], internal_RESERVATION_STATION_OUT_VAL [index]);
66      }
67
68    log_printf(FUNC,Reservation_station,FUNCTION,"End");
69  };
70
71}; // end namespace reservation_station
72}; // end namespace read_unit
73}; // end namespace multi_read_unit
74}; // end namespace execute_loop
75}; // end namespace multi_execute_loop
76}; // end namespace core
77
78}; // end namespace behavioural
79}; // end namespace morpheo             
80#endif
81//#endif
Note: See TracBrowser for help on using the repository browser.