@@ -42,7 +42,7 USE lpp.lpp_lfr_pkg.ALL; -- contains lp | |||||
42 | USE lpp.lpp_top_lfr_pkg.ALL; -- contains top_wf_picker |
|
42 | USE lpp.lpp_top_lfr_pkg.ALL; -- contains top_wf_picker | |
43 | USE lpp.iir_filter.ALL; |
|
43 | USE lpp.iir_filter.ALL; | |
44 | USE lpp.general_purpose.ALL; |
|
44 | USE lpp.general_purpose.ALL; | |
45 |
USE lpp.lpp_lfr_ |
|
45 | USE lpp.lpp_lfr_management.ALL; | |
46 | USE lpp.lpp_leon3_soc_pkg.ALL; |
|
46 | USE lpp.lpp_leon3_soc_pkg.ALL; | |
47 |
|
47 | |||
48 | ENTITY LFR_em IS |
|
48 | ENTITY LFR_em IS | |
@@ -250,7 +250,7 BEGIN -- beh | |||||
250 | ------------------------------------------------------------------------------- |
|
250 | ------------------------------------------------------------------------------- | |
251 | -- APB_LFR_TIME_MANAGEMENT ---------------------------------------------------- |
|
251 | -- APB_LFR_TIME_MANAGEMENT ---------------------------------------------------- | |
252 | ------------------------------------------------------------------------------- |
|
252 | ------------------------------------------------------------------------------- | |
253 |
apb_lfr_ |
|
253 | apb_lfr_management_1 : apb_lfr_management | |
254 | GENERIC MAP ( |
|
254 | GENERIC MAP ( | |
255 | pindex => 6, |
|
255 | pindex => 6, | |
256 | paddr => 6, |
|
256 | paddr => 6, | |
@@ -264,6 +264,11 BEGIN -- beh | |||||
264 | grspw_tick => swno.tickout, |
|
264 | grspw_tick => swno.tickout, | |
265 | apbi => apbi_ext, |
|
265 | apbi => apbi_ext, | |
266 | apbo => apbo_ext(6), |
|
266 | apbo => apbo_ext(6), | |
|
267 | ||||
|
268 | HK_sample => sample_s(8), | |||
|
269 | HK_val => sample_val, | |||
|
270 | HK_sel => HK_SEL, | |||
|
271 | ||||
267 |
|
|
272 | coarse_time => coarse_time, | |
268 | fine_time => fine_time, |
|
273 | fine_time => fine_time, | |
269 | LFR_soft_rstn => LFR_soft_rstn |
|
274 | LFR_soft_rstn => LFR_soft_rstn | |
@@ -374,7 +379,7 BEGIN -- beh | |||||
374 | pirq_ms => 6, |
|
379 | pirq_ms => 6, | |
375 | pirq_wfp => 14, |
|
380 | pirq_wfp => 14, | |
376 | hindex => 2, |
|
381 | hindex => 2, | |
377 |
top_lfr_version => X"0101 |
|
382 | top_lfr_version => X"010131") -- aa.bb.cc version | |
378 | -- AA : BOARD NUMBER |
|
383 | -- AA : BOARD NUMBER | |
379 | -- 0 => MINI_LFR |
|
384 | -- 0 => MINI_LFR | |
380 | -- 1 => EM |
|
385 | -- 1 => EM | |
@@ -435,20 +440,4 BEGIN -- beh | |||||
435 | ----------------------------------------------------------------------------- |
|
440 | ----------------------------------------------------------------------------- | |
436 | ADC_OEB_bar_HK <= ADC_OEB_bar_CH_s(8); |
|
441 | ADC_OEB_bar_HK <= ADC_OEB_bar_CH_s(8); | |
437 |
|
442 | |||
438 | lpp_lfr_hk_1: lpp_lfr_hk |
|
|||
439 | GENERIC MAP ( |
|
|||
440 | pindex => 7, |
|
|||
441 | paddr => 7, |
|
|||
442 | pmask => 16#fff#) |
|
|||
443 | PORT MAP ( |
|
|||
444 | clk => clk_25, |
|
|||
445 | rstn => rstn, |
|
|||
446 |
|
||||
447 | apbi => apbi_ext, |
|
|||
448 | apbo => apbo_ext(7), |
|
|||
449 |
|
||||
450 | sample_val => sample_val, |
|
|||
451 | sample => sample_s(8), |
|
|||
452 | HK_SEL => HK_SEL); |
|
|||
453 |
|
||||
454 | END beh; |
|
443 | END beh; |
@@ -42,7 +42,7 USE lpp.lpp_lfr_pkg.ALL; -- contains lp | |||||
42 | USE lpp.lpp_top_lfr_pkg.ALL; -- contains top_wf_picker |
|
42 | USE lpp.lpp_top_lfr_pkg.ALL; -- contains top_wf_picker | |
43 | USE lpp.iir_filter.ALL; |
|
43 | USE lpp.iir_filter.ALL; | |
44 | USE lpp.general_purpose.ALL; |
|
44 | USE lpp.general_purpose.ALL; | |
45 |
USE lpp.lpp_lfr_ |
|
45 | USE lpp.lpp_lfr_management.ALL; | |
46 | USE lpp.lpp_leon3_soc_pkg.ALL; |
|
46 | USE lpp.lpp_leon3_soc_pkg.ALL; | |
47 |
|
47 | |||
48 | ENTITY MINI_LFR_top IS |
|
48 | ENTITY MINI_LFR_top IS | |
@@ -385,9 +385,9 BEGIN -- beh | |||||
385 |
|
385 | |||
386 | SRAM_CE <= SRAM_CE_s(0); |
|
386 | SRAM_CE <= SRAM_CE_s(0); | |
387 | ------------------------------------------------------------------------------- |
|
387 | ------------------------------------------------------------------------------- | |
388 |
-- APB_LFR_ |
|
388 | -- APB_LFR_MANAGEMENT --------------------------------------------------------- | |
389 | ------------------------------------------------------------------------------- |
|
389 | ------------------------------------------------------------------------------- | |
390 |
apb_lfr_ |
|
390 | apb_lfr_management_1 : apb_lfr_management | |
391 | GENERIC MAP ( |
|
391 | GENERIC MAP ( | |
392 | pindex => 6, |
|
392 | pindex => 6, | |
393 | paddr => 6, |
|
393 | paddr => 6, | |
@@ -401,6 +401,9 BEGIN -- beh | |||||
401 | grspw_tick => swno.tickout, |
|
401 | grspw_tick => swno.tickout, | |
402 | apbi => apbi_ext, |
|
402 | apbi => apbi_ext, | |
403 | apbo => apbo_ext(6), |
|
403 | apbo => apbo_ext(6), | |
|
404 | HK_sample => sample_hk, | |||
|
405 | HK_val => sample_val, | |||
|
406 | HK_sel => HK_SEL, | |||
404 |
|
|
407 | coarse_time => coarse_time, | |
405 | fine_time => fine_time, |
|
408 | fine_time => fine_time, | |
406 | LFR_soft_rstn => LFR_soft_rstn |
|
409 | LFR_soft_rstn => LFR_soft_rstn | |
@@ -515,7 +518,7 BEGIN -- beh | |||||
515 | pirq_ms => 6, |
|
518 | pirq_ms => 6, | |
516 | pirq_wfp => 14, |
|
519 | pirq_wfp => 14, | |
517 | hindex => 2, |
|
520 | hindex => 2, | |
518 |
top_lfr_version => X"0001 |
|
521 | top_lfr_version => X"000131") -- aa.bb.cc version | |
519 | PORT MAP ( |
|
522 | PORT MAP ( | |
520 | clk => clk_25, |
|
523 | clk => clk_25, | |
521 | rstn => LFR_rstn, |
|
524 | rstn => LFR_rstn, | |
@@ -578,22 +581,6 BEGIN -- beh | |||||
578 | ADC_CLK <= ADC_CLK_sig; |
|
581 | ADC_CLK <= ADC_CLK_sig; | |
579 | ADC_SDO_sig <= ADC_SDO; |
|
582 | ADC_SDO_sig <= ADC_SDO; | |
580 |
|
583 | |||
581 | lpp_lfr_hk_1: lpp_lfr_hk |
|
|||
582 | GENERIC MAP ( |
|
|||
583 | pindex => 7, |
|
|||
584 | paddr => 7, |
|
|||
585 | pmask => 16#fff#) |
|
|||
586 | PORT MAP ( |
|
|||
587 | clk => clk_25, |
|
|||
588 | rstn => rstn_25, |
|
|||
589 |
|
||||
590 | apbi => apbi_ext, |
|
|||
591 | apbo => apbo_ext(7), |
|
|||
592 |
|
||||
593 | sample_val => sample_val, |
|
|||
594 | sample => sample_hk, |
|
|||
595 | HK_SEL => HK_SEL); |
|
|||
596 |
|
||||
597 | sample_hk <= "0001000100010001" WHEN HK_SEL = "00" ELSE |
|
584 | sample_hk <= "0001000100010001" WHEN HK_SEL = "00" ELSE | |
598 | "0010001000100010" WHEN HK_SEL = "10" ELSE |
|
585 | "0010001000100010" WHEN HK_SEL = "10" ELSE | |
599 | "0100010001000100" WHEN HK_SEL = "10" ELSE |
|
586 | "0100010001000100" WHEN HK_SEL = "10" ELSE | |
@@ -727,7 +714,7 BEGIN -- beh | |||||
727 | -- |
|
714 | -- | |
728 | ----------------------------------------------------------------------------- |
|
715 | ----------------------------------------------------------------------------- | |
729 | all_apbo_ext : FOR I IN NB_APB_SLAVE-1+5 DOWNTO 5 GENERATE |
|
716 | all_apbo_ext : FOR I IN NB_APB_SLAVE-1+5 DOWNTO 5 GENERATE | |
730 |
apbo_ext_not_used : IF I /= 5 AND I /= 6 AND I /= |
|
717 | apbo_ext_not_used : IF I /= 5 AND I /= 6 AND I /= 11 AND I /= 15 GENERATE | |
731 | apbo_ext(I) <= apb_none; |
|
718 | apbo_ext(I) <= apb_none; | |
732 | END GENERATE apbo_ext_not_used; |
|
719 | END GENERATE apbo_ext_not_used; | |
733 | END GENERATE all_apbo_ext; |
|
720 | END GENERATE all_apbo_ext; |
@@ -11,7 +11,7 | |||||
11 | ./dsp/lpp_fft_rtax |
|
11 | ./dsp/lpp_fft_rtax | |
12 | ./lpp_memory |
|
12 | ./lpp_memory | |
13 | ./dsp/lpp_fft |
|
13 | ./dsp/lpp_fft | |
14 |
./lfr_ |
|
14 | ./lfr_management | |
15 | ./lpp_ad_Conv |
|
15 | ./lpp_ad_Conv | |
16 | ./lpp_bootloader |
|
16 | ./lpp_bootloader | |
17 | ./lpp_cna |
|
17 | ./lpp_cna |
@@ -27,11 +27,11 USE grlib.devices.ALL; | |||||
27 | LIBRARY lpp; |
|
27 | LIBRARY lpp; | |
28 | USE lpp.apb_devices_list.ALL; |
|
28 | USE lpp.apb_devices_list.ALL; | |
29 | USE lpp.general_purpose.ALL; |
|
29 | USE lpp.general_purpose.ALL; | |
30 |
USE lpp.lpp_lfr_ |
|
30 | USE lpp.lpp_lfr_management.ALL; | |
31 |
USE lpp.lpp_lfr_ |
|
31 | USE lpp.lpp_lfr_management_apbreg_pkg.ALL; | |
32 |
|
32 | |||
33 |
|
33 | |||
34 |
ENTITY apb_lfr_ |
|
34 | ENTITY apb_lfr_management IS | |
35 |
|
35 | |||
36 | GENERIC( |
|
36 | GENERIC( | |
37 | pindex : INTEGER := 0; --! APB slave index |
|
37 | pindex : INTEGER := 0; --! APB slave index | |
@@ -50,16 +50,20 ENTITY apb_lfr_time_management IS | |||||
50 |
|
50 | |||
51 | apbi : IN apb_slv_in_type; --! APB slave input signals |
|
51 | apbi : IN apb_slv_in_type; --! APB slave input signals | |
52 | apbo : OUT apb_slv_out_type; --! APB slave output signals |
|
52 | apbo : OUT apb_slv_out_type; --! APB slave output signals | |
53 |
|
53 | --------------------------------------------------------------------------- | ||
|
54 | HK_sample : IN STD_LOGIC_VECTOR(15 DOWNTO 0); | |||
|
55 | HK_val : IN STD_LOGIC; | |||
|
56 | HK_sel : OUT STD_LOGIC_VECTOR(1 DOWNTO 0); | |||
|
57 | --------------------------------------------------------------------------- | |||
54 | coarse_time : OUT STD_LOGIC_VECTOR(31 DOWNTO 0); --! coarse time |
|
58 | coarse_time : OUT STD_LOGIC_VECTOR(31 DOWNTO 0); --! coarse time | |
55 | fine_time : OUT STD_LOGIC_VECTOR(15 DOWNTO 0); --! fine TIME |
|
59 | fine_time : OUT STD_LOGIC_VECTOR(15 DOWNTO 0); --! fine TIME | |
56 | --------------------------------------------------------------------------- |
|
60 | --------------------------------------------------------------------------- | |
57 | LFR_soft_rstn : OUT STD_LOGIC |
|
61 | LFR_soft_rstn : OUT STD_LOGIC | |
58 | ); |
|
62 | ); | |
59 |
|
63 | |||
60 |
END apb_lfr_ |
|
64 | END apb_lfr_management; | |
61 |
|
65 | |||
62 |
ARCHITECTURE Behavioral OF apb_lfr_ |
|
66 | ARCHITECTURE Behavioral OF apb_lfr_management IS | |
63 |
|
67 | |||
64 | CONSTANT REVISION : INTEGER := 1; |
|
68 | CONSTANT REVISION : INTEGER := 1; | |
65 | CONSTANT pconfig : apb_config_type := ( |
|
69 | CONSTANT pconfig : apb_config_type := ( | |
@@ -74,6 +78,9 ARCHITECTURE Behavioral OF apb_lfr_time_ | |||||
74 | coarse_time : STD_LOGIC_VECTOR(31 DOWNTO 0); |
|
78 | coarse_time : STD_LOGIC_VECTOR(31 DOWNTO 0); | |
75 | fine_time : STD_LOGIC_VECTOR(15 DOWNTO 0); |
|
79 | fine_time : STD_LOGIC_VECTOR(15 DOWNTO 0); | |
76 | LFR_soft_reset : STD_LOGIC; |
|
80 | LFR_soft_reset : STD_LOGIC; | |
|
81 | HK_temp_0 : STD_LOGIC_VECTOR(15 DOWNTO 0); | |||
|
82 | HK_temp_1 : STD_LOGIC_VECTOR(15 DOWNTO 0); | |||
|
83 | HK_temp_2 : STD_LOGIC_VECTOR(15 DOWNTO 0); | |||
77 | END RECORD; |
|
84 | END RECORD; | |
78 | SIGNAL r : apb_lfr_time_management_Reg; |
|
85 | SIGNAL r : apb_lfr_time_management_Reg; | |
79 |
|
86 | |||
@@ -108,6 +115,10 ARCHITECTURE Behavioral OF apb_lfr_time_ | |||||
108 | SIGNAL soft_reset : STD_LOGIC; |
|
115 | SIGNAL soft_reset : STD_LOGIC; | |
109 | SIGNAL soft_reset_sync : STD_LOGIC; |
|
116 | SIGNAL soft_reset_sync : STD_LOGIC; | |
110 | ----------------------------------------------------------------------------- |
|
117 | ----------------------------------------------------------------------------- | |
|
118 | SIGNAL HK_temp_0_s : STD_LOGIC_VECTOR(15 DOWNTO 0); | |||
|
119 | SIGNAL HK_temp_1_s : STD_LOGIC_VECTOR(15 DOWNTO 0); | |||
|
120 | SIGNAL HK_temp_2_s : STD_LOGIC_VECTOR(15 DOWNTO 0); | |||
|
121 | SIGNAL HK_sel_s : STD_LOGIC_VECTOR( 1 DOWNTO 0); | |||
111 |
|
122 | |||
112 | SIGNAL rstn_LFR_TM : STD_LOGIC; |
|
123 | SIGNAL rstn_LFR_TM : STD_LOGIC; | |
113 |
|
124 | |||
@@ -153,11 +164,11 BEGIN | |||||
153 | --APB Write OP |
|
164 | --APB Write OP | |
154 | IF (apbi.psel(pindex) AND apbi.penable AND apbi.pwrite) = '1' THEN |
|
165 | IF (apbi.psel(pindex) AND apbi.penable AND apbi.pwrite) = '1' THEN | |
155 | CASE apbi.paddr(7 DOWNTO 2) IS |
|
166 | CASE apbi.paddr(7 DOWNTO 2) IS | |
156 |
WHEN ADDR_LFR_ |
|
167 | WHEN ADDR_LFR_MANAGMENT_CONTROL => | |
157 | r.ctrl <= apbi.pwdata(0); |
|
168 | r.ctrl <= apbi.pwdata(0); | |
158 | r.soft_reset <= apbi.pwdata(1); |
|
169 | r.soft_reset <= apbi.pwdata(1); | |
159 | r.LFR_soft_reset <= apbi.pwdata(2); |
|
170 | r.LFR_soft_reset <= apbi.pwdata(2); | |
160 |
WHEN ADDR_LFR_ |
|
171 | WHEN ADDR_LFR_MANAGMENT_TIME_LOAD => | |
161 | r.coarse_time_load <= apbi.pwdata(30 DOWNTO 0); |
|
172 | r.coarse_time_load <= apbi.pwdata(30 DOWNTO 0); | |
162 | coarsetime_reg_updated <= '1'; |
|
173 | coarsetime_reg_updated <= '1'; | |
163 | WHEN OTHERS => |
|
174 | WHEN OTHERS => | |
@@ -175,18 +186,27 BEGIN | |||||
175 | --APB READ OP |
|
186 | --APB READ OP | |
176 | IF (apbi.psel(pindex) AND (NOT apbi.pwrite)) = '1' THEN |
|
187 | IF (apbi.psel(pindex) AND (NOT apbi.pwrite)) = '1' THEN | |
177 | CASE apbi.paddr(7 DOWNTO 2) IS |
|
188 | CASE apbi.paddr(7 DOWNTO 2) IS | |
178 |
WHEN ADDR_LFR_ |
|
189 | WHEN ADDR_LFR_MANAGMENT_CONTROL => | |
179 | Rdata(0) <= r.ctrl; |
|
190 | Rdata(0) <= r.ctrl; | |
180 | Rdata(1) <= r.soft_reset; |
|
191 | Rdata(1) <= r.soft_reset; | |
181 | Rdata(2) <= r.LFR_soft_reset; |
|
192 | Rdata(2) <= r.LFR_soft_reset; | |
182 | Rdata(31 DOWNTO 3) <= (others => '0'); |
|
193 | Rdata(31 DOWNTO 3) <= (others => '0'); | |
183 |
WHEN ADDR_LFR_ |
|
194 | WHEN ADDR_LFR_MANAGMENT_TIME_LOAD => | |
184 | Rdata(30 DOWNTO 0) <= r.coarse_time_load(30 DOWNTO 0); |
|
195 | Rdata(30 DOWNTO 0) <= r.coarse_time_load(30 DOWNTO 0); | |
185 |
WHEN ADDR_LFR_ |
|
196 | WHEN ADDR_LFR_MANAGMENT_TIME_COARSE => | |
186 | Rdata(31 DOWNTO 0) <= r.coarse_time(31 DOWNTO 0); |
|
197 | Rdata(31 DOWNTO 0) <= r.coarse_time(31 DOWNTO 0); | |
187 |
WHEN ADDR_LFR_ |
|
198 | WHEN ADDR_LFR_MANAGMENT_TIME_FINE => | |
188 | Rdata(31 DOWNTO 16) <= (OTHERS => '0'); |
|
199 | Rdata(31 DOWNTO 16) <= (OTHERS => '0'); | |
189 | Rdata(15 DOWNTO 0) <= r.fine_time(15 DOWNTO 0); |
|
200 | Rdata(15 DOWNTO 0) <= r.fine_time(15 DOWNTO 0); | |
|
201 | WHEN ADDR_LFR_MANAGMENT_HK_TEMP_0 => | |||
|
202 | Rdata(31 DOWNTO 16) <= (OTHERS => '0'); | |||
|
203 | Rdata(15 DOWNTO 0) <= r.HK_temp_0; | |||
|
204 | WHEN ADDR_LFR_MANAGMENT_HK_TEMP_1 => | |||
|
205 | Rdata(31 DOWNTO 16) <= (OTHERS => '0'); | |||
|
206 | Rdata(15 DOWNTO 0) <= r.HK_temp_1; | |||
|
207 | WHEN ADDR_LFR_MANAGMENT_HK_TEMP_2 => | |||
|
208 | Rdata(31 DOWNTO 16) <= (OTHERS => '0'); | |||
|
209 | Rdata(15 DOWNTO 0) <= r.HK_temp_2; | |||
190 | WHEN OTHERS => |
|
210 | WHEN OTHERS => | |
191 | Rdata(31 DOWNTO 0) <= (others => '0'); |
|
211 | Rdata(31 DOWNTO 0) <= (others => '0'); | |
192 | END CASE; |
|
212 | END CASE; | |
@@ -326,4 +346,35 BEGIN | |||||
326 | coarse_time => coarse_time_49, |
|
346 | coarse_time => coarse_time_49, | |
327 | coarse_time_new => coarse_time_new_49); |
|
347 | coarse_time_new => coarse_time_new_49); | |
328 |
|
348 | |||
329 | END Behavioral; |
|
349 | ----------------------------------------------------------------------------- | |
|
350 | -- HK | |||
|
351 | ----------------------------------------------------------------------------- | |||
|
352 | ||||
|
353 | PROCESS (clk25MHz, resetn) | |||
|
354 | BEGIN -- PROCESS | |||
|
355 | IF resetn = '0' THEN -- asynchronous reset (active low) | |||
|
356 | ||||
|
357 | r.HK_temp_0 <= (OTHERS => '0'); | |||
|
358 | r.HK_temp_1 <= (OTHERS => '0'); | |||
|
359 | r.HK_temp_2 <= (OTHERS => '0'); | |||
|
360 | ||||
|
361 | HK_sel_s <= "00"; | |||
|
362 | ||||
|
363 | ELSIF clk25MHz'event AND clk25MHz = '1' THEN -- rising clock edge | |||
|
364 | ||||
|
365 | IF HK_val = '1' THEN | |||
|
366 | CASE HK_sel_s IS | |||
|
367 | WHEN "00" => r.HK_temp_0 <= HK_sample; HK_sel_s <= "01"; | |||
|
368 | WHEN "01" => r.HK_temp_1 <= HK_sample; HK_sel_s <= "10"; | |||
|
369 | WHEN "10" => r.HK_temp_2 <= HK_sample; HK_sel_s <= "00"; | |||
|
370 | WHEN OTHERS => NULL; | |||
|
371 | END CASE; | |||
|
372 | ||||
|
373 | END IF; | |||
|
374 | ||||
|
375 | END IF; | |||
|
376 | END PROCESS; | |||
|
377 | ||||
|
378 | HK_sel <= HK_sel_s; | |||
|
379 | ||||
|
380 | END Behavioral; No newline at end of file |
1 | NO CONTENT: file renamed from lib/lpp/lfr_time_management/coarse_time_counter.vhd to lib/lpp/lfr_management/coarse_time_counter.vhd |
|
NO CONTENT: file renamed from lib/lpp/lfr_time_management/coarse_time_counter.vhd to lib/lpp/lfr_management/coarse_time_counter.vhd |
1 | NO CONTENT: file renamed from lib/lpp/lfr_time_management/fine_time_counter.vhd to lib/lpp/lfr_management/fine_time_counter.vhd |
|
NO CONTENT: file renamed from lib/lpp/lfr_time_management/fine_time_counter.vhd to lib/lpp/lfr_management/fine_time_counter.vhd |
@@ -21,7 +21,7 LIBRARY IEEE; | |||||
21 | USE IEEE.STD_LOGIC_1164.ALL; |
|
21 | USE IEEE.STD_LOGIC_1164.ALL; | |
22 | USE IEEE.NUMERIC_STD.ALL; |
|
22 | USE IEEE.NUMERIC_STD.ALL; | |
23 | LIBRARY lpp; |
|
23 | LIBRARY lpp; | |
24 |
USE lpp.lpp_lfr_ |
|
24 | USE lpp.lpp_lfr_management.ALL; | |
25 |
|
25 | |||
26 | ENTITY lfr_time_management IS |
|
26 | ENTITY lfr_time_management IS | |
27 | GENERIC ( |
|
27 | GENERIC ( |
@@ -24,29 +24,31 USE grlib.amba.ALL; | |||||
24 | USE grlib.stdlib.ALL; |
|
24 | USE grlib.stdlib.ALL; | |
25 | USE grlib.devices.ALL; |
|
25 | USE grlib.devices.ALL; | |
26 |
|
26 | |||
27 |
PACKAGE lpp_lfr_ |
|
27 | PACKAGE lpp_lfr_management IS | |
28 |
|
28 | |||
29 | --*************************** |
|
29 | --*************************** | |
30 |
-- APB_LFR_ |
|
30 | -- APB_LFR_MANAGEMENT | |
31 |
|
31 | |||
32 |
COMPONENT apb_lfr_ |
|
32 | COMPONENT apb_lfr_management | |
33 | GENERIC( |
|
33 | GENERIC ( | |
34 |
pindex |
|
34 | pindex : INTEGER; | |
35 | paddr : INTEGER := 0; --! ADDR field of the APB BAR |
|
35 | paddr : INTEGER; | |
36 | pmask : INTEGER := 16#fff#; --! MASK field of the APB BAR |
|
36 | pmask : INTEGER; | |
37 |
FIRST_DIVISION |
|
37 | FIRST_DIVISION : INTEGER; | |
38 |
NB_SECOND_DESYNC |
|
38 | NB_SECOND_DESYNC : INTEGER); | |
39 | PORT ( |
|
39 | PORT ( | |
40 |
clk25MHz : IN STD_LOGIC; |
|
40 | clk25MHz : IN STD_LOGIC; | |
41 |
clk24_576MHz : IN STD_LOGIC; |
|
41 | clk24_576MHz : IN STD_LOGIC; | |
42 |
resetn : IN STD_LOGIC; |
|
42 | resetn : IN STD_LOGIC; | |
43 | grspw_tick : IN STD_LOGIC; --! grspw signal asserted when a valid time-code is received |
|
43 | grspw_tick : IN STD_LOGIC; | |
44 |
apbi : IN apb_slv_in_type; |
|
44 | apbi : IN apb_slv_in_type; | |
45 |
apbo : OUT apb_slv_out_type; |
|
45 | apbo : OUT apb_slv_out_type; | |
46 |
|
|
46 | HK_sample : IN STD_LOGIC_VECTOR(15 DOWNTO 0); | |
47 | fine_time : OUT STD_LOGIC_VECTOR(15 DOWNTO 0); --! fine TIME |
|
47 | HK_val : IN STD_LOGIC; | |
48 | LFR_soft_rstn : OUT STD_LOGIC |
|
48 | HK_sel : OUT STD_LOGIC_VECTOR(1 DOWNTO 0); | |
49 | ); |
|
49 | coarse_time : OUT STD_LOGIC_VECTOR(31 DOWNTO 0); | |
|
50 | fine_time : OUT STD_LOGIC_VECTOR(15 DOWNTO 0); | |||
|
51 | LFR_soft_rstn : OUT STD_LOGIC); | |||
50 | END COMPONENT; |
|
52 | END COMPONENT; | |
51 |
|
53 | |||
52 | COMPONENT lfr_time_management |
|
54 | COMPONENT lfr_time_management | |
@@ -99,5 +101,5 PACKAGE lpp_lfr_time_management IS | |||||
99 | END COMPONENT; |
|
101 | END COMPONENT; | |
100 |
|
102 | |||
101 |
|
103 | |||
102 |
END lpp_lfr_ |
|
104 | END lpp_lfr_management; | |
103 |
|
105 |
@@ -2,11 +2,14 LIBRARY ieee; | |||||
2 | USE ieee.std_logic_1164.ALL; |
|
2 | USE ieee.std_logic_1164.ALL; | |
3 | USE ieee.numeric_std.ALL; |
|
3 | USE ieee.numeric_std.ALL; | |
4 |
|
4 | |||
5 |
PACKAGE lpp_lfr_ |
|
5 | PACKAGE lpp_lfr_management_apbreg_pkg IS | |
6 |
|
6 | |||
7 |
CONSTANT ADDR_LFR_ |
|
7 | CONSTANT ADDR_LFR_MANAGMENT_CONTROL : STD_LOGIC_VECTOR(7 DOWNTO 2) := "000000"; | |
8 |
CONSTANT ADDR_LFR_ |
|
8 | CONSTANT ADDR_LFR_MANAGMENT_TIME_LOAD : STD_LOGIC_VECTOR(7 DOWNTO 2) := "000001"; | |
9 |
CONSTANT ADDR_LFR_ |
|
9 | CONSTANT ADDR_LFR_MANAGMENT_TIME_COARSE : STD_LOGIC_VECTOR(7 DOWNTO 2) := "000010"; | |
10 |
CONSTANT ADDR_LFR_ |
|
10 | CONSTANT ADDR_LFR_MANAGMENT_TIME_FINE : STD_LOGIC_VECTOR(7 DOWNTO 2) := "000011"; | |
|
11 | CONSTANT ADDR_LFR_MANAGMENT_HK_TEMP_0 : STD_LOGIC_VECTOR(7 DOWNTO 2) := "000100"; | |||
|
12 | CONSTANT ADDR_LFR_MANAGMENT_HK_TEMP_1 : STD_LOGIC_VECTOR(7 DOWNTO 2) := "000101"; | |||
|
13 | CONSTANT ADDR_LFR_MANAGMENT_HK_TEMP_2 : STD_LOGIC_VECTOR(7 DOWNTO 2) := "000110"; | |||
11 |
|
14 | |||
12 |
END lpp_lfr_ |
|
15 | END lpp_lfr_management_apbreg_pkg; |
@@ -1,6 +1,6 | |||||
1 |
lpp_lfr_ |
|
1 | lpp_lfr_management.vhd | |
2 |
lpp_lfr_ |
|
2 | lpp_lfr_management_apbreg_pkg.vhd | |
3 |
apb_lfr_ |
|
3 | apb_lfr_management.vhd | |
4 | lfr_time_management.vhd |
|
4 | lfr_time_management.vhd | |
5 | fine_time_counter.vhd |
|
5 | fine_time_counter.vhd | |
6 | coarse_time_counter.vhd |
|
6 | coarse_time_counter.vhd |
@@ -39,7 +39,6 USE lpp.lpp_ad_conv.ALL; | |||||
39 | USE lpp.lpp_lfr_pkg.ALL; |
|
39 | USE lpp.lpp_lfr_pkg.ALL; | |
40 | USE lpp.iir_filter.ALL; |
|
40 | USE lpp.iir_filter.ALL; | |
41 | USE lpp.general_purpose.ALL; |
|
41 | USE lpp.general_purpose.ALL; | |
42 | USE lpp.lpp_lfr_time_management.ALL; |
|
|||
43 | USE lpp.lpp_leon3_soc_pkg.ALL; |
|
42 | USE lpp.lpp_leon3_soc_pkg.ALL; | |
44 | LIBRARY iap; |
|
43 | LIBRARY iap; | |
45 | USE iap.memctrl.all; |
|
44 | USE iap.memctrl.all; |
This diff has been collapsed as it changes many lines, (975 lines changed) Show them Hide them | |||||
@@ -1,488 +1,487 | |||||
1 | ----------------------------------------------------------------------------- |
|
1 | ----------------------------------------------------------------------------- | |
2 | -- LEON3 Demonstration design |
|
2 | -- LEON3 Demonstration design | |
3 | -- Copyright (C) 2004 Jiri Gaisler, Gaisler Research |
|
3 | -- Copyright (C) 2004 Jiri Gaisler, Gaisler Research | |
4 | -- |
|
4 | -- | |
5 | -- This program is free software; you can redistribute it and/or modify |
|
5 | -- This program is free software; you can redistribute it and/or modify | |
6 | -- it under the terms of the GNU General Public License as published by |
|
6 | -- it under the terms of the GNU General Public License as published by | |
7 | -- the Free Software Foundation; either version 2 of the License, or |
|
7 | -- the Free Software Foundation; either version 2 of the License, or | |
8 | -- (at your option) any later version. |
|
8 | -- (at your option) any later version. | |
9 | -- |
|
9 | -- | |
10 | -- This program is distributed in the hope that it will be useful, |
|
10 | -- This program is distributed in the hope that it will be useful, | |
11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | -- GNU General Public License for more details. |
|
13 | -- GNU General Public License for more details. | |
14 | -- |
|
14 | -- | |
15 | -- You should have received a copy of the GNU General Public License |
|
15 | -- You should have received a copy of the GNU General Public License | |
16 | -- along with this program; if not, write to the Free Software |
|
16 | -- along with this program; if not, write to the Free Software | |
17 | -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
17 | -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
18 | ------------------------------------------------------------------------------ |
|
18 | ------------------------------------------------------------------------------ | |
19 |
|
19 | |||
20 |
|
20 | |||
21 | LIBRARY ieee; |
|
21 | LIBRARY ieee; | |
22 | USE ieee.std_logic_1164.ALL; |
|
22 | USE ieee.std_logic_1164.ALL; | |
23 | LIBRARY grlib; |
|
23 | LIBRARY grlib; | |
24 | USE grlib.amba.ALL; |
|
24 | USE grlib.amba.ALL; | |
25 | USE grlib.stdlib.ALL; |
|
25 | USE grlib.stdlib.ALL; | |
26 | LIBRARY techmap; |
|
26 | LIBRARY techmap; | |
27 | USE techmap.gencomp.ALL; |
|
27 | USE techmap.gencomp.ALL; | |
28 | LIBRARY gaisler; |
|
28 | LIBRARY gaisler; | |
29 | USE gaisler.memctrl.ALL; |
|
29 | USE gaisler.memctrl.ALL; | |
30 | USE gaisler.leon3.ALL; |
|
30 | USE gaisler.leon3.ALL; | |
31 | USE gaisler.uart.ALL; |
|
31 | USE gaisler.uart.ALL; | |
32 | USE gaisler.misc.ALL; |
|
32 | USE gaisler.misc.ALL; | |
33 | USE gaisler.spacewire.ALL; -- PLE |
|
33 | USE gaisler.spacewire.ALL; -- PLE | |
34 | LIBRARY esa; |
|
34 | LIBRARY esa; | |
35 | USE esa.memoryctrl.ALL; |
|
35 | USE esa.memoryctrl.ALL; | |
36 | LIBRARY lpp; |
|
36 | LIBRARY lpp; | |
37 | USE lpp.lpp_memory.ALL; |
|
37 | USE lpp.lpp_memory.ALL; | |
38 | USE lpp.lpp_ad_conv.ALL; |
|
38 | USE lpp.lpp_ad_conv.ALL; | |
39 | USE lpp.lpp_lfr_pkg.ALL; |
|
39 | USE lpp.lpp_lfr_pkg.ALL; | |
40 | USE lpp.iir_filter.ALL; |
|
40 | USE lpp.iir_filter.ALL; | |
41 | USE lpp.general_purpose.ALL; |
|
41 | USE lpp.general_purpose.ALL; | |
42 |
USE lpp.lpp_l |
|
42 | USE lpp.lpp_leon3_soc_pkg.ALL; | |
43 | USE lpp.lpp_leon3_soc_pkg.ALL; |
|
43 | ||
44 |
|
44 | ENTITY leon3ft_soc IS | ||
45 | ENTITY leon3ft_soc IS |
|
45 | GENERIC ( | |
46 | GENERIC ( |
|
46 | fabtech : INTEGER := apa3e; | |
47 |
|
|
47 | memtech : INTEGER := apa3e; | |
48 |
|
|
48 | padtech : INTEGER := inferred; | |
49 |
|
|
49 | clktech : INTEGER := inferred; | |
50 | clktech : INTEGER := inferred; |
|
50 | disas : INTEGER := 0; -- Enable disassembly to console | |
51 |
d |
|
51 | dbguart : INTEGER := 0; -- Print UART on console | |
52 | dbguart : INTEGER := 0; -- Print UART on console |
|
52 | pclow : INTEGER := 2; | |
53 | pclow : INTEGER := 2; |
|
53 | -- | |
54 | -- |
|
54 | clk_freq : INTEGER := 25000; --kHz | |
55 | clk_freq : INTEGER := 25000; --kHz |
|
55 | -- | |
56 | -- |
|
56 | NB_CPU : INTEGER := 1; | |
57 |
|
|
57 | ENABLE_FPU : INTEGER := 1; | |
58 |
|
|
58 | FPU_NETLIST : INTEGER := 1; | |
59 |
|
|
59 | ENABLE_DSU : INTEGER := 1; | |
60 |
ENABLE_ |
|
60 | ENABLE_AHB_UART : INTEGER := 1; | |
61 |
ENABLE_A |
|
61 | ENABLE_APB_UART : INTEGER := 1; | |
62 |
ENABLE_ |
|
62 | ENABLE_IRQMP : INTEGER := 1; | |
63 |
ENABLE_ |
|
63 | ENABLE_GPT : INTEGER := 1; | |
64 | ENABLE_GPT : INTEGER := 1; |
|
64 | -- | |
65 | -- |
|
65 | NB_AHB_MASTER : INTEGER := 11; | |
66 |
NB_AHB_ |
|
66 | NB_AHB_SLAVE : INTEGER := 1; | |
67 |
NB_A |
|
67 | NB_APB_SLAVE : INTEGER := 2 | |
68 | NB_APB_SLAVE : INTEGER := 2 |
|
68 | ); | |
69 | ); |
|
69 | PORT ( | |
70 | PORT ( |
|
70 | clk : IN STD_ULOGIC; | |
71 |
|
|
71 | reset : IN STD_ULOGIC; | |
72 | reset : IN STD_ULOGIC; |
|
72 | ||
73 |
|
73 | errorn : OUT STD_ULOGIC; | ||
74 | errorn : OUT STD_ULOGIC; |
|
74 | ||
75 |
|
75 | -- UART AHB --------------------------------------------------------------- | ||
76 | -- UART AHB --------------------------------------------------------------- |
|
76 | ahbrxd : IN STD_ULOGIC; -- DSU rx data | |
77 |
ahb |
|
77 | ahbtxd : OUT STD_ULOGIC; -- DSU tx data | |
78 | ahbtxd : OUT STD_ULOGIC; -- DSU tx data |
|
78 | ||
79 |
|
79 | -- UART APB --------------------------------------------------------------- | ||
80 | -- UART APB --------------------------------------------------------------- |
|
80 | urxd1 : IN STD_ULOGIC; -- UART1 rx data | |
81 |
u |
|
81 | utxd1 : OUT STD_ULOGIC; -- UART1 tx data | |
82 | utxd1 : OUT STD_ULOGIC; -- UART1 tx data |
|
82 | ||
83 |
|
83 | -- RAM -------------------------------------------------------------------- | ||
84 | -- RAM -------------------------------------------------------------------- |
|
84 | address : OUT STD_LOGIC_VECTOR(19 DOWNTO 0); | |
85 |
|
|
85 | data : INOUT STD_LOGIC_VECTOR(31 DOWNTO 0); | |
86 | data : INOUT STD_LOGIC_VECTOR(31 DOWNTO 0); |
|
86 | nSRAM_BE0 : OUT STD_LOGIC; | |
87 |
nSRAM_BE |
|
87 | nSRAM_BE1 : OUT STD_LOGIC; | |
88 |
nSRAM_BE |
|
88 | nSRAM_BE2 : OUT STD_LOGIC; | |
89 |
nSRAM_BE |
|
89 | nSRAM_BE3 : OUT STD_LOGIC; | |
90 |
nSRAM_ |
|
90 | nSRAM_WE : OUT STD_LOGIC; | |
91 |
nSRAM_ |
|
91 | nSRAM_CE : OUT STD_LOGIC; | |
92 |
nSRAM_ |
|
92 | nSRAM_OE : OUT STD_LOGIC; | |
93 | nSRAM_OE : OUT STD_LOGIC; |
|
93 | ||
94 |
|
94 | -- APB -------------------------------------------------------------------- | ||
95 | -- APB -------------------------------------------------------------------- |
|
95 | apbi_ext : OUT apb_slv_in_type; | |
96 | apbi_ext : OUT apb_slv_in_type; |
|
96 | apbo_ext : IN soc_apb_slv_out_vector(NB_APB_SLAVE-1+5 DOWNTO 5); | |
97 | apbo_ext : IN soc_apb_slv_out_vector(NB_APB_SLAVE-1+5 DOWNTO 5); |
|
97 | -- AHB_Slave -------------------------------------------------------------- | |
98 | -- AHB_Slave -------------------------------------------------------------- |
|
98 | ahbi_s_ext : OUT ahb_slv_in_type; | |
99 | ahbi_s_ext : OUT ahb_slv_in_type; |
|
99 | ahbo_s_ext : IN soc_ahb_slv_out_vector(NB_AHB_SLAVE-1+3 DOWNTO 3); | |
100 | ahbo_s_ext : IN soc_ahb_slv_out_vector(NB_AHB_SLAVE-1+3 DOWNTO 3); |
|
100 | -- AHB_Master ------------------------------------------------------------- | |
101 | -- AHB_Master ------------------------------------------------------------- |
|
101 | ahbi_m_ext : OUT AHB_Mst_In_Type; | |
102 | ahbi_m_ext : OUT AHB_Mst_In_Type; |
|
102 | ahbo_m_ext : IN soc_ahb_mst_out_vector(NB_AHB_MASTER-1+NB_CPU DOWNTO NB_CPU) | |
103 | ahbo_m_ext : IN soc_ahb_mst_out_vector(NB_AHB_MASTER-1+NB_CPU DOWNTO NB_CPU) |
|
103 | ||
104 |
|
104 | ); | ||
105 | ); |
|
105 | END; | |
106 | END; |
|
106 | ||
107 |
|
107 | ARCHITECTURE Behavioral OF leon3ft_soc IS | ||
108 | ARCHITECTURE Behavioral OF leon3ft_soc IS |
|
108 | ||
109 |
|
109 | ----------------------------------------------------------------------------- | ||
110 |
-- |
|
110 | -- CONFIG ------------------------------------------------------------------- | |
111 |
-- |
|
111 | ----------------------------------------------------------------------------- | |
112 | ----------------------------------------------------------------------------- |
|
112 | ||
113 |
|
113 | -- Clock generator | ||
114 | -- Clock generator |
|
114 | CONSTANT CFG_CLKMUL : INTEGER := (1); | |
115 |
CONSTANT CFG_CLK |
|
115 | CONSTANT CFG_CLKDIV : INTEGER := (1); -- divide 50MHz by 2 to get 25MHz | |
116 |
CONSTANT CFG_CLKDIV |
|
116 | CONSTANT CFG_OCLKDIV : INTEGER := (1); | |
117 |
CONSTANT CFG_ |
|
117 | CONSTANT CFG_CLK_NOFB : INTEGER := 0; | |
118 | CONSTANT CFG_CLK_NOFB : INTEGER := 0; |
|
118 | -- LEON3 processor core | |
119 | -- LEON3 processor core |
|
119 | CONSTANT CFG_LEON3 : INTEGER := 1; | |
120 |
CONSTANT CFG_ |
|
120 | CONSTANT CFG_NCPU : INTEGER := NB_CPU; | |
121 | CONSTANT CFG_NCPU : INTEGER := NB_CPU; |
|
121 | CONSTANT CFG_NWIN : INTEGER := (8); -- to be compatible with BCC and RCC | |
122 | CONSTANT CFG_NWIN : INTEGER := (8); -- to be compatible with BCC and RCC |
|
122 | CONSTANT CFG_V8 : INTEGER := 0; | |
123 |
CONSTANT CFG_ |
|
123 | CONSTANT CFG_MAC : INTEGER := 0; | |
124 |
CONSTANT CFG_ |
|
124 | CONSTANT CFG_SVT : INTEGER := 0; | |
125 |
CONSTANT CFG_ |
|
125 | CONSTANT CFG_RSTADDR : INTEGER := 16#00000#; | |
126 |
CONSTANT CFG_ |
|
126 | CONSTANT CFG_LDDEL : INTEGER := (1); | |
127 |
CONSTANT CFG_ |
|
127 | CONSTANT CFG_NWP : INTEGER := (0); | |
128 |
CONSTANT CFG_ |
|
128 | CONSTANT CFG_PWD : INTEGER := 1*2; | |
129 |
CONSTANT CFG_ |
|
129 | CONSTANT CFG_FPU : INTEGER := ENABLE_FPU *(8 + 16 * FPU_NETLIST); | |
130 | CONSTANT CFG_FPU : INTEGER := ENABLE_FPU *(8 + 16 * FPU_NETLIST); |
|
130 | -- 1*(8 + 16 * 0) => grfpu-light | |
131 |
-- 1*(8 + 16 * |
|
131 | -- 1*(8 + 16 * 1) => netlist | |
132 |
-- |
|
132 | -- 0*(8 + 16 * 0) => No FPU | |
133 |
-- 0*(8 + 16 * |
|
133 | -- 0*(8 + 16 * 1) => No FPU; | |
134 | -- 0*(8 + 16 * 1) => No FPU; |
|
134 | CONSTANT CFG_ICEN : INTEGER := 1; | |
135 |
CONSTANT CFG_I |
|
135 | CONSTANT CFG_ISETS : INTEGER := 1; | |
136 |
CONSTANT CFG_ISETS |
|
136 | CONSTANT CFG_ISETSZ : INTEGER := 4; | |
137 |
CONSTANT CFG_I |
|
137 | CONSTANT CFG_ILINE : INTEGER := 4; | |
138 |
CONSTANT CFG_I |
|
138 | CONSTANT CFG_IREPL : INTEGER := 0; | |
139 |
CONSTANT CFG_I |
|
139 | CONSTANT CFG_ILOCK : INTEGER := 0; | |
140 |
CONSTANT CFG_IL |
|
140 | CONSTANT CFG_ILRAMEN : INTEGER := 0; | |
141 |
CONSTANT CFG_ILRAM |
|
141 | CONSTANT CFG_ILRAMADDR : INTEGER := 16#8E#; | |
142 |
CONSTANT CFG_ILRAM |
|
142 | CONSTANT CFG_ILRAMSZ : INTEGER := 1; | |
143 |
CONSTANT CFG_ |
|
143 | CONSTANT CFG_DCEN : INTEGER := 1; | |
144 |
CONSTANT CFG_D |
|
144 | CONSTANT CFG_DSETS : INTEGER := 1; | |
145 |
CONSTANT CFG_DSETS |
|
145 | CONSTANT CFG_DSETSZ : INTEGER := 4; | |
146 |
CONSTANT CFG_D |
|
146 | CONSTANT CFG_DLINE : INTEGER := 4; | |
147 |
CONSTANT CFG_D |
|
147 | CONSTANT CFG_DREPL : INTEGER := 0; | |
148 |
CONSTANT CFG_D |
|
148 | CONSTANT CFG_DLOCK : INTEGER := 0; | |
149 |
CONSTANT CFG_D |
|
149 | CONSTANT CFG_DSNOOP : INTEGER := 0 + 0 + 4*0; | |
150 |
CONSTANT CFG_D |
|
150 | CONSTANT CFG_DLRAMEN : INTEGER := 0; | |
151 |
CONSTANT CFG_DLRAM |
|
151 | CONSTANT CFG_DLRAMADDR : INTEGER := 16#8F#; | |
152 |
CONSTANT CFG_DLRAM |
|
152 | CONSTANT CFG_DLRAMSZ : INTEGER := 1; | |
153 |
CONSTANT CFG_ |
|
153 | CONSTANT CFG_MMUEN : INTEGER := 0; | |
154 |
CONSTANT CFG_ |
|
154 | CONSTANT CFG_ITLBNUM : INTEGER := 2; | |
155 |
CONSTANT CFG_ |
|
155 | CONSTANT CFG_DTLBNUM : INTEGER := 2; | |
156 |
CONSTANT CFG_ |
|
156 | CONSTANT CFG_TLB_TYPE : INTEGER := 1 + 0*2; | |
157 |
CONSTANT CFG_TLB_ |
|
157 | CONSTANT CFG_TLB_REP : INTEGER := 1; | |
158 | CONSTANT CFG_TLB_REP : INTEGER := 1; |
|
158 | ||
159 |
|
159 | CONSTANT CFG_DSU : INTEGER := ENABLE_DSU; | ||
160 |
CONSTANT CFG_ |
|
160 | CONSTANT CFG_ITBSZ : INTEGER := 0; | |
161 |
CONSTANT CFG_ |
|
161 | CONSTANT CFG_ATBSZ : INTEGER := 0; | |
162 | CONSTANT CFG_ATBSZ : INTEGER := 0; |
|
162 | ||
163 |
|
163 | -- AMBA settings | ||
164 | -- AMBA settings |
|
164 | CONSTANT CFG_DEFMST : INTEGER := (0); | |
165 |
CONSTANT CFG_ |
|
165 | CONSTANT CFG_RROBIN : INTEGER := 1; | |
166 |
CONSTANT CFG_ |
|
166 | CONSTANT CFG_SPLIT : INTEGER := 0; | |
167 |
CONSTANT CFG_ |
|
167 | CONSTANT CFG_AHBIO : INTEGER := 16#FFF#; | |
168 |
CONSTANT CFG_A |
|
168 | CONSTANT CFG_APBADDR : INTEGER := 16#800#; | |
169 | CONSTANT CFG_APBADDR : INTEGER := 16#800#; |
|
169 | ||
170 |
|
170 | -- DSU UART | ||
171 | -- DSU UART |
|
171 | CONSTANT CFG_AHB_UART : INTEGER := ENABLE_AHB_UART; | |
172 | CONSTANT CFG_AHB_UART : INTEGER := ENABLE_AHB_UART; |
|
172 | ||
173 |
|
173 | -- LEON2 memory controller | ||
174 | -- LEON2 memory controller |
|
174 | CONSTANT CFG_MCTRL_SDEN : INTEGER := 0; | |
175 | CONSTANT CFG_MCTRL_SDEN : INTEGER := 0; |
|
175 | ||
176 |
|
176 | -- UART 1 | ||
177 | -- UART 1 |
|
177 | CONSTANT CFG_UART1_ENABLE : INTEGER := ENABLE_APB_UART; | |
178 |
CONSTANT CFG_UART1_ |
|
178 | CONSTANT CFG_UART1_FIFO : INTEGER := 1; | |
179 | CONSTANT CFG_UART1_FIFO : INTEGER := 1; |
|
179 | ||
180 |
|
180 | -- LEON3 interrupt controller | ||
181 | -- LEON3 interrupt controller |
|
181 | CONSTANT CFG_IRQ3_ENABLE : INTEGER := ENABLE_IRQMP; | |
182 | CONSTANT CFG_IRQ3_ENABLE : INTEGER := ENABLE_IRQMP; |
|
182 | ||
183 |
|
183 | -- Modular timer | ||
184 | -- Modular timer |
|
184 | CONSTANT CFG_GPT_ENABLE : INTEGER := ENABLE_GPT; | |
185 |
CONSTANT CFG_GPT_ |
|
185 | CONSTANT CFG_GPT_NTIM : INTEGER := (2); | |
186 |
CONSTANT CFG_GPT_ |
|
186 | CONSTANT CFG_GPT_SW : INTEGER := (8); | |
187 |
CONSTANT CFG_GPT_ |
|
187 | CONSTANT CFG_GPT_TW : INTEGER := (32); | |
188 |
CONSTANT CFG_GPT_ |
|
188 | CONSTANT CFG_GPT_IRQ : INTEGER := (8); | |
189 |
CONSTANT CFG_GPT_IRQ |
|
189 | CONSTANT CFG_GPT_SEPIRQ : INTEGER := 1; | |
190 |
CONSTANT CFG_GPT_ |
|
190 | CONSTANT CFG_GPT_WDOGEN : INTEGER := 0; | |
191 |
CONSTANT CFG_GPT_WDOG |
|
191 | CONSTANT CFG_GPT_WDOG : INTEGER := 16#0#; | |
192 | CONSTANT CFG_GPT_WDOG : INTEGER := 16#0#; |
|
192 | ----------------------------------------------------------------------------- | |
193 | ----------------------------------------------------------------------------- |
|
193 | ||
194 |
|
194 | ----------------------------------------------------------------------------- | ||
195 | ----------------------------------------------------------------------------- |
|
195 | -- SIGNALs | |
196 | -- SIGNALs |
|
196 | ----------------------------------------------------------------------------- | |
197 | ----------------------------------------------------------------------------- |
|
197 | CONSTANT maxahbmsp : INTEGER := CFG_NCPU + CFG_AHB_UART + NB_AHB_MASTER; | |
198 | CONSTANT maxahbmsp : INTEGER := CFG_NCPU + CFG_AHB_UART + NB_AHB_MASTER; |
|
198 | -- CLK & RST -- | |
199 | -- CLK & RST -- |
|
199 | SIGNAL clk2x : STD_ULOGIC; | |
200 |
SIGNAL clk |
|
200 | SIGNAL clkmn : STD_ULOGIC; | |
201 |
SIGNAL clkm |
|
201 | SIGNAL clkm : STD_ULOGIC; | |
202 |
SIGNAL |
|
202 | SIGNAL rstn : STD_ULOGIC; | |
203 |
SIGNAL rst |
|
203 | SIGNAL rstraw : STD_ULOGIC; | |
204 |
SIGNAL |
|
204 | SIGNAL pciclk : STD_ULOGIC; | |
205 |
SIGNAL |
|
205 | SIGNAL sdclkl : STD_ULOGIC; | |
206 | SIGNAL sdclkl : STD_ULOGIC; |
|
206 | SIGNAL cgi : clkgen_in_type; | |
207 |
SIGNAL cg |
|
207 | SIGNAL cgo : clkgen_out_type; | |
208 | SIGNAL cgo : clkgen_out_type; |
|
208 | --- AHB / APB | |
209 | --- AHB / APB |
|
209 | SIGNAL apbi : apb_slv_in_type; | |
210 |
SIGNAL apb |
|
210 | SIGNAL apbo : apb_slv_out_vector := (OTHERS => apb_none); | |
211 | SIGNAL apbo : apb_slv_out_vector := (OTHERS => apb_none); |
|
211 | SIGNAL ahbsi : ahb_slv_in_type; | |
212 |
SIGNAL ahbs |
|
212 | SIGNAL ahbso : ahb_slv_out_vector := (OTHERS => ahbs_none); | |
213 | SIGNAL ahbso : ahb_slv_out_vector := (OTHERS => ahbs_none); |
|
213 | SIGNAL ahbmi : ahb_mst_in_type; | |
214 |
SIGNAL ahbm |
|
214 | SIGNAL ahbmo : ahb_mst_out_vector := (OTHERS => ahbm_none); | |
215 | SIGNAL ahbmo : ahb_mst_out_vector := (OTHERS => ahbm_none); |
|
215 | --UART | |
216 | --UART |
|
216 | SIGNAL ahbuarti : uart_in_type; | |
217 |
SIGNAL ahbuart |
|
217 | SIGNAL ahbuarto : uart_out_type; | |
218 |
SIGNAL a |
|
218 | SIGNAL apbuarti : uart_in_type; | |
219 |
SIGNAL apbuart |
|
219 | SIGNAL apbuarto : uart_out_type; | |
220 | SIGNAL apbuarto : uart_out_type; |
|
220 | --MEM CTRLR | |
221 | --MEM CTRLR |
|
221 | SIGNAL memi : memory_in_type; | |
222 |
SIGNAL mem |
|
222 | SIGNAL memo : memory_out_type; | |
223 |
SIGNAL |
|
223 | SIGNAL wpo : wprot_out_type; | |
224 |
SIGNAL |
|
224 | SIGNAL sdo : sdram_out_type; | |
225 | SIGNAL sdo : sdram_out_type; |
|
225 | --IRQ | |
226 | --IRQ |
|
226 | SIGNAL irqi : irq_in_vector(0 TO CFG_NCPU-1); | |
227 |
SIGNAL irq |
|
227 | SIGNAL irqo : irq_out_vector(0 TO CFG_NCPU-1); | |
228 | SIGNAL irqo : irq_out_vector(0 TO CFG_NCPU-1); |
|
228 | --Timer | |
229 | --Timer |
|
229 | SIGNAL gpti : gptimer_in_type; | |
230 |
SIGNAL gpt |
|
230 | SIGNAL gpto : gptimer_out_type; | |
231 | SIGNAL gpto : gptimer_out_type; |
|
231 | --DSU | |
232 | --DSU |
|
232 | SIGNAL dbgi : l3_debug_in_vector(0 TO CFG_NCPU-1); | |
233 |
SIGNAL dbg |
|
233 | SIGNAL dbgo : l3_debug_out_vector(0 TO CFG_NCPU-1); | |
234 | SIGNAL dbgo : l3_debug_out_vector(0 TO CFG_NCPU-1); |
|
234 | SIGNAL dsui : dsu_in_type; | |
235 |
SIGNAL dsu |
|
235 | SIGNAL dsuo : dsu_out_type; | |
236 | SIGNAL dsuo : dsu_out_type; |
|
236 | ----------------------------------------------------------------------------- | |
237 | ----------------------------------------------------------------------------- |
|
237 | ||
238 |
|
238 | SIGNAL nSRAM_CE_s : STD_LOGIC; | ||
239 | SIGNAL nSRAM_CE_s : STD_LOGIC; |
|
239 | BEGIN | |
240 | BEGIN |
|
240 | ||
241 |
|
241 | |||
242 |
|
242 | ---------------------------------------------------------------------- | ||
243 | ---------------------------------------------------------------------- |
|
243 | --- Reset and Clock generation ------------------------------------- | |
244 | --- Reset and Clock generation ------------------------------------- |
|
244 | ---------------------------------------------------------------------- | |
245 | ---------------------------------------------------------------------- |
|
245 | ||
246 |
|
246 | cgi.pllctrl <= "00"; | ||
247 |
cgi.pll |
|
247 | cgi.pllrst <= rstraw; | |
248 | cgi.pllrst <= rstraw; |
|
248 | ||
249 |
|
249 | rst0 : rstgen PORT MAP (reset, clkm, cgo.clklock, rstn, rstraw); | ||
250 | rst0 : rstgen PORT MAP (reset, clkm, cgo.clklock, rstn, rstraw); |
|
250 | ||
251 |
|
251 | clkgen0 : clkgen -- clock generator | ||
252 | clkgen0 : clkgen -- clock generator |
|
252 | GENERIC MAP (clktech, CFG_CLKMUL, CFG_CLKDIV, CFG_MCTRL_SDEN, | |
253 | GENERIC MAP (clktech, CFG_CLKMUL, CFG_CLKDIV, CFG_MCTRL_SDEN, |
|
253 | CFG_CLK_NOFB, 0, 0, 0, clk_freq, 0, 0, CFG_OCLKDIV) | |
254 | CFG_CLK_NOFB, 0, 0, 0, clk_freq, 0, 0, CFG_OCLKDIV) |
|
254 | PORT MAP (clk, clk, clkm, clkmn, clk2x, sdclkl, pciclk, cgi, cgo); | |
255 | PORT MAP (clk, clk, clkm, clkmn, clk2x, sdclkl, pciclk, cgi, cgo); |
|
255 | ||
256 |
|
256 | ---------------------------------------------------------------------- | ||
257 | ---------------------------------------------------------------------- |
|
257 | --- LEON3 processor / DSU / IRQ ------------------------------------ | |
258 | --- LEON3 processor / DSU / IRQ ------------------------------------ |
|
258 | ---------------------------------------------------------------------- | |
259 | ---------------------------------------------------------------------- |
|
259 | ||
260 |
|
260 | l3 : IF CFG_LEON3 = 1 GENERATE | ||
261 | l3 : IF CFG_LEON3 = 1 GENERATE |
|
261 | cpu : FOR i IN 0 TO CFG_NCPU-1 GENERATE | |
262 | cpu : FOR i IN 0 TO CFG_NCPU-1 GENERATE |
|
262 | u0 : leon3ft | |
263 | u0 : leon3ft |
|
263 | GENERIC MAP ( | |
264 | GENERIC MAP ( |
|
264 | hindex => i, --: integer; | |
265 | hindex => i, --: integer; |
|
265 | fabtech => fabtech, | |
266 |
|
|
266 | memtech => memtech, | |
267 | memtech => memtech, |
|
267 | nwindows => CFG_NWIN, | |
268 |
|
|
268 | dsu => CFG_DSU, | |
269 |
|
|
269 | fpu => CFG_FPU, | |
270 |
|
|
270 | v8 => CFG_V8, | |
271 |
|
|
271 | cp => 0, | |
272 |
c |
|
272 | mac => CFG_MAC, | |
273 |
|
|
273 | pclow => pclow, | |
274 |
|
|
274 | notag => 0, | |
275 |
|
|
275 | nwp => CFG_NWP, | |
276 |
n |
|
276 | icen => CFG_ICEN, | |
277 |
i |
|
277 | irepl => CFG_IREPL, | |
278 |
i |
|
278 | isets => CFG_ISETS, | |
279 |
i |
|
279 | ilinesize => CFG_ILINE, | |
280 |
i |
|
280 | isetsize => CFG_ISETSZ, | |
281 |
|
|
281 | isetlock => CFG_ILOCK, | |
282 |
|
|
282 | dcen => CFG_DCEN, | |
283 |
d |
|
283 | drepl => CFG_DREPL, | |
284 |
d |
|
284 | dsets => CFG_DSETS, | |
285 |
d |
|
285 | dlinesize => CFG_DLINE, | |
286 |
d |
|
286 | dsetsize => CFG_DSETSZ, | |
287 |
dset |
|
287 | dsetlock => CFG_DLOCK, | |
288 |
ds |
|
288 | dsnoop => CFG_DSNOOP, | |
289 |
|
|
289 | ilram => CFG_ILRAMEN, | |
290 |
ilram |
|
290 | ilramsize => CFG_ILRAMSZ, | |
291 |
ilrams |
|
291 | ilramstart => CFG_ILRAMADDR, | |
292 |
|
|
292 | dlram => CFG_DLRAMEN, | |
293 |
dlram |
|
293 | dlramsize => CFG_DLRAMSZ, | |
294 |
dlrams |
|
294 | dlramstart => CFG_DLRAMADDR, | |
295 | dlramstart => CFG_DLRAMADDR, |
|
295 | mmuen => CFG_MMUEN, | |
296 |
|
|
296 | itlbnum => CFG_ITLBNUM, | |
297 |
|
|
297 | dtlbnum => CFG_DTLBNUM, | |
298 |
|
|
298 | tlb_type => CFG_TLB_TYPE, | |
299 |
tlb_ |
|
299 | tlb_rep => CFG_TLB_REP, | |
300 |
|
|
300 | lddel => CFG_LDDEL, | |
301 |
|
|
301 | disas => disas, | |
302 |
|
|
302 | tbuf => CFG_ITBSZ, | |
303 |
|
|
303 | pwd => CFG_PWD, | |
304 |
|
|
304 | svt => CFG_SVT, | |
305 |
|
|
305 | rstaddr => CFG_RSTADDR, | |
306 |
|
|
306 | smp => CFG_NCPU-1, | |
307 | smp => CFG_NCPU-1, |
|
307 | iuft => 2, --: integer range 0 to 4; | |
308 |
|
|
308 | fpft => 1, --: integer range 0 to 4; | |
309 |
|
|
309 | cmft => 1, --: integer range 0 to 1; | |
310 |
|
|
310 | iuinj => 0, --: integer; | |
311 |
|
|
311 | ceinj => 0, --: integer range 0 to 3; | |
312 |
c |
|
312 | cached => 0, --: integer; | |
313 |
|
|
313 | netlist => 0, --: integer; | |
314 |
|
|
314 | scantest => 0, --: integer; | |
315 |
|
|
315 | mmupgsz => 0, --: integer range 0 to 5; | |
316 |
|
|
316 | bp => 1) --: integer); | |
317 | bp => 1) --: integer); |
|
317 | PORT MAP ( | |
318 | PORT MAP ( |
|
318 | clk => clkm, | |
319 |
|
|
319 | rstn => rstn, | |
320 |
|
|
320 | ahbi => ahbmi, | |
321 |
ahb |
|
321 | ahbo => ahbmo(i), | |
322 |
ahb |
|
322 | ahbsi => ahbsi, | |
323 |
ahbs |
|
323 | ahbso => ahbso, | |
324 | ahbso => ahbso, |
|
324 | irqi => irqi(i), | |
325 |
irq |
|
325 | irqo => irqo(i), | |
326 |
i |
|
326 | dbgi => dbgi(i), | |
327 |
dbg |
|
327 | dbgo => dbgo(i), | |
328 |
|
|
328 | gclk => clkm | |
329 |
|
|
329 | ); | |
330 |
|
|
330 | ||
331 |
|
331 | END GENERATE; | ||
332 | END GENERATE; |
|
332 | ||
333 |
|
333 | |||
334 |
|
334 | errorn_pad : outpad GENERIC MAP (tech => padtech) PORT MAP (errorn, dbgo(0).error); | ||
335 | errorn_pad : outpad GENERIC MAP (tech => padtech) PORT MAP (errorn, dbgo(0).error); |
|
335 | ||
336 |
|
336 | dsugen : IF CFG_DSU = 1 GENERATE | ||
337 | dsugen : IF CFG_DSU = 1 GENERATE |
|
337 | dsu0 : dsu3 -- LEON3 Debug Support Unit | |
338 | dsu0 : dsu3 -- LEON3 Debug Support Unit |
|
338 | GENERIC MAP (hindex => 2, haddr => 16#900#, hmask => 16#F00#, | |
339 | GENERIC MAP (hindex => 2, haddr => 16#900#, hmask => 16#F00#, |
|
339 | ncpu => CFG_NCPU, tbits => 30, tech => memtech, irq => 0, kbytes => CFG_ATBSZ) | |
340 | ncpu => CFG_NCPU, tbits => 30, tech => memtech, irq => 0, kbytes => CFG_ATBSZ) |
|
340 | PORT MAP (rstn, clkm, ahbmi, ahbsi, ahbso(2), dbgo, dbgi, dsui, dsuo); | |
341 | PORT MAP (rstn, clkm, ahbmi, ahbsi, ahbso(2), dbgo, dbgi, dsui, dsuo); |
|
341 | dsui.enable <= '1'; | |
342 |
dsui. |
|
342 | dsui.break <= '0'; | |
343 | dsui.break <= '0'; |
|
343 | END GENERATE; | |
344 |
|
|
344 | END GENERATE; | |
345 | END GENERATE; |
|
345 | ||
346 |
|
346 | nodsu : IF CFG_DSU = 0 GENERATE | ||
347 | nodsu : IF CFG_DSU = 0 GENERATE |
|
347 | ahbso(2) <= ahbs_none; | |
348 | ahbso(2) <= ahbs_none; |
|
348 | dsuo.tstop <= '0'; | |
349 |
dsuo. |
|
349 | dsuo.active <= '0'; | |
350 | dsuo.active <= '0'; |
|
350 | END GENERATE; | |
351 | END GENERATE; |
|
351 | ||
352 |
|
352 | irqctrl : IF CFG_IRQ3_ENABLE /= 0 GENERATE | ||
353 | irqctrl : IF CFG_IRQ3_ENABLE /= 0 GENERATE |
|
353 | irqctrl0 : irqmp -- interrupt controller | |
354 | irqctrl0 : irqmp -- interrupt controller |
|
354 | GENERIC MAP (pindex => 2, paddr => 2, ncpu => CFG_NCPU) | |
355 | GENERIC MAP (pindex => 2, paddr => 2, ncpu => CFG_NCPU) |
|
355 | PORT MAP (rstn, clkm, apbi, apbo(2), irqo, irqi); | |
356 | PORT MAP (rstn, clkm, apbi, apbo(2), irqo, irqi); |
|
356 | END GENERATE; | |
357 | END GENERATE; |
|
357 | irq3 : IF CFG_IRQ3_ENABLE = 0 GENERATE | |
358 | irq3 : IF CFG_IRQ3_ENABLE = 0 GENERATE |
|
358 | x : FOR i IN 0 TO CFG_NCPU-1 GENERATE | |
359 | x : FOR i IN 0 TO CFG_NCPU-1 GENERATE |
|
359 | irqi(i).irl <= "0000"; | |
360 | irqi(i).irl <= "0000"; |
|
360 | END GENERATE; | |
361 | END GENERATE; |
|
361 | apbo(2) <= apb_none; | |
362 | apbo(2) <= apb_none; |
|
362 | END GENERATE; | |
363 | END GENERATE; |
|
363 | ||
364 |
|
364 | ---------------------------------------------------------------------- | ||
365 |
--- |
|
365 | --- Memory controllers --------------------------------------------- | |
366 |
--- |
|
366 | ---------------------------------------------------------------------- | |
367 | ---------------------------------------------------------------------- |
|
367 | memctrlr : mctrl GENERIC MAP ( | |
368 | memctrlr : mctrl GENERIC MAP ( |
|
368 | hindex => 0, | |
369 |
|
|
369 | pindex => 0, | |
370 |
p |
|
370 | paddr => 0, | |
371 | paddr => 0, |
|
371 | srbanks => 1 | |
372 | srbanks => 1 |
|
372 | ) | |
373 | ) |
|
373 | PORT MAP (rstn, clkm, memi, memo, ahbsi, ahbso(0), apbi, apbo(0), wpo, sdo); | |
374 | PORT MAP (rstn, clkm, memi, memo, ahbsi, ahbso(0), apbi, apbo(0), wpo, sdo); |
|
374 | ||
375 |
|
375 | memi.brdyn <= '1'; | ||
376 |
memi.b |
|
376 | memi.bexcn <= '1'; | |
377 |
memi. |
|
377 | memi.writen <= '1'; | |
378 |
memi.wr |
|
378 | memi.wrn <= "1111"; | |
379 |
memi. |
|
379 | memi.bwidth <= "10"; | |
380 | memi.bwidth <= "10"; |
|
380 | ||
381 |
|
381 | bdr : FOR i IN 0 TO 3 GENERATE | ||
382 | bdr : FOR i IN 0 TO 3 GENERATE |
|
382 | data_pad : iopadv GENERIC MAP (tech => padtech, width => 8) | |
383 | data_pad : iopadv GENERIC MAP (tech => padtech, width => 8) |
|
383 | PORT MAP ( | |
384 | PORT MAP ( |
|
384 | data(31-i*8 DOWNTO 24-i*8), | |
385 | data(31-i*8 DOWNTO 24-i*8), |
|
385 | memo.data(31-i*8 DOWNTO 24-i*8), | |
386 | memo.data(31-i*8 DOWNTO 24-i*8), |
|
386 | memo.bdrive(i), | |
387 | memo.bdrive(i), |
|
387 | memi.data(31-i*8 DOWNTO 24-i*8)); | |
388 | memi.data(31-i*8 DOWNTO 24-i*8)); |
|
388 | END GENERATE; | |
389 | END GENERATE; |
|
389 | ||
390 |
|
390 | addr_pad : outpadv GENERIC MAP (width => 20, tech => padtech) | ||
391 | addr_pad : outpadv GENERIC MAP (width => 20, tech => padtech) |
|
391 | PORT MAP (address, memo.address(21 DOWNTO 2)); | |
392 | PORT MAP (address, memo.address(21 DOWNTO 2)); |
|
392 | nSRAM_CE_s <= NOT(memo.ramsn(0)); | |
393 | nSRAM_CE_s <= NOT(memo.ramsn(0)); |
|
393 | rams_pad : outpad GENERIC MAP (tech => padtech) PORT MAP (nSRAM_CE, nSRAM_CE_s); | |
394 |
|
|
394 | oen_pad : outpad GENERIC MAP (tech => padtech) PORT MAP (nSRAM_OE, memo.ramoen(0)); | |
395 |
|
|
395 | nBWE_pad : outpad GENERIC MAP (tech => padtech) PORT MAP (nSRAM_WE, memo.writen); | |
396 |
nBW |
|
396 | nBWa_pad : outpad GENERIC MAP (tech => padtech) PORT MAP (nSRAM_BE0, memo.mben(3)); | |
397 |
nBW |
|
397 | nBWb_pad : outpad GENERIC MAP (tech => padtech) PORT MAP (nSRAM_BE1, memo.mben(2)); | |
398 |
nBW |
|
398 | nBWc_pad : outpad GENERIC MAP (tech => padtech) PORT MAP (nSRAM_BE2, memo.mben(1)); | |
399 |
nBW |
|
399 | nBWd_pad : outpad GENERIC MAP (tech => padtech) PORT MAP (nSRAM_BE3, memo.mben(0)); | |
400 | nBWd_pad : outpad GENERIC MAP (tech => padtech) PORT MAP (nSRAM_BE3, memo.mben(0)); |
|
400 | ||
401 |
|
401 | ---------------------------------------------------------------------- | ||
402 |
--- |
|
402 | --- AHB CONTROLLER ------------------------------------------------- | |
403 |
--- |
|
403 | ---------------------------------------------------------------------- | |
404 | ---------------------------------------------------------------------- |
|
404 | ahb0 : ahbctrl -- AHB arbiter/multiplexer | |
405 | ahb0 : ahbctrl -- AHB arbiter/multiplexer |
|
405 | GENERIC MAP (defmast => CFG_DEFMST, split => CFG_SPLIT, | |
406 | GENERIC MAP (defmast => CFG_DEFMST, split => CFG_SPLIT, |
|
406 | rrobin => CFG_RROBIN, ioaddr => CFG_AHBIO, | |
407 | rrobin => CFG_RROBIN, ioaddr => CFG_AHBIO, |
|
407 | ioen => 0, nahbm => maxahbmsp, nahbs => 8) | |
408 | ioen => 0, nahbm => maxahbmsp, nahbs => 8) |
|
408 | PORT MAP (rstn, clkm, ahbmi, ahbmo, ahbsi, ahbso); | |
409 | PORT MAP (rstn, clkm, ahbmi, ahbmo, ahbsi, ahbso); |
|
409 | ||
410 |
|
410 | ---------------------------------------------------------------------- | ||
411 |
--- |
|
411 | --- AHB UART ------------------------------------------------------- | |
412 |
--- |
|
412 | ---------------------------------------------------------------------- | |
413 | ---------------------------------------------------------------------- |
|
413 | dcomgen : IF CFG_AHB_UART = 1 GENERATE | |
414 | dcomgen : IF CFG_AHB_UART = 1 GENERATE |
|
414 | dcom0 : ahbuart | |
415 | dcom0 : ahbuart |
|
415 | GENERIC MAP (hindex => maxahbmsp-1, pindex => 4, paddr => 4) | |
416 | GENERIC MAP (hindex => maxahbmsp-1, pindex => 4, paddr => 4) |
|
416 | PORT MAP (rstn, clkm, ahbuarti, ahbuarto, apbi, apbo(4), ahbmi, ahbmo(maxahbmsp-1)); | |
417 | PORT MAP (rstn, clkm, ahbuarti, ahbuarto, apbi, apbo(4), ahbmi, ahbmo(maxahbmsp-1)); |
|
417 | dsurx_pad : inpad GENERIC MAP (tech => padtech) PORT MAP (ahbrxd, ahbuarti.rxd); | |
418 |
dsu |
|
418 | dsutx_pad : outpad GENERIC MAP (tech => padtech) PORT MAP (ahbtxd, ahbuarto.txd); | |
419 | dsutx_pad : outpad GENERIC MAP (tech => padtech) PORT MAP (ahbtxd, ahbuarto.txd); |
|
419 | END GENERATE; | |
420 | END GENERATE; |
|
420 | nouah : IF CFG_AHB_UART = 0 GENERATE apbo(4) <= apb_none; END GENERATE; | |
421 | nouah : IF CFG_AHB_UART = 0 GENERATE apbo(4) <= apb_none; END GENERATE; |
|
421 | ||
422 |
|
422 | ---------------------------------------------------------------------- | ||
423 |
--- |
|
423 | --- APB Bridge ----------------------------------------------------- | |
424 |
--- |
|
424 | ---------------------------------------------------------------------- | |
425 | ---------------------------------------------------------------------- |
|
425 | apb0 : apbctrl -- AHB/APB bridge | |
426 | apb0 : apbctrl -- AHB/APB bridge |
|
426 | GENERIC MAP (hindex => 1, haddr => CFG_APBADDR) | |
427 | GENERIC MAP (hindex => 1, haddr => CFG_APBADDR) |
|
427 | PORT MAP (rstn, clkm, ahbsi, ahbso(1), apbi, apbo); | |
428 | PORT MAP (rstn, clkm, ahbsi, ahbso(1), apbi, apbo); |
|
428 | ||
429 |
|
429 | ---------------------------------------------------------------------- | ||
430 |
--- |
|
430 | --- GPT Timer ------------------------------------------------------ | |
431 |
--- |
|
431 | ---------------------------------------------------------------------- | |
432 | ---------------------------------------------------------------------- |
|
432 | gpt : IF CFG_GPT_ENABLE /= 0 GENERATE | |
433 | gpt : IF CFG_GPT_ENABLE /= 0 GENERATE |
|
433 | timer0 : gptimer -- timer unit | |
434 | timer0 : gptimer -- timer unit |
|
434 | GENERIC MAP (pindex => 3, paddr => 3, pirq => CFG_GPT_IRQ, | |
435 | GENERIC MAP (pindex => 3, paddr => 3, pirq => CFG_GPT_IRQ, |
|
435 | sepirq => CFG_GPT_SEPIRQ, sbits => CFG_GPT_SW, ntimers => CFG_GPT_NTIM, | |
436 | sepirq => CFG_GPT_SEPIRQ, sbits => CFG_GPT_SW, ntimers => CFG_GPT_NTIM, |
|
436 | nbits => CFG_GPT_TW) | |
437 | nbits => CFG_GPT_TW) |
|
437 | PORT MAP (rstn, clkm, apbi, apbo(3), gpti, gpto); | |
438 | PORT MAP (rstn, clkm, apbi, apbo(3), gpti, gpto); |
|
438 | gpti.dhalt <= dsuo.tstop; | |
439 | gpti.dhalt <= dsuo.tstop; |
|
439 | gpti.extclk <= '0'; | |
440 | gpti.extclk <= '0'; |
|
440 | END GENERATE; | |
441 | END GENERATE; |
|
441 | notim : IF CFG_GPT_ENABLE = 0 GENERATE apbo(3) <= apb_none; END GENERATE; | |
442 | notim : IF CFG_GPT_ENABLE = 0 GENERATE apbo(3) <= apb_none; END GENERATE; |
|
442 | ||
443 |
|
443 | |||
444 |
|
444 | ---------------------------------------------------------------------- | ||
445 |
--- |
|
445 | --- APB UART ------------------------------------------------------- | |
446 |
--- |
|
446 | ---------------------------------------------------------------------- | |
447 | ---------------------------------------------------------------------- |
|
447 | ua1 : IF CFG_UART1_ENABLE /= 0 GENERATE | |
448 | ua1 : IF CFG_UART1_ENABLE /= 0 GENERATE |
|
448 | uart1 : apbuart -- UART 1 | |
449 | uart1 : apbuart -- UART 1 |
|
449 | GENERIC MAP (pindex => 1, paddr => 1, pirq => 2, console => dbguart, | |
450 | GENERIC MAP (pindex => 1, paddr => 1, pirq => 2, console => dbguart, |
|
450 | fifosize => CFG_UART1_FIFO) | |
451 | fifosize => CFG_UART1_FIFO) |
|
451 | PORT MAP (rstn, clkm, apbi, apbo(1), apbuarti, apbuarto); | |
452 | PORT MAP (rstn, clkm, apbi, apbo(1), apbuarti, apbuarto); |
|
452 | apbuarti.rxd <= urxd1; | |
453 |
apbuarti. |
|
453 | apbuarti.extclk <= '0'; | |
454 | apbuarti.extclk <= '0'; |
|
454 | utxd1 <= apbuarto.txd; | |
455 | utxd1 <= apbuarto.txd; |
|
455 | apbuarti.ctsn <= '0'; | |
456 | apbuarti.ctsn <= '0'; |
|
456 | END GENERATE; | |
457 | END GENERATE; |
|
457 | noua0 : IF CFG_UART1_ENABLE = 0 GENERATE apbo(1) <= apb_none; END GENERATE; | |
458 | noua0 : IF CFG_UART1_ENABLE = 0 GENERATE apbo(1) <= apb_none; END GENERATE; |
|
458 | ||
459 |
|
459 | ------------------------------------------------------------------------------- | ||
460 |
-- |
|
460 | -- AMBA BUS ------------------------------------------------------------------- | |
461 |
-- |
|
461 | ------------------------------------------------------------------------------- | |
462 | ------------------------------------------------------------------------------- |
|
462 | ||
463 |
|
463 | -- APB -------------------------------------------------------------------- | ||
464 | -- APB -------------------------------------------------------------------- |
|
464 | apbi_ext <= apbi; | |
465 | apbi_ext <= apbi; |
|
465 | all_apb : FOR I IN 0 TO NB_APB_SLAVE-1 GENERATE | |
466 |
|
|
466 | max_16_apb : IF I + 5 < 16 GENERATE | |
467 | max_16_apb : IF I + 5 < 16 GENERATE |
|
467 | apbo(I+5) <= apbo_ext(I+5); | |
468 | apbo(I+5) <= apbo_ext(I+5); |
|
468 | END GENERATE max_16_apb; | |
469 |
|
|
469 | END GENERATE all_apb; | |
470 | END GENERATE all_apb; |
|
470 | -- AHB_Slave -------------------------------------------------------------- | |
471 | -- AHB_Slave -------------------------------------------------------------- |
|
471 | ahbi_s_ext <= ahbsi; | |
472 | ahbi_s_ext <= ahbsi; |
|
472 | all_ahbs : FOR I IN 0 TO NB_AHB_SLAVE-1 GENERATE | |
473 |
|
|
473 | max_16_ahbs : IF I + 3 < 16 GENERATE | |
474 | max_16_ahbs : IF I + 3 < 16 GENERATE |
|
474 | ahbso(I+3) <= ahbo_s_ext(I+3); | |
475 | ahbso(I+3) <= ahbo_s_ext(I+3); |
|
475 | END GENERATE max_16_ahbs; | |
476 |
|
|
476 | END GENERATE all_ahbs; | |
477 | END GENERATE all_ahbs; |
|
477 | -- AHB_Master ------------------------------------------------------------- | |
478 | -- AHB_Master ------------------------------------------------------------- |
|
478 | ahbi_m_ext <= ahbmi; | |
479 | ahbi_m_ext <= ahbmi; |
|
479 | all_ahbm : FOR I IN 0 TO NB_AHB_MASTER-1 GENERATE | |
480 |
|
|
480 | max_16_ahbm : IF I + CFG_NCPU + CFG_AHB_UART < 16 GENERATE | |
481 | max_16_ahbm : IF I + CFG_NCPU + CFG_AHB_UART < 16 GENERATE |
|
481 | ahbmo(I + CFG_NCPU) <= ahbo_m_ext(I+CFG_NCPU); | |
482 | ahbmo(I + CFG_NCPU) <= ahbo_m_ext(I+CFG_NCPU); |
|
482 | END GENERATE max_16_ahbm; | |
483 |
|
|
483 | END GENERATE all_ahbm; | |
484 | END GENERATE all_ahbm; |
|
484 | ||
485 |
|
485 | |||
486 |
|
486 | |||
487 |
|
487 | END Behavioral; No newline at end of file | ||
488 | END Behavioral; |
|
General Comments 0
You need to be logged in to leave comments.
Login now