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

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

1) Stat List : scan all queue to find free register
2) Write_queue : test "genMealy" add bypass [0]
3) Functionnal_unit : add const parameters to add or not the pipeline_in
4) Load Store Unit : if load make an exception, free nb_check
5) Debug, change test to add model

  • Property svn:keywords set to Id
File size: 4.4 KB
Line 
1#ifdef SYSTEMC
2/*
3 * $Id: Reexecute_unit_genMealy_reexecute.cpp 118 2009-05-20 22:01:32Z 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        log_printf(TRACE,Reexecute_unit,FUNCTION,"  * REEXECUTE[%d]",i);
37
38        if (not _reexecute_queue [i].empty() and (_reexecute_queue [i].front()->state == STATE_REEXECUTE))
39          {
40            val = true ;
41            ack = false;
42
43            entry_t * entry = _reexecute_queue [i].front();
44            Tpacket_t packet_id = (_param->_have_port_rob_ptr)?entry->packet_id:0;
45
46            log_printf(TRACE,Reexecute_unit,FUNCTION,"    * From Reexecute_queue");
47            log_printf(TRACE,Reexecute_unit,FUNCTION,"    * packet_id : %d",packet_id);
48
49            if (_param->_have_port_context_id)
50            PORT_WRITE(out_REEXECUTE_CONTEXT_ID            [i],entry->context_id    );
51            if (_param->_have_port_front_end_id)
52            PORT_WRITE(out_REEXECUTE_FRONT_END_ID          [i],entry->front_end_id  );
53            if (_param->_have_port_rob_ptr  )
54            PORT_WRITE(out_REEXECUTE_PACKET_ID             [i],       packet_id     );
55            PORT_WRITE(out_REEXECUTE_OPERATION             [i],entry->operation     );
56            PORT_WRITE(out_REEXECUTE_TYPE                  [i],entry->type          );
57            PORT_WRITE(out_REEXECUTE_STORE_QUEUE_PTR_WRITE [i],0);
58            PORT_WRITE(out_REEXECUTE_HAS_IMMEDIAT          [i],1);
59            PORT_WRITE(out_REEXECUTE_IMMEDIAT              [i],entry->data          );
60            PORT_WRITE(out_REEXECUTE_WRITE_RD              [i],entry->write_rd      );
61            PORT_WRITE(out_REEXECUTE_NUM_REG_RD            [i],entry->num_reg_rd    );
62          }
63        else
64          {
65            val = PORT_READ(in_REEXECUTE_ROB_VAL [i]);
66            ack = PORT_READ(in_REEXECUTE_ACK     [i]);
67
68            Tpacket_t packet_id = (_param->_have_port_rob_ptr)?PORT_READ(in_REEXECUTE_ROB_PACKET_ID [i]):0;
69
70            log_printf(TRACE,Reexecute_unit,FUNCTION,"    * From ROB");
71            log_printf(TRACE,Reexecute_unit,FUNCTION,"    * val & ack : %d",val and ack);
72            log_printf(TRACE,Reexecute_unit,FUNCTION,"    * have ??   : %d",_param->_have_port_rob_ptr);
73            log_printf(TRACE,Reexecute_unit,FUNCTION,"    * packet_id : %d",packet_id);
74
75            if (_param->_have_port_context_id)
76            PORT_WRITE(out_REEXECUTE_CONTEXT_ID            [i], PORT_READ(in_REEXECUTE_ROB_CONTEXT_ID              [i]));
77            if (_param->_have_port_front_end_id)
78            PORT_WRITE(out_REEXECUTE_FRONT_END_ID          [i], PORT_READ(in_REEXECUTE_ROB_FRONT_END_ID            [i]));
79            if (_param->_have_port_rob_ptr  )
80            PORT_WRITE(out_REEXECUTE_PACKET_ID             [i],                            packet_id                   );
81            PORT_WRITE(out_REEXECUTE_OPERATION             [i], PORT_READ(in_REEXECUTE_ROB_OPERATION               [i]));
82            PORT_WRITE(out_REEXECUTE_TYPE                  [i], PORT_READ(in_REEXECUTE_ROB_TYPE                    [i]));
83            PORT_WRITE(out_REEXECUTE_STORE_QUEUE_PTR_WRITE [i], PORT_READ(in_REEXECUTE_ROB_STORE_QUEUE_PTR_WRITE   [i]));
84            PORT_WRITE(out_REEXECUTE_HAS_IMMEDIAT          [i], 0);
85            PORT_WRITE(out_REEXECUTE_IMMEDIAT              [i], 0);
86            PORT_WRITE(out_REEXECUTE_WRITE_RD              [i], 0);
87            PORT_WRITE(out_REEXECUTE_NUM_REG_RD            [i], 0);
88          }
89
90        internal_REEXECUTE_VAL     [i] = val;
91        internal_REEXECUTE_ROB_ACK [i] = ack;
92
93        PORT_WRITE(out_REEXECUTE_VAL     [i], internal_REEXECUTE_VAL     [i]);
94        PORT_WRITE(out_REEXECUTE_ROB_ACK [i], internal_REEXECUTE_ROB_ACK [i]);
95      }
96
97    log_end(Reexecute_unit,FUNCTION);
98  };
99
100}; // end namespace reexecute_unit
101}; // end namespace ooo_engine
102}; // end namespace multi_ooo_engine
103}; // end namespace core
104
105}; // end namespace behavioural
106}; // end namespace morpheo             
107#endif
Note: See TracBrowser for help on using the repository browser.