1 | /* |
---|
2 | * $Id: Decod_queue.cpp 82 2008-05-01 16:48:45Z rosiere $ |
---|
3 | * |
---|
4 | * [ Description ] |
---|
5 | * |
---|
6 | */ |
---|
7 | |
---|
8 | #include "Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/include/Decod_queue.h" |
---|
9 | |
---|
10 | namespace morpheo { |
---|
11 | namespace behavioural { |
---|
12 | namespace core { |
---|
13 | namespace multi_front_end { |
---|
14 | namespace front_end { |
---|
15 | namespace decod_unit { |
---|
16 | namespace decod_queue { |
---|
17 | |
---|
18 | |
---|
19 | #undef FUNCTION |
---|
20 | #define FUNCTION "Decod_queue::Decod_queue" |
---|
21 | Decod_queue::Decod_queue |
---|
22 | ( |
---|
23 | #ifdef SYSTEMC |
---|
24 | sc_module_name name, |
---|
25 | #else |
---|
26 | string name, |
---|
27 | #endif |
---|
28 | #ifdef STATISTICS |
---|
29 | morpheo::behavioural::Parameters_Statistics * param_statistics, |
---|
30 | #endif |
---|
31 | morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::Parameters * param, |
---|
32 | morpheo::behavioural::Tusage_t usage |
---|
33 | ): |
---|
34 | _name (name) |
---|
35 | ,_param (param) |
---|
36 | ,_usage (usage) |
---|
37 | { |
---|
38 | log_begin(Decod_queue,FUNCTION); |
---|
39 | |
---|
40 | usage_environment(_usage); |
---|
41 | |
---|
42 | log_printf(INFO,Decod_queue,FUNCTION,_("Allocation")); |
---|
43 | |
---|
44 | allocation ( |
---|
45 | #ifdef STATISTICS |
---|
46 | param_statistics |
---|
47 | #endif |
---|
48 | ); |
---|
49 | |
---|
50 | #ifdef STATISTICS |
---|
51 | if (usage_is_set(_usage,USE_STATISTICS)) |
---|
52 | { |
---|
53 | log_printf(INFO,Decod_queue,FUNCTION,_("Allocation of statistics")); |
---|
54 | |
---|
55 | statistics_allocation(param_statistics); |
---|
56 | } |
---|
57 | #endif |
---|
58 | |
---|
59 | #ifdef VHDL |
---|
60 | if (usage_is_set(_usage,USE_VHDL)) |
---|
61 | { |
---|
62 | // generate the vhdl |
---|
63 | log_printf(INFO,Decod_queue,FUNCTION,_("Generate the vhdl")); |
---|
64 | |
---|
65 | vhdl(); |
---|
66 | } |
---|
67 | #endif |
---|
68 | |
---|
69 | #ifdef SYSTEMC |
---|
70 | if (usage_is_set(_usage,USE_SYSTEMC)) |
---|
71 | { |
---|
72 | log_printf(INFO,Decod_queue,FUNCTION,_("Method - transition")); |
---|
73 | |
---|
74 | SC_METHOD (transition); |
---|
75 | dont_initialize (); |
---|
76 | sensitive << (*(in_CLOCK)).pos(); |
---|
77 | |
---|
78 | # ifdef SYSTEMCASS_SPECIFIC |
---|
79 | // List dependency information |
---|
80 | # endif |
---|
81 | |
---|
82 | log_printf(INFO,Decod_queue,FUNCTION,_("Method - genMoore")); |
---|
83 | |
---|
84 | SC_METHOD (genMoore); |
---|
85 | dont_initialize (); |
---|
86 | sensitive << (*(in_CLOCK)).neg(); // use internal register |
---|
87 | |
---|
88 | # ifdef SYSTEMCASS_SPECIFIC |
---|
89 | // List dependency information |
---|
90 | # endif |
---|
91 | |
---|
92 | log_printf(INFO,Decod_queue,FUNCTION,_("Method - genMealy_decod_out")); |
---|
93 | |
---|
94 | SC_METHOD (genMealy_decod_out); |
---|
95 | dont_initialize (); |
---|
96 | sensitive << (*(in_CLOCK)).neg(); // use internal register |
---|
97 | |
---|
98 | for (uint32_t i=0; i<_param->_nb_inst_decod; i++) |
---|
99 | sensitive << (*(in_DECOD_OUT_ACK [i])); |
---|
100 | if (_param->_have_port_depth) |
---|
101 | for (uint32_t i=0; i<_param->_nb_context; i++) |
---|
102 | sensitive << (*(in_DEPTH_TAIL [i])) |
---|
103 | << (*(in_DEPTH_NB_BRANCH [i])); |
---|
104 | |
---|
105 | # ifdef SYSTEMCASS_SPECIFIC |
---|
106 | // List dependency information |
---|
107 | for (uint32_t i=0; i<_param->_nb_inst_decod; i++) |
---|
108 | { |
---|
109 | (*(out_DECOD_OUT_VAL [i])) (*(in_DECOD_OUT_ACK [i])); |
---|
110 | if (_param->_have_port_depth) |
---|
111 | for (uint32_t i=0; i<_param->_nb_context; i++) |
---|
112 | { |
---|
113 | (*(out_DECOD_OUT_VAL [i])) (*(in_DEPTH_TAIL [i])); |
---|
114 | (*(out_DECOD_OUT_VAL [i])) (*(in_DEPTH_NB_BRANCH [i])); |
---|
115 | } |
---|
116 | } |
---|
117 | # endif |
---|
118 | |
---|
119 | #endif |
---|
120 | } |
---|
121 | log_end(Decod_queue,FUNCTION); |
---|
122 | }; |
---|
123 | |
---|
124 | #undef FUNCTION |
---|
125 | #define FUNCTION "Decod_queue::~Decod_queue" |
---|
126 | Decod_queue::~Decod_queue (void) |
---|
127 | { |
---|
128 | log_begin(Decod_queue,FUNCTION); |
---|
129 | |
---|
130 | #ifdef STATISTICS |
---|
131 | if (usage_is_set(_usage,USE_STATISTICS)) |
---|
132 | { |
---|
133 | statistics_deallocation(); |
---|
134 | } |
---|
135 | #endif |
---|
136 | |
---|
137 | log_printf(INFO,Decod_queue,FUNCTION,_("Deallocation")); |
---|
138 | deallocation (); |
---|
139 | |
---|
140 | log_end(Decod_queue,FUNCTION); |
---|
141 | }; |
---|
142 | |
---|
143 | }; // end namespace decod_queue |
---|
144 | }; // end namespace decod_unit |
---|
145 | }; // end namespace front_end |
---|
146 | }; // end namespace multi_front_end |
---|
147 | }; // end namespace core |
---|
148 | |
---|
149 | }; // end namespace behavioural |
---|
150 | }; // end namespace morpheo |
---|