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 @ 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: 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//     cout << "yo1 : " << internal_READ_QUEUE_OUT_DATA_RC << endl;
48
49    // Test all bypass
50    for (uint32_t i=0; i<_param->_nb_spr_write ; i++)
51      {
52        // Test if this bypass is valid
53        if ( (PORT_READ (in_SPR_WRITE_VAL           [i]) == 1) and
54             (PORT_READ (in_SPR_WRITE_OOO_ENGINE_ID [i]) == _queue_head->_ooo_engine_id)
55             )
56          {
57            if (_queue_head->_num_reg_rc == PORT_READ(in_SPR_WRITE_NUM_REG [i]))
58              {
59                log_printf(TRACE,Read_queue,FUNCTION," * internal_READ_QUEUE_OUT_DATA_RC_VAL   - bypass hit (%d)",i);
60                internal_READ_QUEUE_OUT_DATA_RC_VAL = 1;
61                internal_READ_QUEUE_OUT_DATA_RC     = PORT_READ(in_SPR_WRITE_DATA [i]);
62              }
63          }
64      }
65
66//     cout << "yo2 : " << internal_READ_QUEUE_OUT_DATA_RC << endl;
67
68    // Affectation out port
69    PORT_WRITE(out_READ_QUEUE_OUT_DATA_RC_VAL,internal_READ_QUEUE_OUT_DATA_RC_VAL);
70    PORT_WRITE(out_READ_QUEUE_OUT_DATA_RC    ,internal_READ_QUEUE_OUT_DATA_RC    );
71
72    log_printf(FUNC,Read_queue,FUNCTION,"End");
73  };
74
75}; // end namespace read_queue
76}; // end namespace read_unit
77}; // end namespace multi_read_unit
78}; // end namespace execute_loop
79}; // end namespace multi_execute_loop
80}; // end namespace core
81
82}; // end namespace behavioural
83}; // end namespace morpheo             
84#endif
Note: See TracBrowser for help on using the repository browser.