source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/src/Decod_queue_function_multi_fifo_genMoore.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: 5.0 KB
Line 
1#ifdef SYSTEMC
2/*
3 * $Id: Decod_queue_function_multi_fifo_genMoore.cpp 123 2009-06-08 20:43:30Z rosiere $
4 *
5 * [ Description ]
6 *
7 */
8
9#include "Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/include/Decod_queue.h"
10
11namespace morpheo                    {
12namespace behavioural {
13namespace core {
14namespace multi_front_end {
15namespace front_end {
16namespace decod_unit {
17namespace decod_queue {
18
19
20#undef  FUNCTION
21#define FUNCTION "Decod_queue::function_multi_fifo_genMoore"
22  void Decod_queue::function_multi_fifo_genMoore (void)
23  {
24    log_begin(Decod_queue,FUNCTION);
25    log_function(Decod_queue,FUNCTION,_name.c_str());
26
27    if (PORT_READ(in_NRESET))
28      {
29    //--------------------------------------------------------------------
30    //-----[ DECOD_IN ]---------------------------------------------------
31    //--------------------------------------------------------------------
32    {
33      uint32_t num_bank = reg_NUM_BANK_TAIL;
34
35      for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
36        {
37          internal_DECOD_IN_ACK [i] = (reg_QUEUE[num_bank].size() < _param->_size_queue);
38
39          num_bank = (num_bank+1)%_param->_nb_bank;
40        }
41    }
42
43    //--------------------------------------------------------------------
44    //-----[ DECOD_OUT ]--------------------------------------------------
45    //--------------------------------------------------------------------
46    {
47      uint32_t num_bank = reg_NUM_BANK_HEAD%_param->_nb_bank;
48
49        for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
50          {
51            if (not reg_QUEUE[num_bank].empty())
52              {
53                if (_param->_have_port_context_id)
54                PORT_WRITE(out_DECOD_OUT_CONTEXT_ID    [i],reg_QUEUE[num_bank].front()->_context_id    [0]);
55                if (_param->_have_port_depth)
56                PORT_WRITE(out_DECOD_OUT_DEPTH         [i],reg_QUEUE[num_bank].front()->_depth         [0]);
57                PORT_WRITE(out_DECOD_OUT_TYPE          [i],reg_QUEUE[num_bank].front()->_type          [0]);
58                PORT_WRITE(out_DECOD_OUT_OPERATION     [i],reg_QUEUE[num_bank].front()->_operation     [0]);
59                PORT_WRITE(out_DECOD_OUT_NO_EXECUTE    [i],reg_QUEUE[num_bank].front()->_no_execute    [0]);
60//              PORT_WRITE(out_DECOD_OUT_HAVE_EVENT    [i],0);
61                PORT_WRITE(out_DECOD_OUT_LAST_EVENT    [i],0);
62                PORT_WRITE(out_DECOD_OUT_IS_DELAY_SLOT [i],reg_QUEUE[num_bank].front()->_is_delay_slot [0]);
63#ifdef DEBUG
64                PORT_WRITE(out_DECOD_OUT_ADDRESS       [i],reg_QUEUE[num_bank].front()->_address       [0]);
65#endif
66                PORT_WRITE(out_DECOD_OUT_ADDRESS_NEXT  [i],reg_QUEUE[num_bank].front()->_address_next  [0]);
67                PORT_WRITE(out_DECOD_OUT_HAS_IMMEDIAT  [i],reg_QUEUE[num_bank].front()->_has_immediat  [0]);
68                PORT_WRITE(out_DECOD_OUT_IMMEDIAT      [i],reg_QUEUE[num_bank].front()->_immediat      [0]);
69                PORT_WRITE(out_DECOD_OUT_READ_RA       [i],reg_QUEUE[num_bank].front()->_read_ra       [0]);
70                PORT_WRITE(out_DECOD_OUT_NUM_REG_RA    [i],reg_QUEUE[num_bank].front()->_num_reg_ra    [0]);
71                PORT_WRITE(out_DECOD_OUT_READ_RB       [i],reg_QUEUE[num_bank].front()->_read_rb       [0]);
72                PORT_WRITE(out_DECOD_OUT_NUM_REG_RB    [i],reg_QUEUE[num_bank].front()->_num_reg_rb    [0]);
73                PORT_WRITE(out_DECOD_OUT_READ_RC       [i],reg_QUEUE[num_bank].front()->_read_rc       [0]);
74                PORT_WRITE(out_DECOD_OUT_NUM_REG_RC    [i],reg_QUEUE[num_bank].front()->_num_reg_rc    [0]);
75                PORT_WRITE(out_DECOD_OUT_WRITE_RD      [i],reg_QUEUE[num_bank].front()->_write_rd      [0]);
76                PORT_WRITE(out_DECOD_OUT_NUM_REG_RD    [i],reg_QUEUE[num_bank].front()->_num_reg_rd    [0]);
77                PORT_WRITE(out_DECOD_OUT_WRITE_RE      [i],reg_QUEUE[num_bank].front()->_write_re      [0]);
78                PORT_WRITE(out_DECOD_OUT_NUM_REG_RE    [i],reg_QUEUE[num_bank].front()->_num_reg_re    [0]);
79                PORT_WRITE(out_DECOD_OUT_EXCEPTION_USE [i],reg_QUEUE[num_bank].front()->_exception_use [0]);
80                PORT_WRITE(out_DECOD_OUT_EXCEPTION     [i],reg_QUEUE[num_bank].front()->_exception     [0]);
81              }
82            num_bank = (num_bank+1)%_param->_nb_bank;
83          }
84    }
85
86    //--------------------------------------------------------------------
87    //-----[ NB_INST ]----------------------------------------------------
88    //--------------------------------------------------------------------
89    for (uint32_t i=0; i<_param->_nb_context; i++)
90      PORT_WRITE(out_NB_INST_ALL [i], reg_NB_INST [i]);
91      }
92    else
93      {
94        for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
95          {
96            internal_DECOD_IN_ACK [i] = 0;
97          }
98        for (uint32_t i=0; i<_param->_nb_context; i++)
99          PORT_WRITE(out_NB_INST_ALL [i], 0);
100      }
101
102
103    // Write output
104    for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
105      {
106        PORT_WRITE(out_DECOD_IN_ACK [i],internal_DECOD_IN_ACK [i]);
107      }
108
109
110    log_end(Decod_queue,FUNCTION);
111  };
112
113}; // end namespace decod_queue
114}; // end namespace decod_unit
115}; // end namespace front_end
116}; // end namespace multi_front_end
117}; // end namespace core
118
119}; // end namespace behavioural
120}; // end namespace morpheo             
121#endif
Note: See TracBrowser for help on using the repository browser.