source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/src/Decod_queue_function_one_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: 4.6 KB
Line 
1#ifdef SYSTEMC
2/*
3 * $Id: Decod_queue_function_one_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_one_fifo_genMoore"
22  void Decod_queue::function_one_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      Tcontrol_t ack = reg_QUEUE->size() < _param->_size_queue;
34
35      for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
36        {
37          internal_DECOD_IN_ACK [i] = ack;
38        }
39    }
40
41    //--------------------------------------------------------------------
42    //-----[ DECOD_OUT ]--------------------------------------------------
43    //--------------------------------------------------------------------
44    if (not reg_QUEUE->empty())
45      for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
46        {
47          uint32_t index = reg_LAST_SLOT + i;
48
49          // Stop
50          if (index >= _param->_nb_inst_decod)
51            break;
52
53          if (_param->_have_port_context_id)
54          PORT_WRITE(out_DECOD_OUT_CONTEXT_ID    [i],reg_QUEUE->front()->_context_id    [index]);
55          if (_param->_have_port_depth)
56          PORT_WRITE(out_DECOD_OUT_DEPTH         [i],reg_QUEUE->front()->_depth         [index]);
57          PORT_WRITE(out_DECOD_OUT_TYPE          [i],reg_QUEUE->front()->_type          [index]);
58          PORT_WRITE(out_DECOD_OUT_OPERATION     [i],reg_QUEUE->front()->_operation     [index]);
59          PORT_WRITE(out_DECOD_OUT_NO_EXECUTE    [i],reg_QUEUE->front()->_no_execute    [index]);
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->front()->_is_delay_slot [index]);
63#ifdef DEBUG
64          PORT_WRITE(out_DECOD_OUT_ADDRESS       [i],reg_QUEUE->front()->_address       [index]);
65#endif
66          PORT_WRITE(out_DECOD_OUT_ADDRESS_NEXT  [i],reg_QUEUE->front()->_address_next  [index]);
67          PORT_WRITE(out_DECOD_OUT_HAS_IMMEDIAT  [i],reg_QUEUE->front()->_has_immediat  [index]);
68          PORT_WRITE(out_DECOD_OUT_IMMEDIAT      [i],reg_QUEUE->front()->_immediat      [index]);
69          PORT_WRITE(out_DECOD_OUT_READ_RA       [i],reg_QUEUE->front()->_read_ra       [index]);
70          PORT_WRITE(out_DECOD_OUT_NUM_REG_RA    [i],reg_QUEUE->front()->_num_reg_ra    [index]);
71          PORT_WRITE(out_DECOD_OUT_READ_RB       [i],reg_QUEUE->front()->_read_rb       [index]);
72          PORT_WRITE(out_DECOD_OUT_NUM_REG_RB    [i],reg_QUEUE->front()->_num_reg_rb    [index]);
73          PORT_WRITE(out_DECOD_OUT_READ_RC       [i],reg_QUEUE->front()->_read_rc       [index]);
74          PORT_WRITE(out_DECOD_OUT_NUM_REG_RC    [i],reg_QUEUE->front()->_num_reg_rc    [index]);
75          PORT_WRITE(out_DECOD_OUT_WRITE_RD      [i],reg_QUEUE->front()->_write_rd      [index]);
76          PORT_WRITE(out_DECOD_OUT_NUM_REG_RD    [i],reg_QUEUE->front()->_num_reg_rd    [index]);
77          PORT_WRITE(out_DECOD_OUT_WRITE_RE      [i],reg_QUEUE->front()->_write_re      [index]);
78          PORT_WRITE(out_DECOD_OUT_NUM_REG_RE    [i],reg_QUEUE->front()->_num_reg_re    [index]);
79          PORT_WRITE(out_DECOD_OUT_EXCEPTION_USE [i],reg_QUEUE->front()->_exception_use [index]);
80          PORT_WRITE(out_DECOD_OUT_EXCEPTION     [i],reg_QUEUE->front()->_exception     [index]);
81        }
82
83    //--------------------------------------------------------------------
84    //-----[ NB_INST ]----------------------------------------------------
85    //--------------------------------------------------------------------
86    for (uint32_t i=0; i<_param->_nb_context; i++)
87      PORT_WRITE(out_NB_INST_ALL [i], reg_NB_INST [i]);
88      }
89    else
90      {
91        for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
92          {
93            internal_DECOD_IN_ACK [i] = 0;
94          }
95        for (uint32_t i=0; i<_param->_nb_context; i++)
96          PORT_WRITE(out_NB_INST_ALL [i], 0);
97      }
98     
99    // Write output
100    for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
101      {
102        PORT_WRITE(out_DECOD_IN_ACK [i],internal_DECOD_IN_ACK [i]);
103      }
104
105
106    log_end(Decod_queue,FUNCTION);
107  };
108
109}; // end namespace decod_queue
110}; // end namespace decod_unit
111}; // end namespace front_end
112}; // end namespace multi_front_end
113}; // end namespace core
114
115}; // end namespace behavioural
116}; // end namespace morpheo             
117#endif
Note: See TracBrowser for help on using the repository browser.