source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Read_queue/src/Read_queue_genMealy_read_queue_out_val.cpp @ 66

Last change on this file since 66 was 66, checked in by rosiere, 17 years ago
  • un pas de plus vers la compatibilite avec systemC
  • modification de l'interface de read_queue : context_id devient context_id, front_end_id et ooo_engine_id
File size: 4.3 KB
Line 
1#ifdef SYSTEMC
2/*
3 * $Id$
4 *
5 * [ Description ]
6 *
7 */
8
9#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Read_queue/include/Read_queue.h"
10
11namespace morpheo {
12namespace behavioural {
13namespace core {
14namespace multi_execute_loop {
15namespace execute_loop {
16namespace multi_read_unit {
17namespace read_unit {
18namespace read_queue {
19
20#undef  FUNCTION
21#define FUNCTION "Read_queue::genMealy_read_queue_out_val"
22  void Read_queue::genMealy_read_queue_out_val (void)
23  {
24    log_printf(FUNC,Read_queue,FUNCTION,"Begin");
25
26    internal_READ_QUEUE_OUT_READ_RA_VAL = (// Previous value
27                                           _queue_head->_read_ra_val  and
28                                           // Test if have already access at the registerfile
29                                           not PORT_READ(in_GPR_READ_ACK      [0])
30                                           );
31
32    internal_READ_QUEUE_OUT_READ_RB_VAL = (_queue_head->_read_rb_val  and
33                                           not PORT_READ(in_GPR_READ_ACK      [1])
34                                           );
35   
36    internal_READ_QUEUE_OUT_READ_RC_VAL = (_queue_head->_read_rc_val  and
37                                           not PORT_READ(in_SPR_READ_ACK      [0])
38                                           );
39
40    // Test all bypass
41    for (uint32_t i=0; i<_param->_nb_gpr_write ; i++)
42      {
43        // Test if this bypass is valid
44        if ( (PORT_READ (in_GPR_WRITE_VAL           [i]) == 1) and
45             (PORT_READ (in_GPR_WRITE_OOO_ENGINE_ID [i]) == _queue_head->_ooo_engine_id)
46             )
47          {
48            Tgeneral_address_t gpr_write_num_reg = PORT_READ(in_GPR_WRITE_NUM_REG [i]);
49           
50            if (_queue_head->_num_reg_ra == gpr_write_num_reg)
51              internal_READ_QUEUE_OUT_READ_RA_VAL = 0;
52
53            if (_queue_head->_num_reg_rb == gpr_write_num_reg)
54              internal_READ_QUEUE_OUT_READ_RB_VAL = 0;
55          }
56      }
57
58    for (uint32_t i=0; i<_param->_nb_spr_write ; i++)
59      {
60        // Test if this bypass is valid
61        if ( (PORT_READ (in_SPR_WRITE_VAL           [i]) == 1) and
62             (PORT_READ (in_SPR_WRITE_OOO_ENGINE_ID [i]) == _queue_head->_ooo_engine_id)
63             )
64          {
65            Tspecial_address_t spr_write_num_reg = PORT_READ(in_SPR_WRITE_NUM_REG [i]);
66           
67            if (_queue_head->_num_reg_rc == spr_write_num_reg)
68              internal_READ_QUEUE_OUT_READ_RC_VAL = 0;
69          }
70      }
71
72    // Affectation out port
73
74    // READ_QUEUE_OUT_VAL : mealy
75    internal_READ_QUEUE_OUT_VAL = (not _queue->empty()                     and
76                                   not internal_READ_QUEUE_OUT_READ_RA_VAL and
77                                   not internal_READ_QUEUE_OUT_READ_RB_VAL and
78                                   not internal_READ_QUEUE_OUT_READ_RC_VAL
79                                   );
80
81    // READ_QUEUE_OUT_VAL : moore
82//     internal_READ_QUEUE_OUT_VAL = (not _queue->empty()           and
83//                                 not _queue_head->_read_ra_val and
84//                                 not _queue_head->_read_rb_val and
85//                                 not _queue_head->_read_rc_val
86//                                 );
87
88
89    PORT_WRITE(out_READ_QUEUE_OUT_VAL, internal_READ_QUEUE_OUT_VAL);
90
91    log_printf(TRACE,Read_queue,FUNCTION," * internal_READ_QUEUE_OUT_VAL           : %d",internal_READ_QUEUE_OUT_VAL);
92    log_printf(TRACE,Read_queue,FUNCTION,"   * _queue->empty()                     : %d",_queue->empty());
93    log_printf(TRACE,Read_queue,FUNCTION,"   * internal_READ_QUEUE_OUT_READ_RA_VAL : %d",internal_READ_QUEUE_OUT_READ_RA_VAL);
94    log_printf(TRACE,Read_queue,FUNCTION,"     * _queue_head->_read_ra_val         : %d",_queue_head->_read_ra_val);
95    log_printf(TRACE,Read_queue,FUNCTION,"     * in_GPR_READ_ACK      [0]          : %d",PORT_READ(in_GPR_READ_ACK      [0]));
96    log_printf(TRACE,Read_queue,FUNCTION,"   * internal_READ_QUEUE_OUT_READ_RB_VAL : %d",internal_READ_QUEUE_OUT_READ_RB_VAL);
97    log_printf(TRACE,Read_queue,FUNCTION,"     * _queue_head->_read_rb_val         : %d",_queue_head->_read_rb_val);
98    log_printf(TRACE,Read_queue,FUNCTION,"     * in_GPR_READ_ACK      [1]          : %d",PORT_READ(in_GPR_READ_ACK      [1]));
99    log_printf(TRACE,Read_queue,FUNCTION,"   * internal_READ_QUEUE_OUT_READ_RC_VAL : %d",internal_READ_QUEUE_OUT_READ_RC_VAL);
100    log_printf(TRACE,Read_queue,FUNCTION,"     * _queue_head->_read_rc_val         : %d",_queue_head->_read_rc_val);
101    log_printf(TRACE,Read_queue,FUNCTION,"     * in_SPR_READ_ACK      [0]          : %d",PORT_READ(in_SPR_READ_ACK      [0]));
102
103    log_printf(FUNC,Read_queue,FUNCTION,"End");
104  };
105
106}; // end namespace read_queue
107}; // end namespace read_unit
108}; // end namespace multi_read_unit
109}; // end namespace execute_loop
110}; // end namespace multi_execute_loop
111}; // end namespace core
112
113}; // end namespace behavioural
114}; // end namespace morpheo             
115#endif
Note: See TracBrowser for help on using the repository browser.