1 | #ifdef SYSTEMC |
---|
2 | /* |
---|
3 | * $Id: Decod_transition.cpp 139 2010-07-30 14:47:27Z rosiere $ |
---|
4 | * |
---|
5 | * [ Description ] |
---|
6 | * |
---|
7 | */ |
---|
8 | |
---|
9 | #include "Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/include/Decod.h" |
---|
10 | |
---|
11 | namespace morpheo { |
---|
12 | namespace behavioural { |
---|
13 | namespace core { |
---|
14 | namespace multi_front_end { |
---|
15 | namespace front_end { |
---|
16 | namespace decod_unit { |
---|
17 | namespace 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 | // reg_CONTEXT_SAVE_RAT [i] = 0; |
---|
35 | } |
---|
36 | } |
---|
37 | else |
---|
38 | { |
---|
39 | _priority->transition(); |
---|
40 | |
---|
41 | // Compute "next previous" address |
---|
42 | for (uint32_t i=0; i<_param->_nb_context; i++) |
---|
43 | if (internal_CONTEXT_HAVE_TRANSACTION[i]) |
---|
44 | { |
---|
45 | reg_CONTEXT_ADDRESS_PREVIOUS [i] = internal_CONTEXT_ADDRESS_PREVIOUS [i]; |
---|
46 | reg_CONTEXT_IS_DELAY_SLOT [i] = internal_CONTEXT_IS_DELAY_SLOT [i]; |
---|
47 | // reg_CONTEXT_SAVE_RAT [i] = internal_CONTEXT_SAVE_RAT [i]; |
---|
48 | } |
---|
49 | |
---|
50 | // for (uint32_t i=0; i<_param->_nb_context; i++) |
---|
51 | // log_printf(TRACE,Decod,FUNCTION,"[%d] %.8x %d",i,reg_CONTEXT_ADDRESS_PREVIOUS [i], reg_CONTEXT_IS_DELAY_SLOT [i]); |
---|
52 | |
---|
53 | #ifdef STATISTICS |
---|
54 | if (usage_is_set(_usage,USE_STATISTICS)) |
---|
55 | for (uint32_t i=0; i<_param->_nb_inst_decod; i++) |
---|
56 | if (internal_DECOD_VAL [i] and PORT_READ(in_DECOD_ACK[i])) |
---|
57 | (*_stat_sum_inst_decod) ++; |
---|
58 | #endif |
---|
59 | } |
---|
60 | |
---|
61 | #if defined(STATISTICS) or defined(VHDL_TESTBENCH) |
---|
62 | end_cycle (); |
---|
63 | #endif |
---|
64 | |
---|
65 | log_end(Decod,FUNCTION); |
---|
66 | }; |
---|
67 | |
---|
68 | }; // end namespace decod |
---|
69 | }; // end namespace decod_unit |
---|
70 | }; // end namespace front_end |
---|
71 | }; // end namespace multi_front_end |
---|
72 | }; // end namespace core |
---|
73 | |
---|
74 | }; // end namespace behavioural |
---|
75 | }; // end namespace morpheo |
---|
76 | #endif |
---|