source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Core_Glue/src/Core_Glue_genMealy_branch_complete.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.4 KB
Line 
1#ifdef SYSTEMC
2/*
3 * $Id: Core_Glue_genMealy_branch_complete.cpp 123 2009-06-08 20:43:30Z rosiere $
4 *
5 * [ Description ]
6 *
7 */
8
9#include "Behavioural/Core/Core_Glue/include/Core_Glue.h"
10
11namespace morpheo                    {
12namespace behavioural {
13namespace core {
14namespace core_glue {
15
16
17#undef  FUNCTION
18#define FUNCTION "Core_Glue::genMealy_branch_complete"
19  void Core_Glue::genMealy_branch_complete (void)
20  {
21    log_begin(Core_Glue,FUNCTION);
22    log_function(Core_Glue,FUNCTION,_name.c_str());
23
24    Tcontrol_t BRANCH_COMPLETE_FRONT_END_VAL  [_param->_nb_front_end ][_param->_max_front_end_nb_inst_branch_complete ];
25    Tcontrol_t BRANCH_COMPLETE_OOO_ENGINE_ACK [_param->_nb_ooo_engine][_param->_max_ooo_engine_nb_inst_branch_complete];
26
27    // init val/ack at 0
28    for (uint32_t i=0; i<_param->_nb_front_end; ++i)
29      for (uint32_t j=0; j<_param->_front_end_nb_inst_branch_complete[i]; ++j)
30        BRANCH_COMPLETE_FRONT_END_VAL [i][j] = 0;
31    for (uint32_t i=0; i<_param->_nb_ooo_engine; ++i)
32      for (uint32_t j=0; j<_param->_ooo_engine_nb_inst_branch_complete[i]; ++j)
33        BRANCH_COMPLETE_OOO_ENGINE_ACK [i][j] = 0;
34
35    if (PORT_READ(in_NRESET))
36      {
37    for (uint32_t i=0; i<_param->_nb_ooo_engine; ++i)
38      for (uint32_t j=0; j<_param->_ooo_engine_nb_inst_branch_complete[i]; ++j)
39        {
40          // Take the ooo_engine.num_front_end and translate in core.num_front_end
41          Tcontext_t front_end_id  = (_param->_have_port_front_end_id)?PORT_READ(in_BRANCH_COMPLETE_OOO_ENGINE_FRONT_END_ID [i][j]):0;
42          Tcontext_t num_front_end = _param->_translate_ooo_engine_num_front_end [i][front_end_id];
43
44          // Warning : ooo_engine.nb_inst_branch_complete[i] = front_end.nb_inst_branch_complete[num_front_end]
45//           log_printf(TRACE,Core_Glue,FUNCTION,"  * [%d][%d] front_end_id %d, num_front_end %d",i,j,front_end_id,num_front_end);
46
47          BRANCH_COMPLETE_FRONT_END_VAL [num_front_end][j] = PORT_READ(in_BRANCH_COMPLETE_OOO_ENGINE_VAL [i][j]);
48          BRANCH_COMPLETE_OOO_ENGINE_ACK [i][j] = PORT_READ(in_BRANCH_COMPLETE_FRONT_END_ACK [num_front_end][j]);
49         
50          if (_param->_have_port_context_id)
51          PORT_WRITE(out_BRANCH_COMPLETE_FRONT_END_CONTEXT_ID [num_front_end][j],PORT_READ(in_BRANCH_COMPLETE_OOO_ENGINE_CONTEXT_ID [i][j]));
52          if (_param->_have_port_depth)
53          PORT_WRITE(out_BRANCH_COMPLETE_FRONT_END_DEPTH      [num_front_end][j],PORT_READ(in_BRANCH_COMPLETE_OOO_ENGINE_DEPTH      [i][j]));
54          PORT_WRITE(out_BRANCH_COMPLETE_FRONT_END_ADDRESS    [num_front_end][j],PORT_READ(in_BRANCH_COMPLETE_OOO_ENGINE_ADDRESS    [i][j]));
55          PORT_WRITE(out_BRANCH_COMPLETE_FRONT_END_NO_SEQUENCE[num_front_end][j],PORT_READ(in_BRANCH_COMPLETE_OOO_ENGINE_NO_SEQUENCE[i][j]));
56          PORT_WRITE(out_BRANCH_COMPLETE_OOO_ENGINE_MISS_PREDICTION [i][j], PORT_READ(in_BRANCH_COMPLETE_FRONT_END_MISS_PREDICTION [num_front_end][j]));
57        }
58      }
59
60    for (uint32_t i=0; i<_param->_nb_front_end; ++i)
61      for (uint32_t j=0; j<_param->_front_end_nb_inst_branch_complete[i]; ++j)
62        PORT_WRITE(out_BRANCH_COMPLETE_FRONT_END_VAL [i][j], BRANCH_COMPLETE_FRONT_END_VAL [i][j]);
63
64    for (uint32_t i=0; i<_param->_nb_ooo_engine; ++i)
65      for (uint32_t j=0; j<_param->_ooo_engine_nb_inst_branch_complete[i]; ++j)
66        PORT_WRITE(out_BRANCH_COMPLETE_OOO_ENGINE_ACK [i][j], BRANCH_COMPLETE_OOO_ENGINE_ACK [i][j]);
67
68    log_end(Core_Glue,FUNCTION);
69  };
70
71}; // end namespace core_glue
72}; // end namespace core
73
74}; // end namespace behavioural
75}; // end namespace morpheo             
76#endif
Note: See TracBrowser for help on using the repository browser.