source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_queue/src/Ifetch_queue_genMoore.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: 2.4 KB
Line 
1#ifdef SYSTEMC
2/*
3 * $Id: Ifetch_queue_genMoore.cpp 88 2008-12-10 18:31:39Z rosiere $
4 *
5 * [ Description ]
6 *
7 */
8
9#include "Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_queue/include/Ifetch_queue.h"
10
11namespace morpheo                    {
12namespace behavioural {
13namespace core {
14namespace multi_front_end {
15namespace front_end {
16namespace ifetch_unit {
17namespace ifetch_queue {
18
19#undef  FUNCTION
20#define FUNCTION "Ifetch_queue::genMoore"
21  void Ifetch_queue::genMoore (void)
22  {
23    log_printf(FUNC,Ifetch_queue,FUNCTION,"Begin");
24
25    // ==========================================================
26    // =====[ ADDRESS ]==========================================
27    // ==========================================================
28    internal_ADDRESS_ACK = (_queue[reg_PTR_WRITE]->_state == IFETCH_QUEUE_STATE_EMPTY);
29
30    PORT_WRITE(out_ADDRESS_ACK            , internal_ADDRESS_ACK);
31    if (_param->_have_port_ifetch_queue_ptr)
32    PORT_WRITE(out_ADDRESS_IFETCH_QUEUE_ID, reg_PTR_WRITE);
33
34    // ==========================================================
35    // =====[ DECOD ]============================================
36    // ==========================================================
37    bool ack = (_queue[reg_PTR_READ]->_state == IFETCH_QUEUE_STATE_HAVE_RSP);
38
39    for (uint32_t i=0; i<_param->_nb_instruction; i++)
40      {
41        internal_DECOD_VAL [i] = ack and _queue[reg_PTR_READ]->_instruction_enable [i];
42        PORT_WRITE(out_DECOD_VAL         [i], internal_DECOD_VAL [i]);
43        PORT_WRITE(out_DECOD_INSTRUCTION [i],         _queue[reg_PTR_READ]->_instruction        [i]);
44      }
45
46    PORT_WRITE(out_DECOD_ADDRESS                    , _queue[reg_PTR_READ]->_address                    );
47    if (_param->_have_port_inst_ifetch_ptr)
48    PORT_WRITE(out_DECOD_INST_IFETCH_PTR            , _queue[reg_PTR_READ]->_inst_ifetch_ptr            );
49    PORT_WRITE(out_DECOD_BRANCH_STATE               , _queue[reg_PTR_READ]->_branch_state               );
50    if (_param->_have_port_depth)
51    PORT_WRITE(out_DECOD_BRANCH_UPDATE_PREDICTION_ID, _queue[reg_PTR_READ]->_branch_update_prediction_id);
52    PORT_WRITE(out_DECOD_EXCEPTION                  , _queue[reg_PTR_READ]->_exception                  );
53
54    log_printf(FUNC,Ifetch_queue,FUNCTION,"End");
55  };
56
57}; // end namespace ifetch_queue
58}; // end namespace ifetch_unit
59}; // end namespace front_end
60}; // end namespace multi_front_end
61}; // end namespace core
62}; // end namespace behavioural
63}; // end namespace morpheo             
64#endif
Note: See TracBrowser for help on using the repository browser.