source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Core_Glue/src/Core_Glue_genMealy_branch_complete.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.4 KB
Line 
1#ifdef SYSTEMC
2/*
3 * $Id: Core_Glue_genMealy_branch_complete.cpp 88 2008-12-10 18:31:39Z 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    for (uint32_t i=0; i<_param->_nb_ooo_engine; ++i)
36      for (uint32_t j=0; j<_param->_ooo_engine_nb_inst_branch_complete[i]; ++j)
37        {
38          // Take the ooo_engine.num_front_end and translate in core.num_front_end
39          Tcontext_t front_end_id  = (_param->_have_port_front_end_id)?PORT_READ(in_BRANCH_COMPLETE_OOO_ENGINE_FRONT_END_ID [i][j]):0;
40          Tcontext_t num_front_end = _param->_translate_ooo_engine_num_front_end [i][front_end_id];
41
42          // Warning : ooo_engine.nb_inst_branch_complete[i] = front_end.nb_inst_branch_complete[num_front_end]
43//           log_printf(TRACE,Core_Glue,FUNCTION,"  * [%d][%d] front_end_id %d, num_front_end %d",i,j,front_end_id,num_front_end);
44
45          BRANCH_COMPLETE_FRONT_END_VAL [num_front_end][j] = PORT_READ(in_BRANCH_COMPLETE_OOO_ENGINE_VAL [i][j]);
46          BRANCH_COMPLETE_OOO_ENGINE_ACK [i][j] = PORT_READ(in_BRANCH_COMPLETE_FRONT_END_ACK [num_front_end][j]);
47         
48          if (_param->_have_port_context_id)
49          PORT_WRITE(out_BRANCH_COMPLETE_FRONT_END_CONTEXT_ID [num_front_end][j],PORT_READ(in_BRANCH_COMPLETE_OOO_ENGINE_CONTEXT_ID [i][j]));
50          if (_param->_have_port_depth)
51          PORT_WRITE(out_BRANCH_COMPLETE_FRONT_END_DEPTH      [num_front_end][j],PORT_READ(in_BRANCH_COMPLETE_OOO_ENGINE_DEPTH      [i][j]));
52          PORT_WRITE(out_BRANCH_COMPLETE_FRONT_END_ADDRESS    [num_front_end][j],PORT_READ(in_BRANCH_COMPLETE_OOO_ENGINE_ADDRESS    [i][j]));
53          PORT_WRITE(out_BRANCH_COMPLETE_FRONT_END_FLAG       [num_front_end][j],PORT_READ(in_BRANCH_COMPLETE_OOO_ENGINE_FLAG       [i][j]));
54          PORT_WRITE(out_BRANCH_COMPLETE_OOO_ENGINE_MISS_PREDICTION [i][j], PORT_READ(in_BRANCH_COMPLETE_FRONT_END_MISS_PREDICTION [num_front_end][j]));
55        }
56
57    for (uint32_t i=0; i<_param->_nb_front_end; ++i)
58      for (uint32_t j=0; j<_param->_front_end_nb_inst_branch_complete[i]; ++j)
59        PORT_WRITE(out_BRANCH_COMPLETE_FRONT_END_VAL [i][j], BRANCH_COMPLETE_FRONT_END_VAL [i][j]);
60
61    for (uint32_t i=0; i<_param->_nb_ooo_engine; ++i)
62      for (uint32_t j=0; j<_param->_ooo_engine_nb_inst_branch_complete[i]; ++j)
63        PORT_WRITE(out_BRANCH_COMPLETE_OOO_ENGINE_ACK [i][j], BRANCH_COMPLETE_OOO_ENGINE_ACK [i][j]);
64
65    log_end(Core_Glue,FUNCTION);
66  };
67
68}; // end namespace core_glue
69}; // end namespace core
70
71}; // end namespace behavioural
72}; // end namespace morpheo             
73#endif
Note: See TracBrowser for help on using the repository browser.