source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Reexecute_unit/src/Reexecute_unit_genMealy_reexecute.cpp @ 98

Last change on this file since 98 was 98, checked in by rosiere, 15 years ago

1) Fix bug (read unit, RAT -> write in R0, SPR desallocation ...)
2) Change VHDL Execute_queue -> use Generic/Queue?
3) Complete document on VHDL generation
4) Add soc test

  • Property svn:keywords set to Id
File size: 3.6 KB
Line 
1#ifdef SYSTEMC
2/*
3 * $Id: Reexecute_unit_genMealy_reexecute.cpp 98 2008-12-31 10:18:08Z rosiere $
4 *
5 * [ Description ]
6 *
7 */
8
9#include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Reexecute_unit/include/Reexecute_unit.h"
10
11namespace morpheo                    {
12namespace behavioural {
13namespace core {
14namespace multi_ooo_engine {
15namespace ooo_engine {
16namespace reexecute_unit {
17
18
19#undef  FUNCTION
20#define FUNCTION "Reexecute_unit::genMealy_reexecute"
21  void Reexecute_unit::genMealy_reexecute (void)
22  {
23    log_begin(Reexecute_unit,FUNCTION);
24    log_function(Reexecute_unit,FUNCTION,_name.c_str());
25
26    // ===================================================================
27    // =====[ REEXECUTE ]=================================================
28    // ===================================================================
29    // Between reexecute_rob and rexecute_queue, reexecute_queue is most priotary
30   
31    for (uint32_t i=0; i<_param->_nb_inst_reexecute; i++)
32      {
33        Tcontrol_t val;
34        Tcontrol_t ack;
35
36        if (not _reexecute_queue [i].empty() and (_reexecute_queue [i].front()->state == STATE_REEXECUTE))
37          {
38            val = true ;
39            ack = false;
40
41            entry_t * entry = _reexecute_queue [i].front();
42
43            if (_param->_have_port_context_id)
44            PORT_WRITE(out_REEXECUTE_CONTEXT_ID            [i],entry->context_id    );
45            if (_param->_have_port_front_end_id)
46            PORT_WRITE(out_REEXECUTE_FRONT_END_ID          [i],entry->front_end_id  );
47            if (_param->_have_port_rob_ptr  )
48            PORT_WRITE(out_REEXECUTE_PACKET_ID             [i],entry->packet_id     );
49            PORT_WRITE(out_REEXECUTE_OPERATION             [i],entry->operation     );
50            PORT_WRITE(out_REEXECUTE_TYPE                  [i],entry->type          );
51            PORT_WRITE(out_REEXECUTE_STORE_QUEUE_PTR_WRITE [i],0);
52            PORT_WRITE(out_REEXECUTE_HAS_IMMEDIAT          [i],1);
53            PORT_WRITE(out_REEXECUTE_IMMEDIAT              [i],entry->data          );
54            PORT_WRITE(out_REEXECUTE_WRITE_RD              [i],entry->write_rd      );
55            PORT_WRITE(out_REEXECUTE_NUM_REG_RD            [i],entry->num_reg_rd    );
56          }
57        else
58          {
59            val = PORT_READ(in_REEXECUTE_ROB_VAL [i]);
60            ack = PORT_READ(in_REEXECUTE_ACK     [i]);
61
62            if (_param->_have_port_context_id)
63            PORT_WRITE(out_REEXECUTE_CONTEXT_ID            [i], PORT_READ(in_REEXECUTE_ROB_CONTEXT_ID              [i]));
64            if (_param->_have_port_front_end_id)
65            PORT_WRITE(out_REEXECUTE_FRONT_END_ID          [i], PORT_READ(in_REEXECUTE_ROB_FRONT_END_ID            [i]));
66            if (_param->_have_port_rob_ptr  )
67            PORT_WRITE(out_REEXECUTE_PACKET_ID             [i], PORT_READ(in_REEXECUTE_ROB_PACKET_ID               [i]));
68            PORT_WRITE(out_REEXECUTE_OPERATION             [i], PORT_READ(in_REEXECUTE_ROB_OPERATION               [i]));
69            PORT_WRITE(out_REEXECUTE_TYPE                  [i], PORT_READ(in_REEXECUTE_ROB_TYPE                    [i]));
70            PORT_WRITE(out_REEXECUTE_STORE_QUEUE_PTR_WRITE [i], PORT_READ(in_REEXECUTE_ROB_STORE_QUEUE_PTR_WRITE   [i]));
71            PORT_WRITE(out_REEXECUTE_HAS_IMMEDIAT          [i], 0);
72            PORT_WRITE(out_REEXECUTE_IMMEDIAT              [i], 0);
73            PORT_WRITE(out_REEXECUTE_WRITE_RD              [i], 0);
74            PORT_WRITE(out_REEXECUTE_NUM_REG_RD            [i], 0);
75          }
76
77        internal_REEXECUTE_VAL     [i] = val;
78        internal_REEXECUTE_ROB_ACK [i] = ack;
79
80        PORT_WRITE(out_REEXECUTE_VAL     [i], internal_REEXECUTE_VAL     [i]);
81        PORT_WRITE(out_REEXECUTE_ROB_ACK [i], internal_REEXECUTE_ROB_ACK [i]);
82      }
83
84    log_end(Reexecute_unit,FUNCTION);
85  };
86
87}; // end namespace reexecute_unit
88}; // end namespace ooo_engine
89}; // end namespace multi_ooo_engine
90}; // end namespace core
91
92}; // end namespace behavioural
93}; // end namespace morpheo             
94#endif
Note: See TracBrowser for help on using the repository browser.