source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Core_Glue/src/Core_Glue_genMealy_commit_event.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.3 KB
Line 
1#ifdef SYSTEMC
2/*
3 * $Id: Core_Glue_genMealy_commit_event.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#include "Common/include/Max.h"
11
12namespace morpheo                    {
13namespace behavioural {
14namespace core {
15namespace core_glue {
16
17
18#undef  FUNCTION
19#define FUNCTION "Core_Glue::genMealy_commit_event"
20  void Core_Glue::genMealy_commit_event (void)
21  {
22    log_begin(Core_Glue,FUNCTION);
23    log_function(Core_Glue,FUNCTION,_name.c_str());
24
25    Tcontrol_t COMMIT_EVENT_FRONT_END_VAL  [_param->_nb_front_end ];
26    Tcontrol_t COMMIT_EVENT_OOO_ENGINE_ACK [_param->_nb_ooo_engine];
27   
28    // init val/ack at 0
29    for (uint32_t i=0; i<_param->_nb_front_end; ++i)
30      COMMIT_EVENT_FRONT_END_VAL [i] = 0;
31    for (uint32_t i=0; i<_param->_nb_ooo_engine; ++i)
32      COMMIT_EVENT_OOO_ENGINE_ACK [i] = 0;
33
34     for (uint32_t i=0; i<_param->_nb_ooo_engine; ++i)
35       {
36         // Take the ooo_engine.num_front_end and translate in core.num_front_end
37         Tcontext_t front_end_id  = (_param->_have_port_front_end_id)?PORT_READ(in_COMMIT_EVENT_OOO_ENGINE_FRONT_END_ID [i]):0;
38         Tcontext_t num_front_end = _param->_translate_ooo_engine_num_front_end [i][front_end_id];
39         
40          // Warning : ooo_engine.nb_inst_commit_event[i] = front_end.nb_inst_commit_event[num_front_end]
41//           log_printf(TRACE,Core_Glue,FUNCTION,"  * [%d][%d] front_end_id %d, num_front_end %d",i,j,front_end_id,num_front_end);
42
43         COMMIT_EVENT_FRONT_END_VAL [num_front_end] = PORT_READ(in_COMMIT_EVENT_OOO_ENGINE_VAL [i]);
44         COMMIT_EVENT_OOO_ENGINE_ACK [i] = PORT_READ(in_COMMIT_EVENT_FRONT_END_ACK [num_front_end]);
45
46         if (_param->_have_port_context_id)
47         PORT_WRITE(out_COMMIT_EVENT_FRONT_END_CONTEXT_ID       [num_front_end], PORT_READ(in_COMMIT_EVENT_OOO_ENGINE_CONTEXT_ID       [i]));
48         if (_param->_have_port_depth)
49         PORT_WRITE(out_COMMIT_EVENT_FRONT_END_DEPTH            [num_front_end], PORT_READ(in_COMMIT_EVENT_OOO_ENGINE_DEPTH            [i]));
50         PORT_WRITE(out_COMMIT_EVENT_FRONT_END_TYPE             [num_front_end], PORT_READ(in_COMMIT_EVENT_OOO_ENGINE_TYPE             [i]));
51         PORT_WRITE(out_COMMIT_EVENT_FRONT_END_IS_DELAY_SLOT    [num_front_end], PORT_READ(in_COMMIT_EVENT_OOO_ENGINE_IS_DELAY_SLOT    [i]));
52         PORT_WRITE(out_COMMIT_EVENT_FRONT_END_ADDRESS          [num_front_end], PORT_READ(in_COMMIT_EVENT_OOO_ENGINE_ADDRESS          [i]));
53         PORT_WRITE(out_COMMIT_EVENT_FRONT_END_ADDRESS_EPCR     [num_front_end], PORT_READ(in_COMMIT_EVENT_OOO_ENGINE_ADDRESS_EPCR     [i]));
54         PORT_WRITE(out_COMMIT_EVENT_FRONT_END_ADDRESS_EEAR_VAL [num_front_end], PORT_READ(in_COMMIT_EVENT_OOO_ENGINE_ADDRESS_EEAR_VAL [i]));
55         PORT_WRITE(out_COMMIT_EVENT_FRONT_END_ADDRESS_EEAR     [num_front_end], PORT_READ(in_COMMIT_EVENT_OOO_ENGINE_ADDRESS_EEAR     [i]));
56       }
57
58    for (uint32_t i=0; i<_param->_nb_front_end; ++i)
59      PORT_WRITE(out_COMMIT_EVENT_FRONT_END_VAL [i], COMMIT_EVENT_FRONT_END_VAL [i]);
60   
61    for (uint32_t i=0; i<_param->_nb_ooo_engine; ++i)
62      PORT_WRITE(out_COMMIT_EVENT_OOO_ENGINE_ACK [i], COMMIT_EVENT_OOO_ENGINE_ACK [i]);
63
64    log_end(Core_Glue,FUNCTION);
65  };
66
67}; // end namespace core_glue
68}; // end namespace core
69
70}; // end namespace behavioural
71}; // end namespace morpheo             
72#endif
Note: See TracBrowser for help on using the repository browser.