source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/src/Decod_transition.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: 1.8 KB
Line 
1#ifdef SYSTEMC
2/*
3 * $Id: Decod_transition.cpp 88 2008-12-10 18:31:39Z rosiere $
4 *
5 * [ Description ]
6 *
7 */
8
9#include "Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/include/Decod.h"
10
11namespace morpheo                    {
12namespace behavioural {
13namespace core {
14namespace multi_front_end {
15namespace front_end {
16namespace decod_unit {
17namespace decod {
18
19
20#undef  FUNCTION
21#define FUNCTION "Decod::transition"
22  void Decod::transition (void)
23  {
24    log_begin(Decod,FUNCTION);
25
26    if (PORT_READ(in_NRESET) == 0)
27      {
28        _priority->reset();
29
30        for (uint32_t i=0; i<_param->_nb_context; i++)
31          {
32            reg_CONTEXT_ADDRESS_PREVIOUS [i] = 0xfc; // 0x100-4. (0x100 : reset address)
33            reg_CONTEXT_IS_DELAY_SLOT    [i] = 0;
34          }
35      }
36    else
37      {
38        _priority->transition();
39
40        // Compute "next previous" address
41        for (uint32_t i=0; i<_param->_nb_context; i++)
42          if (internal_CONTEXT_HAVE_TRANSACTION[i])
43            {
44              reg_CONTEXT_ADDRESS_PREVIOUS [i] = internal_CONTEXT_ADDRESS_PREVIOUS [i];
45              reg_CONTEXT_IS_DELAY_SLOT    [i] = internal_CONTEXT_IS_DELAY_SLOT    [i];
46            }
47
48//      for (uint32_t i=0; i<_param->_nb_context; i++)
49//        log_printf(TRACE,Decod,FUNCTION,"[%d] %.8x %d",i,reg_CONTEXT_ADDRESS_PREVIOUS [i], reg_CONTEXT_IS_DELAY_SLOT [i]);
50
51#ifdef STATISTICS
52        if (usage_is_set(_usage,USE_STATISTICS))
53          for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
54            if (internal_DECOD_VAL [i] and PORT_READ(in_DECOD_ACK[i]))
55              (*_stat_sum_inst_decod) ++;
56#endif
57      }
58
59#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
60    end_cycle ();
61#endif
62
63    log_end(Decod,FUNCTION);
64  };
65
66}; // end namespace decod
67}; // end namespace decod_unit
68}; // end namespace front_end
69}; // end namespace multi_front_end
70}; // end namespace core
71
72}; // end namespace behavioural
73}; // end namespace morpheo             
74#endif
Note: See TracBrowser for help on using the repository browser.