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

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

1) Fix performance
2) add auto generation to SPECINT2000
3) add reset in genMoore and genMealy

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