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

Last change on this file since 88 was 88, checked in by rosiere, 15 years ago

Almost complete design
with Test and test platform

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