1 | #ifdef SYSTEMC |
---|
2 | /* |
---|
3 | * $Id: Context_State_genMealy_context_event.cpp 123 2009-06-08 20:43:30Z rosiere $ |
---|
4 | * |
---|
5 | * [ Description ] |
---|
6 | * |
---|
7 | */ |
---|
8 | |
---|
9 | #include "Behavioural/Core/Multi_Front_end/Front_end/Context_State/include/Context_State.h" |
---|
10 | |
---|
11 | namespace morpheo { |
---|
12 | namespace behavioural { |
---|
13 | namespace core { |
---|
14 | namespace multi_front_end { |
---|
15 | namespace front_end { |
---|
16 | namespace context_state { |
---|
17 | |
---|
18 | |
---|
19 | #undef FUNCTION |
---|
20 | #define FUNCTION "Context_State::genMealy_context_event" |
---|
21 | void Context_State::genMealy_context_event (void) |
---|
22 | { |
---|
23 | log_begin(Context_State,FUNCTION); |
---|
24 | log_function(Context_State,FUNCTION,_name.c_str()); |
---|
25 | |
---|
26 | bool context_event [_param->_nb_context]; |
---|
27 | |
---|
28 | // init |
---|
29 | for (uint32_t i=0; i<_param->_nb_context; ++i) |
---|
30 | context_event [i] = false; |
---|
31 | |
---|
32 | if (PORT_READ(in_NRESET)) |
---|
33 | { |
---|
34 | // Commit Event ? |
---|
35 | if (PORT_READ(in_COMMIT_EVENT_VAL)) |
---|
36 | { |
---|
37 | Tcontext_t context = (_param->_have_port_context_id)?PORT_READ(in_COMMIT_EVENT_CONTEXT_ID):0; |
---|
38 | |
---|
39 | context_event [context] = true; |
---|
40 | } |
---|
41 | |
---|
42 | // Miss ? |
---|
43 | for (uint32_t i=0; i<_param->_nb_inst_branch_complete; ++i) |
---|
44 | if (PORT_READ(in_BRANCH_COMPLETE_VAL [i]) and |
---|
45 | PORT_READ(in_BRANCH_COMPLETE_MISS_PREDICTION [i])) |
---|
46 | { |
---|
47 | Tcontext_t context = (_param->_have_port_context_id)?PORT_READ(in_BRANCH_COMPLETE_CONTEXT_ID [i]):0; |
---|
48 | |
---|
49 | context_event [context] = true; |
---|
50 | } |
---|
51 | |
---|
52 | for (uint32_t i=0; i<_param->_nb_context; ++i) |
---|
53 | PORT_WRITE(out_CONTEXT_EVENT [i], context_event [i]); |
---|
54 | } |
---|
55 | // else |
---|
56 | // { |
---|
57 | // } |
---|
58 | |
---|
59 | for (uint32_t i=0; i<_param->_nb_context; ++i) |
---|
60 | PORT_WRITE(out_CONTEXT_EVENT [i], context_event [i]); |
---|
61 | |
---|
62 | log_end(Context_State,FUNCTION); |
---|
63 | }; |
---|
64 | |
---|
65 | }; // end namespace context_state |
---|
66 | }; // end namespace front_end |
---|
67 | }; // end namespace multi_front_end |
---|
68 | }; // end namespace core |
---|
69 | |
---|
70 | }; // end namespace behavioural |
---|
71 | }; // end namespace morpheo |
---|
72 | #endif |
---|