1 | #ifdef VHDL |
---|
2 | /* |
---|
3 | * $Id: Execute_queue_vhdl_body.cpp 113 2009-04-14 18:39:12Z rosiere $ |
---|
4 | * |
---|
5 | * [ Description ] |
---|
6 | * |
---|
7 | */ |
---|
8 | |
---|
9 | #include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Execute_queue/include/Execute_queue.h" |
---|
10 | |
---|
11 | namespace morpheo { |
---|
12 | namespace behavioural { |
---|
13 | namespace core { |
---|
14 | namespace multi_execute_loop { |
---|
15 | namespace execute_loop { |
---|
16 | namespace multi_write_unit { |
---|
17 | namespace write_unit { |
---|
18 | namespace execute_queue { |
---|
19 | |
---|
20 | |
---|
21 | #undef FUNCTION |
---|
22 | #define FUNCTION "Execute_queue::vhdl_body" |
---|
23 | void Execute_queue::vhdl_body (Vhdl * & vhdl) |
---|
24 | { |
---|
25 | log_printf(FUNC,Execute_queue,FUNCTION,"Begin"); |
---|
26 | |
---|
27 | vhdl->set_comment(0,""); |
---|
28 | vhdl->set_comment(0,"-----------------------------------"); |
---|
29 | vhdl->set_comment(0,"-- Instance queue "); |
---|
30 | vhdl->set_comment(0,"-----------------------------------"); |
---|
31 | vhdl->set_comment(0,""); |
---|
32 | |
---|
33 | vhdl->set_body (0,"instance_"+_name+"_queue : "+_name+"_queue"); |
---|
34 | vhdl->set_body (0,"port map ("); |
---|
35 | vhdl->set_body (1," in_CLOCK \t=>\t in_CLOCK "); |
---|
36 | vhdl->set_body (1,", in_NRESET \t=>\t in_NRESET"); |
---|
37 | vhdl->set_body (1,", in_INSERT_VAL \t=>\tinternal_QUEUE_INSERT_VAL"); |
---|
38 | vhdl->set_body (1,",out_INSERT_ACK \t=>\tinternal_QUEUE_INSERT_ACK"); |
---|
39 | vhdl->set_body (1,", in_INSERT_DATA \t=>\tinternal_QUEUE_INSERT_DATA"); |
---|
40 | vhdl->set_body (1,",out_RETIRE_VAL \t=>\tinternal_QUEUE_RETIRE_VAL"); |
---|
41 | vhdl->set_body (1,", in_RETIRE_ACK \t=>\tinternal_QUEUE_RETIRE_ACK"); |
---|
42 | vhdl->set_body (1,",out_RETIRE_DATA \t=>\tinternal_QUEUE_RETIRE_DATA"); |
---|
43 | vhdl->set_body (0,");"); |
---|
44 | |
---|
45 | vhdl->set_comment(0,""); |
---|
46 | vhdl->set_comment(0,"-----------------------------------"); |
---|
47 | vhdl->set_comment(0,"-- Input Buffer "); |
---|
48 | vhdl->set_comment(0,"-----------------------------------"); |
---|
49 | vhdl->set_comment(0,""); |
---|
50 | |
---|
51 | { |
---|
52 | uint32_t min = 0; |
---|
53 | uint32_t max, size; |
---|
54 | |
---|
55 | if(_param->_have_port_context_id ) |
---|
56 | { |
---|
57 | size = _param->_size_context_id; |
---|
58 | max = min-1+size; |
---|
59 | vhdl->set_body (0,"internal_QUEUE_INSERT_DATA "+std_logic_range(_param->_size_internal_queue,max,min)+" <= in_EXECUTE_QUEUE_IN_CONTEXT_ID "+std_logic_range(size)+";"); |
---|
60 | min = max+1; |
---|
61 | } |
---|
62 | if(_param->_have_port_front_end_id ) |
---|
63 | { |
---|
64 | size = _param->_size_front_end_id; |
---|
65 | max = min-1+size; |
---|
66 | vhdl->set_body (0,"internal_QUEUE_INSERT_DATA "+std_logic_range(_param->_size_internal_queue,max,min)+" <= in_EXECUTE_QUEUE_IN_FRONT_END_ID"+std_logic_range(size)+";"); |
---|
67 | min = max+1; |
---|
68 | } |
---|
69 | if(_param->_have_port_ooo_engine_id ) |
---|
70 | { |
---|
71 | size = _param->_size_ooo_engine_id; |
---|
72 | max = min-1+size; |
---|
73 | vhdl->set_body (0,"internal_QUEUE_INSERT_DATA "+std_logic_range(_param->_size_internal_queue,max,min)+" <= in_EXECUTE_QUEUE_IN_OOO_ENGINE_ID"+std_logic_range(size)+";"); |
---|
74 | min = max+1; |
---|
75 | } |
---|
76 | if(_param->_have_port_rob_ptr) |
---|
77 | { |
---|
78 | size = _param->_size_rob_ptr; |
---|
79 | max = min-1+size; |
---|
80 | vhdl->set_body (0,"internal_QUEUE_INSERT_DATA "+std_logic_range(_param->_size_internal_queue,max,min)+" <= in_EXECUTE_QUEUE_IN_PACKET_ID"+std_logic_range(size)+";"); |
---|
81 | min = max+1; |
---|
82 | } |
---|
83 | |
---|
84 | // size = _param->_size_operation; |
---|
85 | // max = min-1+size; |
---|
86 | // vhdl->set_body (0,"internal_QUEUE_INSERT_DATA "+std_logic_range(_param->_size_internal_queue,max,min)+" <= in_EXECUTE_QUEUE_IN_OPERATION"+std_logic_range(size)+";"); |
---|
87 | // min = max+1; |
---|
88 | // |
---|
89 | // size = _param->_size_type; |
---|
90 | // max = min-1+size; |
---|
91 | // vhdl->set_body (0,"internal_QUEUE_INSERT_DATA "+std_logic_range(_param->_size_internal_queue,max,min)+" <= in_EXECUTE_QUEUE_IN_TYPE"+std_logic_range(size)+";"); |
---|
92 | // min = max+1; |
---|
93 | |
---|
94 | size = _param->_size_special_data; |
---|
95 | max = min-1+size; |
---|
96 | vhdl->set_body (0,"internal_QUEUE_INSERT_DATA "+std_logic_range(_param->_size_internal_queue,max,min)+" <= in_EXECUTE_QUEUE_IN_FLAGS"+std_logic_range(size)+";"); |
---|
97 | min = max+1; |
---|
98 | |
---|
99 | size = _param->_size_exception; |
---|
100 | max = min-1+size; |
---|
101 | vhdl->set_body (0,"internal_QUEUE_INSERT_DATA "+std_logic_range(_param->_size_internal_queue,max,min)+" <= in_EXECUTE_QUEUE_IN_EXCEPTION"+std_logic_range(size)+";"); |
---|
102 | min = max+1; |
---|
103 | |
---|
104 | size = 1; |
---|
105 | max = min-1+size; |
---|
106 | vhdl->set_body (0,"internal_QUEUE_INSERT_DATA "+std_logic_range(_param->_size_internal_queue,max,min)+" <= in_EXECUTE_QUEUE_IN_NO_SEQUENCE"+std_logic_range(size)+";"); |
---|
107 | min = max+1; |
---|
108 | |
---|
109 | size = _param->_size_instruction_address; |
---|
110 | max = min-1+size; |
---|
111 | vhdl->set_body (0,"internal_QUEUE_INSERT_DATA "+std_logic_range(_param->_size_internal_queue,max,min)+" <= in_EXECUTE_QUEUE_IN_ADDRESS"+std_logic_range(size)+";"); |
---|
112 | min = max+1; |
---|
113 | |
---|
114 | size = _param->_size_general_data; |
---|
115 | max = min-1+size; |
---|
116 | vhdl->set_body (0,"internal_QUEUE_INSERT_DATA "+std_logic_range(_param->_size_internal_queue,max,min)+" <= in_EXECUTE_QUEUE_IN_DATA"+std_logic_range(size)+";"); |
---|
117 | min = max+1; |
---|
118 | } |
---|
119 | |
---|
120 | vhdl->set_comment(0,""); |
---|
121 | vhdl->set_comment(0,"-----------------------------------"); |
---|
122 | vhdl->set_comment(0,"-- Output Buffer "); |
---|
123 | vhdl->set_comment(0,"-----------------------------------"); |
---|
124 | vhdl->set_comment(0,""); |
---|
125 | |
---|
126 | if(_param->_have_port_context_id) |
---|
127 | vhdl->set_body (0,"out_EXECUTE_QUEUE_OUT_CONTEXT_ID "+std_logic_range(_param->_size_context_id )+" <= internal_EXECUTE_QUEUE_OUT_CONTEXT_ID ;"); |
---|
128 | if(_param->_have_port_front_end_id) |
---|
129 | vhdl->set_body (0,"out_EXECUTE_QUEUE_OUT_FRONT_END_ID "+std_logic_range(_param->_size_front_end_id )+" <= internal_EXECUTE_QUEUE_OUT_FRONT_END_ID ;"); |
---|
130 | if(_param->_have_port_ooo_engine_id) |
---|
131 | vhdl->set_body (0,"out_EXECUTE_QUEUE_OUT_OOO_ENGINE_ID "+std_logic_range(_param->_size_ooo_engine_id )+" <= internal_EXECUTE_QUEUE_OUT_OOO_ENGINE_ID;"); |
---|
132 | if(_param->_have_port_rob_ptr) |
---|
133 | vhdl->set_body (0,"out_EXECUTE_QUEUE_OUT_PACKET_ID "+std_logic_range(_param->_size_rob_ptr )+" <= internal_EXECUTE_QUEUE_OUT_PACKET_ID ;"); |
---|
134 | // vhdl->set_body (0,"out_EXECUTE_QUEUE_OUT_OPERATION "+std_logic_range(_param->_size_operation )+" <= internal_EXECUTE_QUEUE_OUT_OPERATION ;"); |
---|
135 | // vhdl->set_body (0,"out_EXECUTE_QUEUE_OUT_TYPE "+std_logic_range(_param->_size_type )+" <= internal_EXECUTE_QUEUE_OUT_TYPE ;"); |
---|
136 | vhdl->set_body (0,"out_EXECUTE_QUEUE_OUT_FLAGS "+std_logic_range(_param->_size_special_data )+" <= internal_EXECUTE_QUEUE_OUT_FLAGS ;"); |
---|
137 | vhdl->set_body (0,"out_EXECUTE_QUEUE_OUT_EXCEPTION "+std_logic_range(_param->_size_exception )+" <= internal_EXECUTE_QUEUE_OUT_EXCEPTION ;"); |
---|
138 | vhdl->set_body (0,"out_EXECUTE_QUEUE_OUT_NO_SEQUENCE "+std_logic_range(1 )+" <= internal_EXECUTE_QUEUE_OUT_NO_SEQUENCE ;"); |
---|
139 | vhdl->set_body (0,"out_EXECUTE_QUEUE_OUT_ADDRESS "+std_logic_range(_param->_size_instruction_address)+" <= internal_EXECUTE_QUEUE_OUT_ADDRESS ;"); |
---|
140 | vhdl->set_body (0,"out_EXECUTE_QUEUE_OUT_DATA "+std_logic_range(_param->_size_general_data )+" <= internal_EXECUTE_QUEUE_OUT_DATA ;"); |
---|
141 | |
---|
142 | vhdl->set_debug ("in_CLOCK = 'U'","GLOP1: Clock = 'U'"); |
---|
143 | vhdl->set_debug ("in_CLOCK = 'X'","GLOP2: Clock = 'X'"); |
---|
144 | vhdl->set_debug ("in_CLOCK = 'Z'","GLOP3: Clock = 'Z'"); |
---|
145 | vhdl->set_debug ("in_CLOCK = 'W'","GLOP4: Clock = 'W'"); |
---|
146 | vhdl->set_debug ("in_CLOCK = '1'","KANE : Clock = '1'"); |
---|
147 | vhdl->set_debug ("in_CLOCK = '0'","SETH : Clock = '0'"); |
---|
148 | |
---|
149 | log_printf(FUNC,Execute_queue,FUNCTION,"End"); |
---|
150 | }; |
---|
151 | |
---|
152 | }; // end namespace execute_queue |
---|
153 | }; // end namespace write_unit |
---|
154 | }; // end namespace multi_write_unit |
---|
155 | }; // end namespace execute_loop |
---|
156 | }; // end namespace multi_execute_loop |
---|
157 | }; // end namespace core |
---|
158 | |
---|
159 | }; // end namespace behavioural |
---|
160 | }; // end namespace morpheo |
---|
161 | #endif |
---|