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

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

read_queue : systemC et vhdl ok !
queue : quelques petits modif pour avoir une queue de taille 1
nettoyage des fichiers *mkf*

File size: 4.4 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        bool cmp;
44
45        if (_param->_have_port_ooo_engine_id)
46          cmp = (PORT_READ (in_GPR_WRITE_OOO_ENGINE_ID [i]) == _queue_head->_ooo_engine_id);
47        else
48          cmp = true;
49       
50        // Test if this bypass is valid
51        if ((PORT_READ (in_GPR_WRITE_VAL           [i]) == 1) and cmp)
52          {
53            Tgeneral_address_t gpr_write_num_reg = PORT_READ(in_GPR_WRITE_NUM_REG [i]);
54           
55            if (_queue_head->_num_reg_ra == gpr_write_num_reg)
56              internal_READ_QUEUE_OUT_READ_RA_VAL = 0;
57
58            if (_queue_head->_num_reg_rb == gpr_write_num_reg)
59              internal_READ_QUEUE_OUT_READ_RB_VAL = 0;
60          }
61      }
62
63    for (uint32_t i=0; i<_param->_nb_spr_write ; i++)
64      {
65        bool cmp;
66
67        if (_param->_have_port_ooo_engine_id)
68          cmp = (PORT_READ (in_SPR_WRITE_OOO_ENGINE_ID [i]) == _queue_head->_ooo_engine_id);
69        else
70          cmp = true;
71       
72        // Test if this bypass is valid
73        if ((PORT_READ (in_SPR_WRITE_VAL           [i]) == 1) and cmp)
74          {
75            Tspecial_address_t spr_write_num_reg = PORT_READ(in_SPR_WRITE_NUM_REG [i]);
76           
77            if (_queue_head->_num_reg_rc == spr_write_num_reg)
78              internal_READ_QUEUE_OUT_READ_RC_VAL = 0;
79          }
80      }
81
82    // Affectation out port
83
84    // READ_QUEUE_OUT_VAL : mealy
85    internal_READ_QUEUE_OUT_VAL = (not _queue->empty()                     and
86                                   not internal_READ_QUEUE_OUT_READ_RA_VAL and
87                                   not internal_READ_QUEUE_OUT_READ_RB_VAL and
88                                   not internal_READ_QUEUE_OUT_READ_RC_VAL
89                                   );
90
91    // READ_QUEUE_OUT_VAL : moore
92//     internal_READ_QUEUE_OUT_VAL = (not _queue->empty()           and
93//                                 not _queue_head->_read_ra_val and
94//                                 not _queue_head->_read_rb_val and
95//                                 not _queue_head->_read_rc_val
96//                                 );
97
98
99    PORT_WRITE(out_READ_QUEUE_OUT_VAL, internal_READ_QUEUE_OUT_VAL);
100
101    log_printf(TRACE,Read_queue,FUNCTION," * internal_READ_QUEUE_OUT_VAL           : %d",internal_READ_QUEUE_OUT_VAL);
102    log_printf(TRACE,Read_queue,FUNCTION,"   * _queue->empty()                     : %d",_queue->empty());
103    log_printf(TRACE,Read_queue,FUNCTION,"   * internal_READ_QUEUE_OUT_READ_RA_VAL : %d",internal_READ_QUEUE_OUT_READ_RA_VAL);
104    log_printf(TRACE,Read_queue,FUNCTION,"     * _queue_head->_read_ra_val         : %d",_queue_head->_read_ra_val);
105    log_printf(TRACE,Read_queue,FUNCTION,"     * in_GPR_READ_ACK      [0]          : %d",PORT_READ(in_GPR_READ_ACK      [0]));
106    log_printf(TRACE,Read_queue,FUNCTION,"   * internal_READ_QUEUE_OUT_READ_RB_VAL : %d",internal_READ_QUEUE_OUT_READ_RB_VAL);
107    log_printf(TRACE,Read_queue,FUNCTION,"     * _queue_head->_read_rb_val         : %d",_queue_head->_read_rb_val);
108    log_printf(TRACE,Read_queue,FUNCTION,"     * in_GPR_READ_ACK      [1]          : %d",PORT_READ(in_GPR_READ_ACK      [1]));
109    log_printf(TRACE,Read_queue,FUNCTION,"   * internal_READ_QUEUE_OUT_READ_RC_VAL : %d",internal_READ_QUEUE_OUT_READ_RC_VAL);
110    log_printf(TRACE,Read_queue,FUNCTION,"     * _queue_head->_read_rc_val         : %d",_queue_head->_read_rc_val);
111    log_printf(TRACE,Read_queue,FUNCTION,"     * in_SPR_READ_ACK      [0]          : %d",PORT_READ(in_SPR_READ_ACK      [0]));
112
113    log_printf(FUNC,Read_queue,FUNCTION,"End");
114  };
115
116}; // end namespace read_queue
117}; // end namespace read_unit
118}; // end namespace multi_read_unit
119}; // end namespace execute_loop
120}; // end namespace multi_execute_loop
121}; // end namespace core
122
123}; // end namespace behavioural
124}; // end namespace morpheo             
125#endif
Note: See TracBrowser for help on using the repository browser.