1 | /* |
---|
2 | * $Id: Parameters.cpp 88 2008-12-10 18:31:39Z rosiere $ |
---|
3 | * |
---|
4 | * [ Description ] |
---|
5 | * |
---|
6 | */ |
---|
7 | |
---|
8 | #include "Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/include/Parameters.h" |
---|
9 | |
---|
10 | namespace morpheo { |
---|
11 | namespace behavioural { |
---|
12 | namespace core { |
---|
13 | namespace multi_front_end { |
---|
14 | namespace front_end { |
---|
15 | namespace ifetch_unit { |
---|
16 | |
---|
17 | |
---|
18 | #undef FUNCTION |
---|
19 | #define FUNCTION "Ifetch_unit::Parameters" |
---|
20 | Parameters::Parameters (uint32_t size_queue , |
---|
21 | uint32_t nb_instruction , |
---|
22 | uint32_t size_branch_update_prediction, |
---|
23 | uint32_t size_address , |
---|
24 | bool is_toplevel |
---|
25 | ) |
---|
26 | { |
---|
27 | log_printf(FUNC,Ifetch_unit,FUNCTION,"Begin"); |
---|
28 | |
---|
29 | _size_queue = size_queue ; |
---|
30 | _nb_instruction = nb_instruction ; |
---|
31 | // _size_branch_update_prediction = size_branch_update_prediction; |
---|
32 | // _size_address = size_address ; |
---|
33 | |
---|
34 | test(); |
---|
35 | |
---|
36 | _param_address_management = new morpheo::behavioural::core::multi_front_end::front_end::ifetch_unit::address_management::Parameters |
---|
37 | (nb_instruction , |
---|
38 | size_address , |
---|
39 | size_branch_update_prediction); |
---|
40 | _param_ifetch_queue = new morpheo::behavioural::core::multi_front_end::front_end::ifetch_unit::ifetch_queue:: Parameters |
---|
41 | (size_queue , |
---|
42 | nb_instruction , |
---|
43 | size_branch_update_prediction, |
---|
44 | size_address ); |
---|
45 | _param_ifetch_unit_glue = new morpheo::behavioural::core::multi_front_end::front_end::ifetch_unit::ifetch_unit_glue:: Parameters |
---|
46 | (size_address); |
---|
47 | |
---|
48 | if (is_toplevel) |
---|
49 | { |
---|
50 | _size_instruction_address = size_address; |
---|
51 | _size_ifetch_queue_ptr = log2(size_queue); |
---|
52 | _size_inst_ifetch_ptr = log2(nb_instruction); |
---|
53 | _size_depth = size_branch_update_prediction; |
---|
54 | |
---|
55 | _have_port_ifetch_queue_ptr = _size_ifetch_queue_ptr > 0; |
---|
56 | _have_port_inst_ifetch_ptr = _size_inst_ifetch_ptr > 0; |
---|
57 | _have_port_depth = _size_depth > 0; |
---|
58 | |
---|
59 | copy (); |
---|
60 | } |
---|
61 | |
---|
62 | log_printf(FUNC,Ifetch_unit,FUNCTION,"End"); |
---|
63 | }; |
---|
64 | |
---|
65 | // #undef FUNCTION |
---|
66 | // #define FUNCTION "Ifetch_unit::Parameters (copy)" |
---|
67 | // Parameters::Parameters (Parameters & param) |
---|
68 | // { |
---|
69 | // log_printf(FUNC,Ifetch_unit,FUNCTION,"Begin"); |
---|
70 | // test(); |
---|
71 | // log_printf(FUNC,Ifetch_unit,FUNCTION,"End"); |
---|
72 | // }; |
---|
73 | |
---|
74 | #undef FUNCTION |
---|
75 | #define FUNCTION "Ifetch_unit::~Parameters" |
---|
76 | Parameters::~Parameters () |
---|
77 | { |
---|
78 | log_printf(FUNC,Ifetch_unit,FUNCTION,"Begin"); |
---|
79 | delete _param_address_management; |
---|
80 | delete _param_ifetch_queue ; |
---|
81 | delete _param_ifetch_unit_glue ; |
---|
82 | log_printf(FUNC,Ifetch_unit,FUNCTION,"End"); |
---|
83 | }; |
---|
84 | |
---|
85 | #undef FUNCTION |
---|
86 | #define FUNCTION "Ifetch_unit::copy" |
---|
87 | void Parameters::copy (void) |
---|
88 | { |
---|
89 | log_printf(FUNC,Ifetch_unit,FUNCTION,"Begin"); |
---|
90 | |
---|
91 | COPY(_param_address_management); |
---|
92 | COPY(_param_ifetch_queue ); |
---|
93 | COPY(_param_ifetch_unit_glue ); |
---|
94 | |
---|
95 | log_printf(FUNC,Ifetch_unit,FUNCTION,"End"); |
---|
96 | }; |
---|
97 | |
---|
98 | }; // end namespace ifetch_unit |
---|
99 | }; // end namespace front_end |
---|
100 | }; // end namespace multi_front_end |
---|
101 | }; // end namespace core |
---|
102 | |
---|
103 | }; // end namespace behavioural |
---|
104 | }; // end namespace morpheo |
---|