Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
336 | f9daq | 1 | ---------------------------------------------------------------------------------- |
2 | -- Company: |
||
3 | -- Engineer: |
||
4 | -- |
||
5 | -- Create Date: 30.10.2018 09:14:15 |
||
6 | -- Design Name: |
||
7 | -- Module Name: hist_system_top - Behavioral |
||
8 | -- Project Name: |
||
9 | -- Target Devices: |
||
10 | -- Tool Versions: |
||
11 | -- Description: |
||
12 | -- |
||
13 | -- Dependencies: |
||
14 | -- |
||
15 | -- Revision: |
||
16 | -- Revision 0.01 - File Created |
||
17 | -- Additional Comments: |
||
18 | -- |
||
19 | ---------------------------------------------------------------------------------- |
||
20 | |||
21 | |||
22 | library IEEE; |
||
23 | use IEEE.STD_LOGIC_1164.ALL; |
||
24 | |||
25 | -- Uncomment the following library declaration if using |
||
26 | -- arithmetic functions with Signed or Unsigned values |
||
27 | use IEEE.NUMERIC_STD.ALL; |
||
28 | |||
29 | -- Uncomment the following library declaration if instantiating |
||
30 | -- any Xilinx leaf cells in this code. |
||
31 | --library UNISIM; |
||
32 | --use UNISIM.VComponents.all; |
||
33 | |||
34 | entity hist_system_top is |
||
35 | |||
36 | generic ( |
||
37 | adc_bit_num : natural := 14; --input data from ad converter is 14 bit |
||
38 | bit_num : natural := 10; -- number of bits for our data (scaled from 14 bit to 10 bit) |
||
39 | bin_num : natural := 1024; -- number of bins in histogram. IMPORTANT: this number has to be equal to 2**bit_num. |
||
40 | buffer_size: natural := 24; --size of each BRAM_buffer in bits ; 24 bit = MAX, je izhodni signal HISTOGRAM, ki gre v procesor 24-bitni |
||
41 | num_of_units: natural := 1; -- number of BRAM_buffer and PE_unit units. IMPORTANT: MAX NUMBER OF UNITS IS 33, otherwise overflow (i think, check this out) !!!! |
||
42 | comm_bit_num: natural := 32; -- uporabljeno za komunikacijo s procesorjem |
||
43 | mode: string := "MODE_3"; -- modes of operation: MODE_1 = navaden algoritm, MODE_2 = odklop bufferja in 1 enota, MODE_3 = novo od 30.11.2018 naprej |
||
44 | byte: natural := 8 |
||
45 | ); |
||
46 | |||
47 | port ( |
||
48 | clk: in std_logic; --iz ADC |
||
49 | data_in: in unsigned ( (adc_bit_num - 1) downto 0 ); --iz ADC |
||
50 | INT_res: out std_logic; --signal za reset integratorja, pride iz ADC_unit, to peles na vezje |
||
51 | |||
52 | PM_trigger_in: in unsigned ( (adc_bit_num - 1) downto 0); |
||
53 | --vhodni/izhodni signali za komunikacijo s procesorjem |
||
54 | rstn: in std_logic; --reset signal. Ko je '0' resetira prejete podatke |
||
55 | HW_addr: in std_logic_vector ( (comm_bit_num - 1) downto 0 ); |
||
56 | data_from_UC: in std_logic_vector ( (comm_bit_num - 1) downto 0 ); |
||
57 | wr_en: in std_logic; --procesor pove komponenti, da bo pisal vanjo |
||
58 | rd_en: in std_logic; -- procesor pove komponenti, da bo bral iz nje <-- Q: ali je lahko tole moj UC_wr_en??? |
||
59 | data_for_UC: out std_logic_vector ( (comm_bit_num - 1) downto 0 ); |
||
60 | error: out std_logic; |
||
61 | ack: out std_logic |
||
62 | ----------------------------------------------------------------------- |
||
63 | --START: in std_logic; --TODO: premakni v komunikacijsko enoto |
||
64 | --UC_wr_en: in std_logic; -- procesor pove hist_system_top, da lahko poslje nov podatek procesorjuTODO: za testiranje ta tukaj, drugace v komunikacijski enoti = ren |
||
65 | --data_out: out integer; --TODO: spravi ga v komunikacijsko enoto |
||
66 | --RESET: in std_logic; |
||
67 | --ADC_threshold: in unsigned ( (11 - 1) downto 0 ); |
||
68 | --ADC_capt_num_of_samples: in unsigned ( (byte - 1) downto 0 ) |
||
69 | |||
70 | ); |
||
71 | |||
72 | |||
73 | |||
74 | |||
75 | end hist_system_top; |
||
76 | |||
77 | architecture Behavioral of hist_system_top is |
||
78 | |||
79 | ----------------COMPONENTS--------------------------- |
||
80 | |||
81 | component ADC_unit |
||
82 | |||
83 | generic ( adc_bit_num : natural := 14; --input data from ad converter is 14 bit |
||
84 | bit_num : natural := 10; -- number of bits for our data (scaled from 14 bit to 10 bit) |
||
85 | num_of_units: natural := 2; -- number of BRAM_buffer and PE_unit units |
||
86 | buffer_size: natural := 5; --size of each BRAM_buffer in bits |
||
87 | mode: string := "MODE_3"; -- modes of operation: MODE_1 = navaden algoritm, MODE_2 = odklop bufferja in 1 enota, MODE_3 = novo od 30.11.2018 naprej |
||
88 | byte: natural := 8 |
||
89 | |||
90 | ); |
||
91 | |||
92 | port ( clk_in: in std_logic; |
||
93 | START: in std_logic; -- start the system |
||
94 | data_in : in unsigned ( (adc_bit_num - 1) downto 0 ); --data from ADC |
||
95 | ADC_unit_feedback: in std_logic; |
||
96 | AD_wr_en: out unsigned ( (num_of_units - 1) downto 0 );-- goes to BRAM_buffer, to AD_wr_en signal |
||
97 | AD_addr: out unsigned ( (buffer_size - 1) downto 0 ); -- goes to BRAM_buffer, address signal |
||
98 | data_out: out unsigned ( (bit_num - 1) downto 0 ); -- goes to data_in of BRAM_buffer |
||
99 | --MODE_3-- |
||
100 | threshold: in unsigned ( (11 - 1) downto 0 ); |
||
101 | capt_num_of_samples: in unsigned ( (byte - 1) downto 0); |
||
102 | INT_res: out std_logic; --reset signal za integrator |
||
103 | |||
104 | SW_trigger_value: in unsigned(4 downto 0); |
||
105 | PM_trigger_in: in unsigned ( (adc_bit_num - 1) downto 0) |
||
106 | ); |
||
107 | end component; |
||
108 | |||
109 | |||
110 | component BRAM_buffer is |
||
111 | |||
112 | generic ( |
||
113 | bit_num : natural := 10; --number of data bits |
||
114 | buffer_size : natural := 26); -- buffer size in bits, 5 bit gets 32 different values |
||
115 | |||
116 | port ( |
||
117 | clk: in std_logic; |
||
118 | AD_wr_en: in std_logic; --from AD unit, enable writing into bram |
||
119 | AD_addr: in unsigned ( (buffer_size - 1) downto 0); --from AD unit, address for writing |
||
120 | PE_addr: in unsigned ( (buffer_size - 1) downto 0 ); -- from PE_unit, address for reading |
||
121 | PE_wr_en: in std_logic; -- from PE_unit, enable writing into PE unit |
||
122 | data_in : in unsigned ( (bit_num - 1) downto 0 ); --data from ADC |
||
123 | data_out : out unsigned ( (bit_num - 1) downto 0 ); -- data for PE_unit |
||
124 | BUFF_data_ready: out std_logic --signal, ki PE_enoti pove, da so podatki pripravljeni (prvič)--preveri ali je to potrebno, ker bodo itak samo ničle letele iz PE enote predn se kaj vpiše, ničle lahko na računalniku preč vržem |
||
125 | ); |
||
126 | |||
127 | end component; |
||
128 | |||
129 | |||
130 | component PE_unit |
||
131 | generic ( |
||
132 | bit_num : natural := 10; |
||
133 | bin_num : natural := 1024; |
||
134 | buffer_size : natural := 5; |
||
135 | byte: natural := 8; |
||
136 | mode: string := "MODE_3" ); |
||
137 | port ( |
||
138 | clk: in std_logic; |
||
139 | UC_wr_en: in std_logic; --microprocessor tells PE_unit that it read current data and is ready for the next one -- ustavljanje, pošiljaj histogram takrat, ko je procesor ready, ne vsak clk cikel |
||
140 | PE_START: in std_logic; --flag that tells PE_unit that BRAM_buffer is full |
||
141 | data_in : in unsigned ( (bit_num - 1) downto 0 ); --data for PE unit from BRAM_buffer |
||
142 | BUFF_addr: out unsigned ( (buffer_size - 1) downto 0 ); -- address for BRAM_buffer, goes to PE_addr |
||
143 | PE_wr_rd_en: out std_logic; -- signal to tell BRAM_buffer to start sending when '1' and to tell PE_unit to start sending when '0' |
||
144 | data_out: out unsigned ( buffer_size downto 0 ); -- output data |
||
145 | UC_rd_en_final: out std_logic; --tells microprocessor that data is ready to be sent from PE_unit to microprocessor |
||
146 | ---MODE_3 additional ports--- |
||
147 | write_A_M3: in std_logic; --gre na write_A, ko smo v postopku branja, |
||
148 | PE_RESET: in std_logic; |
||
149 | ADC_unit_RESET: out std_logic; |
||
150 | UC_rd_en_current: out std_logic |
||
151 | ); |
||
152 | end component; |
||
153 | |||
154 | |||
155 | ------------------SIGNALS-------------------------- |
||
156 | |||
157 | --ADC_unit signals |
||
158 | signal PE_wr_rd_en_all_units: unsigned ( (num_of_units - 1) downto 0 ) := (others => '0'); -- combines all PE_wr_rd signals together |
||
159 | signal zeros: unsigned ( (num_of_units - 1) downto 0 ) := (others => '0'); |
||
160 | signal ones: unsigned ( (num_of_units - 1) downto 0 ) := (others => '1'); |
||
161 | signal PE_wr_rd_en_sig: std_logic;-- := '0'; |
||
162 | signal ADC_unit_feedback_sig: std_logic := '0'; |
||
163 | signal ADC_threshold_sig: unsigned ( 10 downto 0) := (others => '0'); |
||
164 | signal ADC_capt_num_of_samples_sig: unsigned ( (byte - 1) downto 0 ) := (others => '0'); |
||
165 | signal ADC_unit_RESET_sig: std_logic := '0'; |
||
166 | |||
167 | signal SW_trigger_value_sig : unsigned (4 downto 0) := (others => '0'); |
||
168 | |||
169 | |||
170 | signal AD_wr_en_sig: unsigned ( (num_of_units - 1) downto 0 ) := (others => '0') ; |
||
171 | signal AD_addr_sig: unsigned ( (buffer_size - 1) downto 0 ) := (others => '0'); |
||
172 | signal ADC_data_sig: unsigned ( (bit_num - 1) downto 0 ) := (others => '0'); |
||
173 | |||
174 | --BRAM_buffer_signals |
||
175 | type buff_data_connection is array ( 0 to (num_of_units -1) ) of unsigned ( (bit_num - 1) downto 0 ); |
||
176 | signal BUFF_data_out : buff_data_connection := (others => (others => '0')); |
||
177 | |||
178 | signal BUFF_en: unsigned ( (num_of_units - 1) downto 0 ); |
||
179 | signal BUFF_data_in: unsigned ( (bit_num - 1) downto 0 ); |
||
180 | |||
181 | signal BUFF_data_ready_sig: std_logic := '0'; |
||
182 | signal PE_BUFF_addr_sig_1 : unsigned ( (buffer_size - 1) downto 0):= (others => '0'); |
||
183 | signal PE_BUFF_addr_sig_2 : unsigned ( (buffer_size - 1) downto 0); |
||
184 | |||
185 | |||
186 | --PE_unit signals |
||
187 | type PE_data_connection is array ( 0 to (num_of_units - 1) ) of unsigned (buffer_size downto 0); |
||
188 | signal PE_data_out : PE_data_connection := (others => (others => '0')); |
||
189 | |||
190 | signal PE_en_1: std_logic; |
||
191 | signal PE_en_2: std_logic; |
||
192 | signal PE_en_3: std_logic; |
||
193 | signal PE_data_in_1: buff_data_connection; |
||
194 | signal PE_data_in_2: buff_data_connection; |
||
195 | |||
196 | signal UC_rd_en_all_units : unsigned ( (num_of_units - 1) downto 0 ) := (others => '0'); -- vsi morjo bit 1, da je UC_rd_en = 1 |
||
197 | signal UC_rd_en_final_sig: std_logic; --procesor gleda ta signal, ko je 1, prenese 1023 podatkov in to je histogram |
||
198 | signal UC_rd_en_current_sig: std_logic; |
||
199 | signal UC_wr_en_sig : std_logic := '0'; -- komponenta gleda ta signal (kontrolira ga procesor), ko je falling edge, pošlje nov podatek procesorju |
||
200 | |||
201 | |||
202 | --Other signals |
||
203 | shared variable PE_data_sum: unsigned (23 downto 0) := (others => '0'); --glej zapiske za razporeditev podatkov na izhodno vodilo (15.11.2018) |
||
204 | signal HISTOGRAM: unsigned (23 downto 0) := (others => '0'); --izhodni podatki |
||
205 | |||
206 | |||
207 | --UC communication signals |
||
208 | constant HIST_SYS_ADDR: std_logic_vector (19 downto 0) := X"00000"; --naslov mojega hardwarea je 0 |
||
209 | signal data_for_UC_sig : std_logic_vector ( (comm_bit_num - 1) downto 0 ) := (others => '0'); |
||
210 | signal START_sig: std_logic := '0'; |
||
211 | signal RESET_sig: std_logic := '0'; |
||
212 | |||
213 | |||
214 | |||
215 | |||
216 | signal data_in_mappped_sig: unsigned ( (bit_num - 1) downto 0); |
||
217 | |||
218 | |||
219 | begin |
||
220 | |||
221 | |||
222 | --------COMBINATIONAL PART---------------- |
||
223 | |||
224 | --M5-- |
||
225 | PE_wr_rd_en_sig <= '0' when PE_wr_rd_en_all_units = zeros else |
||
226 | '1' when PE_wr_rd_en_all_units = ones; |
||
227 | |||
228 | --M6-- |
||
229 | UC_rd_en_final_sig <= '0' when UC_rd_en_all_units = zeros else |
||
230 | '1' when UC_rd_en_all_units = ones; |
||
231 | |||
232 | |||
233 | --M7-- |
||
234 | PE_en_3 <= PE_en_2 when (MODE = "MODE_1" or MODE = "MODE_2") else |
||
235 | START_sig when MODE = "MODE_3"; |
||
236 | |||
237 | |||
238 | -- ------SIGNALI, KI SO DRUGACE PRIKLOPLJENI NA PROCESOR------------ |
||
239 | -- data_out <= to_integer(HISTOGRAM); |
||
240 | |||
241 | -- UC_wr_en_sig <= UC_wr_en; --TODO: spremenjeno 16.11. -- to ni vec tako, sedaj je signal povezan na komunikacijsko enoto |
||
242 | |||
243 | -- START_sig <= START; -- TODO: to za zdej, potem bo start povezan preko komunikacijske enote --POVEZANO |
||
244 | |||
245 | |||
246 | -- RESET_sig <= RESET; |
||
247 | -- ADC_threshold_sig <= ADC_threshold; |
||
248 | -- ADC_capt_num_of_samples_sig <= ADC_capt_num_of_samples; |
||
249 | ----------------------------------------------------------------------------- |
||
250 | |||
251 | |||
252 | --Multiplekserji / Demultiplekserji za eliminacijo bufferjev |
||
253 | --D1-- |
||
254 | PE_en_1 <= AD_wr_en_sig(0) when (MODE = "MODE_2" or MODE = "MODE_3") else --ko je samo 1 enota, je itak AD_wr_en samo std_logic, ima samo 0-ti element |
||
255 | '0'; |
||
256 | |||
257 | BUFF_en <= AD_wr_en_sig when MODE = "MODE_1" else |
||
258 | (others => '0'); |
||
259 | |||
260 | --D2-- |
||
261 | PE_data_in_1(0) <= ADC_data_sig when (MODE = "MODE_2" or MODE = "MODE_3") else |
||
262 | (others => '0'); |
||
263 | |||
264 | BUFF_data_in <= ADC_data_sig when MODE = "MODE_1" else |
||
265 | (others => '0'); |
||
266 | |||
267 | --M1-- |
||
268 | PE_en_2 <= PE_en_1 when (MODE = "MODE_2" or MODE = "MODE_3") else |
||
269 | BUFF_data_ready_sig; |
||
270 | |||
271 | --M2-- |
||
272 | PE_data_in_2 <= PE_data_in_1 when (MODE = "MODE_2" or MODE = "MODE_3") else |
||
273 | BUFF_data_out; |
||
274 | |||
275 | --M3-- |
||
276 | PE_BUFF_addr_sig_2 <= (others => '0') when (MODE = "MODE_2" or MODE = "MODE_3") else |
||
277 | PE_BUFF_addr_sig_1; |
||
278 | |||
279 | --M4-- |
||
280 | ADC_unit_feedback_sig <= UC_rd_en_final_sig when ( MODE = "MODE_2" or (MODE = "MODE_3" and ADC_unit_RESET_sig = '0') ) else |
||
281 | '1' when (MODE = "MODE_3" and ADC_unit_RESET_sig = '1') else |
||
282 | PE_wr_rd_en_sig;-- za MODE_1 |
||
283 | |||
284 | |||
285 | |||
286 | ------------------------CONNECT COMPONENTS--------------------- |
||
287 | |||
288 | ADC_unit_connect: ADC_unit generic map ( adc_bit_num => adc_bit_num, |
||
289 | bit_num => bit_num, |
||
290 | num_of_units => num_of_units, |
||
291 | buffer_size => buffer_size, |
||
292 | byte => byte, |
||
293 | mode => mode) |
||
294 | |||
295 | port map (clk_in => clk, |
||
296 | START => START_sig, |
||
297 | data_in => data_in, |
||
298 | ADC_unit_feedback => ADC_unit_feedback_sig, |
||
299 | AD_wr_en => AD_wr_en_sig, |
||
300 | AD_addr => AD_addr_sig, |
||
301 | data_out => ADC_data_sig, |
||
302 | threshold => ADC_threshold_sig, |
||
303 | capt_num_of_samples => ADC_capt_num_of_samples_sig, |
||
304 | INT_res => INT_res, |
||
305 | |||
306 | SW_trigger_value => SW_trigger_value_sig, |
||
307 | PM_trigger_in => PM_trigger_in |
||
308 | ); |
||
309 | |||
310 | |||
311 | |||
312 | BUFF_ON_OFF: if (num_of_units /= 1) generate -- if generate vklaplja in izklaplja BRAM_buffer glede na stevilo enot (num_of_units) |
||
313 | |||
314 | BRAM_buffer_connect: for i in 0 to (num_of_units - 2) generate |
||
315 | |||
316 | BUFF: BRAM_buffer generic map ( bit_num => bit_num, |
||
317 | buffer_size => buffer_size ) |
||
318 | |||
319 | port map ( clk => clk, |
||
320 | AD_wr_en => BUFF_en(i), |
||
321 | AD_addr => AD_addr_sig, |
||
322 | PE_addr => PE_BUFF_addr_sig_2, |
||
323 | PE_wr_en => PE_wr_rd_en_sig, |
||
324 | data_in => BUFF_data_in, |
||
325 | data_out => buff_data_out(i), |
||
326 | BUFF_data_ready => open ); |
||
327 | end generate; |
||
328 | |||
329 | BRAM_buffer_connect_BUFF_last: BRAM_buffer generic map ( bit_num => bit_num, |
||
330 | buffer_size => buffer_size ) |
||
331 | |||
332 | port map ( clk => clk, |
||
333 | AD_wr_en => BUFF_en(num_of_units - 1), |
||
334 | AD_addr => AD_addr_sig, |
||
335 | PE_addr => PE_BUFF_addr_sig_2, |
||
336 | PE_wr_en => PE_wr_rd_en_sig, |
||
337 | data_in => BUFF_data_in, |
||
338 | data_out => buff_data_out(num_of_units - 1), |
||
339 | BUFF_data_ready => BUFF_data_ready_sig ); --zadnji sprozi branje v PE_enoto |
||
340 | |||
341 | end generate; |
||
342 | |||
343 | |||
344 | PE_unit_connect: for i in 0 to (num_of_units - 1) generate |
||
345 | |||
346 | PE: PE_unit generic map ( bit_num => bit_num, |
||
347 | bin_num => bin_num, |
||
348 | buffer_size => buffer_size, |
||
349 | byte => byte, |
||
350 | mode => mode ) |
||
351 | |||
352 | port map ( clk => clk, |
||
353 | PE_START => PE_en_3, |
||
354 | data_in => PE_data_in_2(i), |
||
355 | BUFF_addr => PE_BUFF_addr_sig_1, |
||
356 | PE_wr_rd_en => PE_wr_rd_en_all_units(i), |
||
357 | data_out => PE_data_out(i), |
||
358 | UC_rd_en_final => UC_rd_en_all_units(i), --komponenta pove procesorju, da je data ready za posiljanje v procesor |
||
359 | UC_rd_en_current => UC_rd_en_current_sig, |
||
360 | UC_wr_en => UC_wr_en_sig, -- procesor pove komponenti, da lahko poslje nov podatek |
||
361 | write_A_M3 => PE_en_1, |
||
362 | ADC_unit_RESET => ADC_unit_RESET_sig, |
||
363 | PE_RESET => RESET_sig |
||
364 | ); |
||
365 | |||
366 | end generate; |
||
367 | |||
368 | |||
369 | --------------SEQUENTIAL PART -------------------------------- |
||
370 | |||
371 | HIST_RECONSTRUCTION: process (clk) |
||
372 | --variable PE_data_sum: integer := 0; --TODO: stevilo bitov tega signala in izhodnega signala mora biti: |
||
373 | begin -- N = buffer_size + log(number_of_units) / log(2) |
||
374 | |||
375 | if ( rising_edge(clk) ) then |
||
376 | |||
377 | |||
378 | if (UC_rd_en_final_sig = '1') then |
||
379 | PE_data_sum := (others => '0'); --da se ponastavi na 0 pred vsakim seštevanjem |
||
380 | for i in 0 to (num_of_units - 1) loop |
||
381 | PE_data_sum := PE_data_sum + to_integer(PE_data_out(i)); --TODO: ali rabim tukaj to_integer ?? Bo pravilno tudi če ga ni (signala imata razlicno st. bitov)??? |
||
382 | end loop; |
||
383 | |||
384 | |||
385 | elsif (UC_rd_en_current_sig = '1') then |
||
386 | |||
387 | PE_data_sum := (others => '0'); --da se ponastavi na 0 pred vsakim seštevanjem |
||
388 | |||
389 | for i in 0 to (num_of_units - 1) loop |
||
390 | PE_data_sum := PE_data_sum + to_integer(PE_data_out(i)); --TODO: ali rabim tukaj to_integer ?? Bo pravilno tudi če ga ni (signala imata razlicno st. bitov)??? |
||
391 | end loop; |
||
392 | |||
393 | end if; |
||
394 | |||
395 | |||
396 | |||
397 | HISTOGRAM <= PE_data_sum; |
||
398 | |||
399 | |||
400 | end if; |
||
401 | |||
402 | end process; |
||
403 | |||
404 | |||
405 | |||
406 | -----------------------COMMUNICATION WITH MICROPROCESSOR----------------- |
||
407 | |||
408 | |||
409 | REC_FROM_MICROPROCESSOR: process (clk) |
||
410 | |||
411 | begin |
||
412 | |||
413 | if ( rising_edge(clk) ) then |
||
414 | |||
415 | if (rstn = '0') then |
||
416 | START_sig <= '0'; |
||
417 | elsif ( wr_en = '1' and HW_addr(19 downto 0) = HIST_SYS_ADDR ) then -- Q: kaksen naj bo HW address?? --mora biti 19 downto 0, tako kot na vajah |
||
418 | START_sig <= data_from_UC(0); |
||
419 | RESET_sig <= data_from_UC(1); |
||
420 | ADC_threshold_sig <= unsigned(data_from_UC(18 downto 8)); |
||
421 | ADC_capt_num_of_samples_sig <= unsigned(data_from_UC(26 downto 19)); |
||
422 | SW_trigger_value_sig <= unsigned(data_from_UC(31 downto 27)); |
||
423 | |||
424 | end if; |
||
425 | |||
426 | end if; |
||
427 | |||
428 | end process; |
||
429 | |||
430 | ----------------------- |
||
431 | UC_wr_en_sig <= rd_en; -- signal za menjavo izhodnih podatkov iz komponente |
||
432 | data_for_UC_sig <= std_logic_vector(HISTOGRAM) & "00000" & START_sig & UC_rd_en_current_sig & UC_rd_en_final_sig; --Q: a bo to OK, ta pretvorba?? Se kej podatkov izgubi ali pomesa?? |
||
433 | error <= '0'; -- iz vaje 7 |
||
434 | |||
435 | --data_for_UC_sig <=== zlozim vse podatke, ki jih hocem poslati procesorju v 32 bitni signal |
||
436 | |||
437 | SEND_TO_MICROPROCESSOR: process (HW_addr, wr_en, rd_en, UC_rd_en_final_sig) |
||
438 | |||
439 | begin |
||
440 | |||
441 | if ( (wr_en or rd_en) = '1' ) then |
||
442 | ack <= '1'; |
||
443 | end if; |
||
444 | |||
445 | if ( HW_addr(19 downto 0) = HIST_SYS_ADDR ) then |
||
446 | data_for_UC <= data_for_UC_sig; |
||
447 | else |
||
448 | data_for_UC <= (others =>'0'); |
||
449 | end if; |
||
450 | |||
451 | end process; |
||
452 | |||
453 | --Q: kje pa tukaj pride rn_en oz UC_wr_en_sig v postev??? |
||
454 | |||
455 | |||
456 | |||
457 | |||
458 | |||
459 | end Behavioral; |