1 | #ifdef SYSTEMC |
---|
2 | /* |
---|
3 | * $Id: Meta_Predictor_Glue_genMealy_predict_valack.cpp 123 2009-06-08 20:43:30Z rosiere $ |
---|
4 | * |
---|
5 | * [ Description ] |
---|
6 | * |
---|
7 | */ |
---|
8 | |
---|
9 | #include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Meta_Predictor_Glue/include/Meta_Predictor_Glue.h" |
---|
10 | |
---|
11 | namespace morpheo { |
---|
12 | namespace behavioural { |
---|
13 | namespace core { |
---|
14 | namespace multi_front_end { |
---|
15 | namespace front_end { |
---|
16 | namespace prediction_unit { |
---|
17 | namespace direction { |
---|
18 | namespace meta_predictor { |
---|
19 | namespace meta_predictor_glue { |
---|
20 | |
---|
21 | |
---|
22 | #undef FUNCTION |
---|
23 | #define FUNCTION "Meta_Predictor_Glue::genMealy_predict_valack" |
---|
24 | void Meta_Predictor_Glue::genMealy_predict_valack (void) |
---|
25 | { |
---|
26 | log_begin(Meta_Predictor_Glue,FUNCTION); |
---|
27 | log_function(Meta_Predictor_Glue,FUNCTION,_name.c_str()); |
---|
28 | |
---|
29 | if (PORT_READ(in_NRESET)) |
---|
30 | { |
---|
31 | for (uint32_t i=0; i<_param->_nb_inst_predict; ++i) |
---|
32 | { |
---|
33 | Tcontrol_t val = PORT_READ(in_PREDICT_VAL [i]); |
---|
34 | Tcontrol_t ack = true; |
---|
35 | |
---|
36 | for (uint32_t j=0; j<_param->_nb_predictor; ++j) |
---|
37 | { |
---|
38 | PORT_WRITE(out_PREDICT_PREDICTOR_VAL [j][i],val); |
---|
39 | |
---|
40 | ack &= PORT_READ(in_PREDICT_PREDICTOR_ACK [j][i]); |
---|
41 | } |
---|
42 | |
---|
43 | PORT_WRITE(out_PREDICT_ACK [i],ack); |
---|
44 | } |
---|
45 | } |
---|
46 | else |
---|
47 | { |
---|
48 | // Reset |
---|
49 | for (uint32_t i=0; i<_param->_nb_inst_predict; ++i) |
---|
50 | { |
---|
51 | for (uint32_t j=0; j<_param->_nb_predictor; ++j) |
---|
52 | PORT_WRITE(out_PREDICT_PREDICTOR_VAL [j][i],0); |
---|
53 | PORT_WRITE(out_PREDICT_ACK [i],0); |
---|
54 | } |
---|
55 | } |
---|
56 | |
---|
57 | log_end(Meta_Predictor_Glue,FUNCTION); |
---|
58 | }; |
---|
59 | |
---|
60 | }; // end namespace meta_predictor_glue |
---|
61 | }; // end namespace meta_predictor |
---|
62 | }; // end namespace direction |
---|
63 | }; // end namespace prediction_unit |
---|
64 | }; // end namespace front_end |
---|
65 | }; // end namespace multi_front_end |
---|
66 | }; // end namespace core |
---|
67 | |
---|
68 | }; // end namespace behavioural |
---|
69 | }; // end namespace morpheo |
---|
70 | #endif |
---|