1 | /* |
---|
2 | * $Id: Parameters.cpp 138 2010-05-12 17:34:01Z rosiere $ |
---|
3 | * |
---|
4 | * [ Description ] |
---|
5 | * |
---|
6 | */ |
---|
7 | |
---|
8 | #include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/include/Parameters.h" |
---|
9 | |
---|
10 | namespace morpheo { |
---|
11 | namespace behavioural { |
---|
12 | namespace core { |
---|
13 | namespace multi_execute_loop { |
---|
14 | namespace execute_loop { |
---|
15 | namespace multi_execute_unit { |
---|
16 | namespace execute_unit { |
---|
17 | namespace load_store_unit { |
---|
18 | |
---|
19 | |
---|
20 | #undef FUNCTION |
---|
21 | #define FUNCTION "Load_store_unit::Parameters" |
---|
22 | Parameters::Parameters (uint32_t size_store_queue , |
---|
23 | uint32_t size_load_queue , |
---|
24 | uint32_t size_speculative_access_queue , |
---|
25 | uint32_t nb_store_queue_bank , |
---|
26 | uint32_t nb_load_queue_bank , |
---|
27 | uint32_t nb_port_check , |
---|
28 | Tspeculative_load_t speculative_load , |
---|
29 | Tpredictor_t speculative_commit_predictor_scheme, |
---|
30 | uint32_t * lsu_pht_size_counter ,//[1] |
---|
31 | uint32_t * lsu_pht_nb_counter ,//[1] |
---|
32 | uint32_t nb_bypass_memory , |
---|
33 | uint32_t nb_cache_port , |
---|
34 | uint32_t nb_inst_memory , |
---|
35 | uint32_t nb_context , |
---|
36 | uint32_t nb_front_end , |
---|
37 | uint32_t nb_ooo_engine , |
---|
38 | uint32_t nb_packet , |
---|
39 | uint32_t size_general_data , |
---|
40 | uint32_t size_special_data , |
---|
41 | uint32_t nb_general_register , |
---|
42 | uint32_t nb_special_register , |
---|
43 | uint32_t nb_thread , |
---|
44 | bool * num_thread_valid , //[nb_thread] |
---|
45 | bool is_toplevel) |
---|
46 | { |
---|
47 | log_printf(FUNC,Load_store_unit,FUNCTION,"Begin"); |
---|
48 | |
---|
49 | _size_store_queue = size_store_queue ; |
---|
50 | _size_load_queue = size_load_queue ; |
---|
51 | _size_speculative_access_queue = size_speculative_access_queue ; |
---|
52 | _nb_store_queue_bank = nb_store_queue_bank ; |
---|
53 | _nb_load_queue_bank = nb_load_queue_bank ; |
---|
54 | _nb_port_check = nb_port_check ; |
---|
55 | _speculative_load = speculative_load ; |
---|
56 | _speculative_commit_predictor_scheme = speculative_commit_predictor_scheme; |
---|
57 | _lsu_pht_size_counter = lsu_pht_size_counter ; |
---|
58 | _lsu_pht_nb_counter = lsu_pht_nb_counter ; |
---|
59 | _nb_bypass_memory = nb_bypass_memory ; |
---|
60 | _nb_cache_port = nb_cache_port ; |
---|
61 | _nb_inst_memory = nb_inst_memory ; |
---|
62 | _nb_context = nb_context ; |
---|
63 | _nb_front_end = nb_front_end ; |
---|
64 | _nb_ooo_engine = nb_ooo_engine ; |
---|
65 | _nb_packet = nb_packet ; |
---|
66 | _nb_general_register = nb_general_register ; |
---|
67 | _nb_special_register = nb_special_register ; |
---|
68 | _nb_thread = nb_thread ; |
---|
69 | _num_thread_valid = num_thread_valid ; |
---|
70 | |
---|
71 | _size_speculative_access_queue_ptr = log2(size_speculative_access_queue); |
---|
72 | |
---|
73 | _size_dcache_context_id = log2(nb_context) + log2(nb_front_end) + log2(nb_ooo_engine); |
---|
74 | _size_dcache_packet_id = log2((size_store_queue>size_load_queue)?size_store_queue:size_load_queue)+1; |
---|
75 | _have_port_dcache_context_id = _size_dcache_context_id>0; |
---|
76 | |
---|
77 | _mask_address_lsb = gen_mask<Tdcache_address_t>(log2(size_general_data/8)); |
---|
78 | _mask_address_msb = gen_mask<Tdcache_address_t>(size_general_data) << log2(size_general_data/8); |
---|
79 | _mask_check_hit_byte = 0; |
---|
80 | |
---|
81 | for (uint32_t i=0; i<(size_general_data>>3) /*8*/; ++i) |
---|
82 | _mask_check_hit_byte |= (1<<i); |
---|
83 | |
---|
84 | test(); |
---|
85 | |
---|
86 | if (is_toplevel) |
---|
87 | { |
---|
88 | _size_instruction_address = size_general_data-2; |
---|
89 | _size_context_id = log2(nb_context ); |
---|
90 | _size_front_end_id = log2(nb_front_end ); |
---|
91 | _size_ooo_engine_id = log2(nb_ooo_engine ); |
---|
92 | _size_rob_ptr = log2(nb_packet ); |
---|
93 | _size_general_register = log2(nb_general_register); |
---|
94 | _size_special_register = log2(nb_special_register); |
---|
95 | _size_store_queue_ptr = log2(size_store_queue ); |
---|
96 | _size_load_queue_ptr = log2(size_load_queue ); |
---|
97 | _size_general_data = size_general_data ; |
---|
98 | _size_special_data = size_special_data ; |
---|
99 | |
---|
100 | _have_port_context_id = _size_context_id >0; |
---|
101 | _have_port_front_end_id = _size_front_end_id >0; |
---|
102 | _have_port_ooo_engine_id = _size_ooo_engine_id >0; |
---|
103 | _have_port_rob_ptr = _size_rob_ptr >0; |
---|
104 | _have_port_load_queue_ptr = _size_load_queue_ptr>0; |
---|
105 | |
---|
106 | copy(); |
---|
107 | } |
---|
108 | |
---|
109 | log_printf(FUNC,Load_store_unit,FUNCTION,"End"); |
---|
110 | }; |
---|
111 | |
---|
112 | #undef FUNCTION |
---|
113 | #define FUNCTION "Load_store_unit::~Parameters" |
---|
114 | Parameters::~Parameters (void) |
---|
115 | { |
---|
116 | log_printf(FUNC,Load_store_unit,FUNCTION,"Begin"); |
---|
117 | |
---|
118 | log_printf(FUNC,Load_store_unit,FUNCTION,"End"); |
---|
119 | }; |
---|
120 | |
---|
121 | #undef FUNCTION |
---|
122 | #define FUNCTION "Load_store_unit::copy" |
---|
123 | void Parameters::copy (void) |
---|
124 | { |
---|
125 | log_printf(FUNC,Load_store_unit,FUNCTION,"Begin"); |
---|
126 | log_printf(FUNC,Load_store_unit,FUNCTION,"End"); |
---|
127 | }; |
---|
128 | |
---|
129 | }; // end namespace load_store_unit |
---|
130 | }; // end namespace execute_unit |
---|
131 | }; // end namespace multi_execute_unit |
---|
132 | }; // end namespace execute_loop |
---|
133 | }; // end namespace multi_execute_loop |
---|
134 | }; // end namespace core |
---|
135 | |
---|
136 | }; // end namespace behavioural |
---|
137 | }; // end namespace morpheo |
---|