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_spr.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: 3.0 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_spr"
22  void Read_queue::genMealy_read_queue_out_spr (void)
23  {
24    log_printf(FUNC,Read_queue,FUNCTION,"Begin");
25
26    internal_READ_QUEUE_OUT_DATA_RC_VAL = (// Previous value
27                                           _queue_head->_data_rc_val or
28                                           // Test if have already access at the registerfile
29                                           (_queue_head->_read_rc_val           and
30                                            PORT_READ(in_SPR_READ_ACK      [0]) and
31                                            PORT_READ(in_SPR_READ_DATA_VAL [0]))
32                                           );
33
34    log_printf(TRACE,Read_queue,FUNCTION," * internal_READ_QUEUE_OUT_DATA_RC_VAL   : %d",internal_READ_QUEUE_OUT_DATA_RC_VAL);
35    log_printf(TRACE,Read_queue,FUNCTION,"   * _queue_head->_data_rc_val           : %d",_queue_head->_data_rc_val);
36    log_printf(TRACE,Read_queue,FUNCTION,"   * _queue_head->_read_rc_val           : %d",_queue_head->_read_rc_val);
37    log_printf(TRACE,Read_queue,FUNCTION,"   * in_SPR_READ_ACK      [0]            : %d",PORT_READ(in_SPR_READ_ACK      [0]));
38    log_printf(TRACE,Read_queue,FUNCTION,"   * in_SPR_READ_DATA_VAL [0]            : %d",PORT_READ(in_SPR_READ_DATA_VAL [0]));
39
40    internal_READ_QUEUE_OUT_DATA_RC     = (// Test if have an previous access
41                                           (_queue_head->_data_rc_val)?
42                                           // if precious access, take previous data
43                                           _queue_head->_data_rc:
44                                           // else, take the read_data (don't test the validity of data)
45                                           PORT_READ(in_SPR_READ_DATA [0]));
46
47    // Test all bypass
48    for (uint32_t i=0; i<_param->_nb_spr_write ; i++)
49      {
50        bool cmp;
51
52        if (_param->_have_port_ooo_engine_id)
53          cmp = (PORT_READ (in_SPR_WRITE_OOO_ENGINE_ID [i]) == _queue_head->_ooo_engine_id);
54        else
55          cmp = true;
56           
57        // Test if this bypass is valid
58        if ( (PORT_READ (in_SPR_WRITE_VAL [i]) == 1) and cmp)
59          {
60            if (_queue_head->_num_reg_rc == PORT_READ(in_SPR_WRITE_NUM_REG [i]))
61              {
62                log_printf(TRACE,Read_queue,FUNCTION," * internal_READ_QUEUE_OUT_DATA_RC_VAL   - bypass hit (%d)",i);
63                internal_READ_QUEUE_OUT_DATA_RC_VAL = 1;
64#ifdef SYSTEMC_VHDL_COMPATIBILITY
65                if (_queue_head->_read_rc == 1)
66#endif
67                internal_READ_QUEUE_OUT_DATA_RC     = PORT_READ(in_SPR_WRITE_DATA [i]);
68              }
69          }
70      }
71
72    // Affectation out port
73    PORT_WRITE(out_READ_QUEUE_OUT_DATA_RC_VAL,internal_READ_QUEUE_OUT_DATA_RC_VAL);
74    PORT_WRITE(out_READ_QUEUE_OUT_DATA_RC    ,internal_READ_QUEUE_OUT_DATA_RC    );
75
76    log_printf(FUNC,Read_queue,FUNCTION,"End");
77  };
78
79}; // end namespace read_queue
80}; // end namespace read_unit
81}; // end namespace multi_read_unit
82}; // end namespace execute_loop
83}; // end namespace multi_execute_loop
84}; // end namespace core
85
86}; // end namespace behavioural
87}; // end namespace morpheo             
88#endif
Note: See TracBrowser for help on using the repository browser.