@@ -1,198 +1,212 | |||||
1 | ------------------------------------------------------------------------------ |
|
1 | ------------------------------------------------------------------------------ | |
2 | -- This file is a part of the LPP VHDL IP LIBRARY |
|
2 | -- This file is a part of the LPP VHDL IP LIBRARY | |
3 | -- Copyright (C) 2009 - 2010, Laboratory of Plasmas Physic - CNRS |
|
3 | -- Copyright (C) 2009 - 2010, Laboratory of Plasmas Physic - CNRS | |
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 3 of the License, or |
|
7 | -- the Free Software Foundation; either version 3 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 | -- Author : Jean-christophe Pellion |
|
19 | -- Author : Jean-christophe Pellion | |
20 | -- Mail : jean-christophe.pellion@lpp.polytechnique.fr |
|
20 | -- Mail : jean-christophe.pellion@lpp.polytechnique.fr | |
21 | -- jean-christophe.pellion@easii-ic.com |
|
21 | -- jean-christophe.pellion@easii-ic.com | |
22 | ---------------------------------------------------------------------------- |
|
22 | ---------------------------------------------------------------------------- | |
23 | LIBRARY ieee; |
|
23 | LIBRARY ieee; | |
24 | USE ieee.std_logic_1164.ALL; |
|
24 | USE ieee.std_logic_1164.ALL; | |
25 | USE ieee.numeric_std.ALL; |
|
25 | USE ieee.numeric_std.ALL; | |
26 | LIBRARY grlib; |
|
26 | LIBRARY grlib; | |
27 | USE grlib.amba.ALL; |
|
27 | USE grlib.amba.ALL; | |
28 | USE grlib.stdlib.ALL; |
|
28 | USE grlib.stdlib.ALL; | |
29 | USE grlib.devices.ALL; |
|
29 | USE grlib.devices.ALL; | |
30 | LIBRARY lpp; |
|
30 | LIBRARY lpp; | |
31 | USE lpp.lpp_amba.ALL; |
|
31 | USE lpp.lpp_amba.ALL; | |
32 | USE lpp.apb_devices_list.ALL; |
|
32 | USE lpp.apb_devices_list.ALL; | |
33 | USE lpp.lpp_memory.ALL; |
|
33 | USE lpp.lpp_memory.ALL; | |
34 | LIBRARY techmap; |
|
34 | LIBRARY techmap; | |
35 | USE techmap.gencomp.ALL; |
|
35 | USE techmap.gencomp.ALL; | |
36 |
|
36 | |||
37 | ENTITY lpp_top_apbreg IS |
|
37 | ENTITY lpp_top_apbreg IS | |
38 | GENERIC ( |
|
38 | GENERIC ( | |
39 | pindex : INTEGER := 4; |
|
39 | pindex : INTEGER := 4; | |
40 | paddr : INTEGER := 4; |
|
40 | paddr : INTEGER := 4; | |
41 | pmask : INTEGER := 16#fff#; |
|
41 | pmask : INTEGER := 16#fff#; | |
42 | pirq : INTEGER := 0); |
|
42 | pirq : INTEGER := 0); | |
43 | PORT ( |
|
43 | PORT ( | |
44 | -- AMBA AHB system signals |
|
44 | -- AMBA AHB system signals | |
45 | HCLK : IN STD_ULOGIC; |
|
45 | HCLK : IN STD_ULOGIC; | |
46 | HRESETn : IN STD_ULOGIC; |
|
46 | HRESETn : IN STD_ULOGIC; | |
47 |
|
47 | |||
48 | -- AMBA APB Slave Interface |
|
48 | -- AMBA APB Slave Interface | |
49 | apbi : IN apb_slv_in_type; |
|
49 | apbi : IN apb_slv_in_type; | |
50 | apbo : OUT apb_slv_out_type; |
|
50 | apbo : OUT apb_slv_out_type; | |
51 |
|
51 | |||
52 | -- IN |
|
52 | -- IN | |
53 | ready_matrix_f0_0 : IN STD_LOGIC; |
|
53 | ready_matrix_f0_0 : IN STD_LOGIC; | |
54 | ready_matrix_f0_1 : IN STD_LOGIC; |
|
54 | ready_matrix_f0_1 : IN STD_LOGIC; | |
55 | ready_matrix_f1 : IN STD_LOGIC; |
|
55 | ready_matrix_f1 : IN STD_LOGIC; | |
56 | ready_matrix_f2 : IN STD_LOGIC; |
|
56 | ready_matrix_f2 : IN STD_LOGIC; | |
57 | error_anticipating_empty_fifo : IN STD_LOGIC; |
|
57 | error_anticipating_empty_fifo : IN STD_LOGIC; | |
58 | error_bad_component_error : IN STD_LOGIC; |
|
58 | error_bad_component_error : IN STD_LOGIC; | |
59 | debug_reg : IN STD_LOGIC_VECTOR(31 DOWNTO 0); |
|
59 | debug_reg : IN STD_LOGIC_VECTOR(31 DOWNTO 0); | |
60 |
|
60 | |||
61 | -- OUT |
|
61 | -- OUT | |
62 | status_ready_matrix_f0_0 : OUT STD_LOGIC; |
|
62 | status_ready_matrix_f0_0 : OUT STD_LOGIC; | |
63 | status_ready_matrix_f0_1 : OUT STD_LOGIC; |
|
63 | status_ready_matrix_f0_1 : OUT STD_LOGIC; | |
64 | status_ready_matrix_f1 : OUT STD_LOGIC; |
|
64 | status_ready_matrix_f1 : OUT STD_LOGIC; | |
65 | status_ready_matrix_f2 : OUT STD_LOGIC; |
|
65 | status_ready_matrix_f2 : OUT STD_LOGIC; | |
66 | status_error_anticipating_empty_fifo : OUT STD_LOGIC; |
|
66 | status_error_anticipating_empty_fifo : OUT STD_LOGIC; | |
67 | status_error_bad_component_error : OUT STD_LOGIC; |
|
67 | status_error_bad_component_error : OUT STD_LOGIC; | |
68 |
|
68 | |||
69 | config_active_interruption_onNewMatrix : OUT STD_LOGIC; |
|
69 | config_active_interruption_onNewMatrix : OUT STD_LOGIC; | |
70 | config_active_interruption_onError : OUT STD_LOGIC; |
|
70 | config_active_interruption_onError : OUT STD_LOGIC; | |
71 | addr_matrix_f0_0 : OUT STD_LOGIC_VECTOR(31 DOWNTO 0); |
|
71 | addr_matrix_f0_0 : OUT STD_LOGIC_VECTOR(31 DOWNTO 0); | |
72 | addr_matrix_f0_1 : OUT STD_LOGIC_VECTOR(31 DOWNTO 0); |
|
72 | addr_matrix_f0_1 : OUT STD_LOGIC_VECTOR(31 DOWNTO 0); | |
73 | addr_matrix_f1 : OUT STD_LOGIC_VECTOR(31 DOWNTO 0); |
|
73 | addr_matrix_f1 : OUT STD_LOGIC_VECTOR(31 DOWNTO 0); | |
74 | addr_matrix_f2 : OUT STD_LOGIC_VECTOR(31 DOWNTO 0) |
|
74 | addr_matrix_f2 : OUT STD_LOGIC_VECTOR(31 DOWNTO 0) | |
75 | ); |
|
75 | ); | |
76 |
|
76 | |||
77 | END lpp_top_apbreg; |
|
77 | END lpp_top_apbreg; | |
78 |
|
78 | |||
79 | ARCHITECTURE beh OF lpp_top_apbreg IS |
|
79 | ARCHITECTURE beh OF lpp_top_apbreg IS | |
80 |
|
80 | |||
81 | CONSTANT REVISION : INTEGER := 1; |
|
81 | CONSTANT REVISION : INTEGER := 1; | |
82 |
|
82 | |||
83 | CONSTANT pconfig : apb_config_type := ( |
|
83 | CONSTANT pconfig : apb_config_type := ( | |
84 | 0 => ahb_device_reg (VENDOR_LPP, LPP_DMA_TYPE, 0, REVISION, pirq), |
|
84 | 0 => ahb_device_reg (VENDOR_LPP, LPP_DMA_TYPE, 0, REVISION, pirq), | |
85 | 1 => apb_iobar(paddr, pmask)); |
|
85 | 1 => apb_iobar(paddr, pmask)); | |
86 |
|
86 | |||
87 | TYPE lpp_dma_regs IS RECORD |
|
87 | TYPE lpp_dma_regs IS RECORD | |
88 | config_active_interruption_onNewMatrix : STD_LOGIC; |
|
88 | config_active_interruption_onNewMatrix : STD_LOGIC; | |
89 | config_active_interruption_onError : STD_LOGIC; |
|
89 | config_active_interruption_onError : STD_LOGIC; | |
90 | status_ready_matrix_f0_0 : STD_LOGIC; |
|
90 | status_ready_matrix_f0_0 : STD_LOGIC; | |
91 | status_ready_matrix_f0_1 : STD_LOGIC; |
|
91 | status_ready_matrix_f0_1 : STD_LOGIC; | |
92 | status_ready_matrix_f1 : STD_LOGIC; |
|
92 | status_ready_matrix_f1 : STD_LOGIC; | |
93 | status_ready_matrix_f2 : STD_LOGIC; |
|
93 | status_ready_matrix_f2 : STD_LOGIC; | |
94 | status_error_anticipating_empty_fifo : STD_LOGIC; |
|
94 | status_error_anticipating_empty_fifo : STD_LOGIC; | |
95 | status_error_bad_component_error : STD_LOGIC; |
|
95 | status_error_bad_component_error : STD_LOGIC; | |
96 | addr_matrix_f0_0 : STD_LOGIC_VECTOR(31 DOWNTO 0); |
|
96 | addr_matrix_f0_0 : STD_LOGIC_VECTOR(31 DOWNTO 0); | |
97 | addr_matrix_f0_1 : STD_LOGIC_VECTOR(31 DOWNTO 0); |
|
97 | addr_matrix_f0_1 : STD_LOGIC_VECTOR(31 DOWNTO 0); | |
98 | addr_matrix_f1 : STD_LOGIC_VECTOR(31 DOWNTO 0); |
|
98 | addr_matrix_f1 : STD_LOGIC_VECTOR(31 DOWNTO 0); | |
99 | addr_matrix_f2 : STD_LOGIC_VECTOR(31 DOWNTO 0); |
|
99 | addr_matrix_f2 : STD_LOGIC_VECTOR(31 DOWNTO 0); | |
100 | END RECORD; |
|
100 | END RECORD; | |
101 |
|
101 | |||
102 | SIGNAL reg : lpp_dma_regs; |
|
102 | SIGNAL reg : lpp_dma_regs; | |
103 |
|
103 | |||
104 | SIGNAL prdata : STD_LOGIC_VECTOR(31 DOWNTO 0); |
|
104 | SIGNAL prdata : STD_LOGIC_VECTOR(31 DOWNTO 0); | |
105 |
|
105 | |||
106 | BEGIN -- beh |
|
106 | BEGIN -- beh | |
107 |
|
107 | |||
108 | status_ready_matrix_f0_0 <= reg.status_ready_matrix_f0_0; |
|
108 | status_ready_matrix_f0_0 <= reg.status_ready_matrix_f0_0; | |
109 | status_ready_matrix_f0_1 <= reg.status_ready_matrix_f0_1; |
|
109 | status_ready_matrix_f0_1 <= reg.status_ready_matrix_f0_1; | |
110 | status_ready_matrix_f1 <= reg.status_ready_matrix_f1; |
|
110 | status_ready_matrix_f1 <= reg.status_ready_matrix_f1; | |
111 | status_ready_matrix_f2 <= reg.status_ready_matrix_f2; |
|
111 | status_ready_matrix_f2 <= reg.status_ready_matrix_f2; | |
112 | status_error_anticipating_empty_fifo <= reg.status_error_anticipating_empty_fifo; |
|
112 | status_error_anticipating_empty_fifo <= reg.status_error_anticipating_empty_fifo; | |
113 | status_error_bad_component_error <= reg.status_error_bad_component_error; |
|
113 | status_error_bad_component_error <= reg.status_error_bad_component_error; | |
114 |
|
114 | |||
115 | config_active_interruption_onNewMatrix <= reg.config_active_interruption_onNewMatrix; |
|
115 | config_active_interruption_onNewMatrix <= reg.config_active_interruption_onNewMatrix; | |
116 | config_active_interruption_onError <= reg.config_active_interruption_onError; |
|
116 | config_active_interruption_onError <= reg.config_active_interruption_onError; | |
117 | addr_matrix_f0_0 <= reg.addr_matrix_f0_0; |
|
117 | addr_matrix_f0_0 <= reg.addr_matrix_f0_0; | |
118 | addr_matrix_f0_1 <= reg.addr_matrix_f0_1; |
|
118 | addr_matrix_f0_1 <= reg.addr_matrix_f0_1; | |
119 | addr_matrix_f1 <= reg.addr_matrix_f1; |
|
119 | addr_matrix_f1 <= reg.addr_matrix_f1; | |
120 | addr_matrix_f2 <= reg.addr_matrix_f2; |
|
120 | addr_matrix_f2 <= reg.addr_matrix_f2; | |
121 |
|
121 | |||
122 | lpp_top_apbreg : PROCESS (HCLK, HRESETn) |
|
122 | lpp_top_apbreg : PROCESS (HCLK, HRESETn) | |
123 | VARIABLE paddr : STD_LOGIC_VECTOR(7 DOWNTO 2); |
|
123 | VARIABLE paddr : STD_LOGIC_VECTOR(7 DOWNTO 2); | |
124 | BEGIN -- PROCESS lpp_dma_top |
|
124 | BEGIN -- PROCESS lpp_dma_top | |
125 | IF HRESETn = '0' THEN -- asynchronous reset (active low) |
|
125 | IF HRESETn = '0' THEN -- asynchronous reset (active low) | |
126 | reg.config_active_interruption_onNewMatrix <= '0'; |
|
126 | reg.config_active_interruption_onNewMatrix <= '0'; | |
127 | reg.config_active_interruption_onError <= '0'; |
|
127 | reg.config_active_interruption_onError <= '0'; | |
128 | reg.status_ready_matrix_f0_0 <= '0'; |
|
128 | reg.status_ready_matrix_f0_0 <= '0'; | |
129 | reg.status_ready_matrix_f0_1 <= '0'; |
|
129 | reg.status_ready_matrix_f0_1 <= '0'; | |
130 | reg.status_ready_matrix_f1 <= '0'; |
|
130 | reg.status_ready_matrix_f1 <= '0'; | |
131 | reg.status_ready_matrix_f2 <= '0'; |
|
131 | reg.status_ready_matrix_f2 <= '0'; | |
132 | reg.status_error_anticipating_empty_fifo <= '0'; |
|
132 | reg.status_error_anticipating_empty_fifo <= '0'; | |
133 | reg.status_error_bad_component_error <= '0'; |
|
133 | reg.status_error_bad_component_error <= '0'; | |
134 | reg.addr_matrix_f0_0 <= (OTHERS => '0'); |
|
134 | reg.addr_matrix_f0_0 <= (OTHERS => '0'); | |
135 | reg.addr_matrix_f0_1 <= (OTHERS => '0'); |
|
135 | reg.addr_matrix_f0_1 <= (OTHERS => '0'); | |
136 | reg.addr_matrix_f1 <= (OTHERS => '0'); |
|
136 | reg.addr_matrix_f1 <= (OTHERS => '0'); | |
137 | reg.addr_matrix_f2 <= (OTHERS => '0'); |
|
137 | reg.addr_matrix_f2 <= (OTHERS => '0'); | |
138 | prdata <= (OTHERS => '0'); |
|
138 | prdata <= (OTHERS => '0'); | |
|
139 | ||||
|
140 | apbo.pirq <= (OTHERS => '0'); | |||
|
141 | ||||
139 |
|
|
142 | ELSIF HCLK'EVENT AND HCLK = '1' THEN -- rising clock edge | |
140 |
|
143 | |||
141 | reg.status_ready_matrix_f0_0 <= reg.status_ready_matrix_f0_0 OR ready_matrix_f0_0; |
|
144 | reg.status_ready_matrix_f0_0 <= reg.status_ready_matrix_f0_0 OR ready_matrix_f0_0; | |
142 | reg.status_ready_matrix_f0_1 <= reg.status_ready_matrix_f0_1 OR ready_matrix_f0_1; |
|
145 | reg.status_ready_matrix_f0_1 <= reg.status_ready_matrix_f0_1 OR ready_matrix_f0_1; | |
143 | reg.status_ready_matrix_f1 <= reg.status_ready_matrix_f1 OR ready_matrix_f1; |
|
146 | reg.status_ready_matrix_f1 <= reg.status_ready_matrix_f1 OR ready_matrix_f1; | |
144 | reg.status_ready_matrix_f2 <= reg.status_ready_matrix_f2 OR ready_matrix_f2; |
|
147 | reg.status_ready_matrix_f2 <= reg.status_ready_matrix_f2 OR ready_matrix_f2; | |
145 |
|
148 | |||
146 | reg.status_error_anticipating_empty_fifo <= reg.status_error_anticipating_empty_fifo OR error_anticipating_empty_fifo; |
|
149 | reg.status_error_anticipating_empty_fifo <= reg.status_error_anticipating_empty_fifo OR error_anticipating_empty_fifo; | |
147 | reg.status_error_bad_component_error <= reg.status_error_bad_component_error OR error_bad_component_error; |
|
150 | reg.status_error_bad_component_error <= reg.status_error_bad_component_error OR error_bad_component_error; | |
148 |
|
151 | |||
149 | paddr := "000000"; |
|
152 | paddr := "000000"; | |
150 | paddr(7 DOWNTO 2) := apbi.paddr(7 DOWNTO 2); |
|
153 | paddr(7 DOWNTO 2) := apbi.paddr(7 DOWNTO 2); | |
151 | prdata <= (OTHERS => '0'); |
|
154 | prdata <= (OTHERS => '0'); | |
152 | IF apbi.psel(pindex) = '1' THEN |
|
155 | IF apbi.psel(pindex) = '1' THEN | |
153 | -- APB DMA READ -- |
|
156 | -- APB DMA READ -- | |
154 | CASE paddr(7 DOWNTO 2) IS |
|
157 | CASE paddr(7 DOWNTO 2) IS | |
155 | WHEN "000000" => prdata(0) <= reg.config_active_interruption_onNewMatrix; |
|
158 | WHEN "000000" => prdata(0) <= reg.config_active_interruption_onNewMatrix; | |
156 | prdata(1) <= reg.config_active_interruption_onError; |
|
159 | prdata(1) <= reg.config_active_interruption_onError; | |
157 | WHEN "000001" => prdata(0) <= reg.status_ready_matrix_f0_0; |
|
160 | WHEN "000001" => prdata(0) <= reg.status_ready_matrix_f0_0; | |
158 | prdata(1) <= reg.status_ready_matrix_f0_1; |
|
161 | prdata(1) <= reg.status_ready_matrix_f0_1; | |
159 | prdata(2) <= reg.status_ready_matrix_f1; |
|
162 | prdata(2) <= reg.status_ready_matrix_f1; | |
160 | prdata(3) <= reg.status_ready_matrix_f2; |
|
163 | prdata(3) <= reg.status_ready_matrix_f2; | |
161 | prdata(4) <= reg.status_error_anticipating_empty_fifo; |
|
164 | prdata(4) <= reg.status_error_anticipating_empty_fifo; | |
162 | prdata(5) <= reg.status_error_bad_component_error; |
|
165 | prdata(5) <= reg.status_error_bad_component_error; | |
163 | WHEN "000010" => prdata <= reg.addr_matrix_f0_0; |
|
166 | WHEN "000010" => prdata <= reg.addr_matrix_f0_0; | |
164 | WHEN "000011" => prdata <= reg.addr_matrix_f0_1; |
|
167 | WHEN "000011" => prdata <= reg.addr_matrix_f0_1; | |
165 | WHEN "000100" => prdata <= reg.addr_matrix_f1; |
|
168 | WHEN "000100" => prdata <= reg.addr_matrix_f1; | |
166 | WHEN "000101" => prdata <= reg.addr_matrix_f2; |
|
169 | WHEN "000101" => prdata <= reg.addr_matrix_f2; | |
167 | WHEN "000110" => prdata <= debug_reg; |
|
170 | WHEN "000110" => prdata <= debug_reg; | |
168 | WHEN OTHERS => NULL; |
|
171 | WHEN OTHERS => NULL; | |
169 | END CASE; |
|
172 | END CASE; | |
170 | IF (apbi.pwrite AND apbi.penable) = '1' THEN |
|
173 | IF (apbi.pwrite AND apbi.penable) = '1' THEN | |
171 | -- APB DMA WRITE -- |
|
174 | -- APB DMA WRITE -- | |
172 | CASE paddr(7 DOWNTO 2) IS |
|
175 | CASE paddr(7 DOWNTO 2) IS | |
173 | WHEN "000000" => reg.config_active_interruption_onNewMatrix <= apbi.pwdata(0); |
|
176 | WHEN "000000" => reg.config_active_interruption_onNewMatrix <= apbi.pwdata(0); | |
174 | reg.config_active_interruption_onError <= apbi.pwdata(1); |
|
177 | reg.config_active_interruption_onError <= apbi.pwdata(1); | |
175 | WHEN "000001" => reg.status_ready_matrix_f0_0 <= apbi.pwdata(0); |
|
178 | WHEN "000001" => reg.status_ready_matrix_f0_0 <= apbi.pwdata(0); | |
176 | reg.status_ready_matrix_f0_1 <= apbi.pwdata(1); |
|
179 | reg.status_ready_matrix_f0_1 <= apbi.pwdata(1); | |
177 | reg.status_ready_matrix_f1 <= apbi.pwdata(2); |
|
180 | reg.status_ready_matrix_f1 <= apbi.pwdata(2); | |
178 | reg.status_ready_matrix_f2 <= apbi.pwdata(3); |
|
181 | reg.status_ready_matrix_f2 <= apbi.pwdata(3); | |
179 | reg.status_error_anticipating_empty_fifo <= apbi.pwdata(4); |
|
182 | reg.status_error_anticipating_empty_fifo <= apbi.pwdata(4); | |
180 | reg.status_error_bad_component_error <= apbi.pwdata(5); |
|
183 | reg.status_error_bad_component_error <= apbi.pwdata(5); | |
181 | WHEN "000010" => reg.addr_matrix_f0_0 <= apbi.pwdata; |
|
184 | WHEN "000010" => reg.addr_matrix_f0_0 <= apbi.pwdata; | |
182 | WHEN "000011" => reg.addr_matrix_f0_1 <= apbi.pwdata; |
|
185 | WHEN "000011" => reg.addr_matrix_f0_1 <= apbi.pwdata; | |
183 | WHEN "000100" => reg.addr_matrix_f1 <= apbi.pwdata; |
|
186 | WHEN "000100" => reg.addr_matrix_f1 <= apbi.pwdata; | |
184 | WHEN "000101" => reg.addr_matrix_f2 <= apbi.pwdata; |
|
187 | WHEN "000101" => reg.addr_matrix_f2 <= apbi.pwdata; | |
185 | WHEN OTHERS => NULL; |
|
188 | WHEN OTHERS => NULL; | |
186 | END CASE; |
|
189 | END CASE; | |
187 | END IF; |
|
190 | END IF; | |
188 | END IF; |
|
191 | END IF; | |
|
192 | ||||
|
193 | apbo.pirq(pirq) <= ( reg.config_active_interruption_onNewMatrix AND ( ready_matrix_f0_0 OR | |||
|
194 | ready_matrix_f0_1 OR | |||
|
195 | ready_matrix_f1 OR | |||
|
196 | ready_matrix_f2) | |||
|
197 | ) | |||
|
198 | OR | |||
|
199 | ( reg.config_active_interruption_onError AND ( error_anticipating_empty_fifo OR | |||
|
200 | error_bad_component_error) | |||
|
201 | ); | |||
|
202 | ||||
|
203 | ||||
189 |
|
|
204 | END IF; | |
190 | END PROCESS lpp_top_apbreg; |
|
205 | END PROCESS lpp_top_apbreg; | |
191 |
|
206 | |||
192 | apbo.pirq <= (OTHERS => '0'); |
|
|||
193 |
|
|
207 | apbo.pindex <= pindex; | |
194 | apbo.pconfig <= pconfig; |
|
208 | apbo.pconfig <= pconfig; | |
195 | apbo.prdata <= prdata; |
|
209 | apbo.prdata <= prdata; | |
196 |
|
210 | |||
197 |
|
211 | |||
198 | END beh; |
|
212 | END beh; |
@@ -1,411 +1,414 | |||||
1 | LIBRARY ieee; |
|
1 | LIBRARY ieee; | |
2 | USE ieee.std_logic_1164.ALL; |
|
2 | USE ieee.std_logic_1164.ALL; | |
3 | LIBRARY grlib; |
|
3 | LIBRARY grlib; | |
4 | USE grlib.amba.ALL; |
|
4 | USE grlib.amba.ALL; | |
5 | USE grlib.stdlib.ALL; |
|
5 | USE grlib.stdlib.ALL; | |
6 | USE grlib.devices.ALL; |
|
6 | USE grlib.devices.ALL; | |
7 | USE GRLIB.DMA2AHB_Package.ALL; |
|
7 | USE GRLIB.DMA2AHB_Package.ALL; | |
8 | LIBRARY lpp; |
|
8 | LIBRARY lpp; | |
9 | USE lpp.lpp_ad_conv.ALL; |
|
9 | USE lpp.lpp_ad_conv.ALL; | |
10 | USE lpp.iir_filter.ALL; |
|
10 | USE lpp.iir_filter.ALL; | |
11 | USE lpp.FILTERcfg.ALL; |
|
11 | USE lpp.FILTERcfg.ALL; | |
12 | USE lpp.lpp_memory.ALL; |
|
12 | USE lpp.lpp_memory.ALL; | |
13 | USE lpp.lpp_top_lfr_pkg.ALL; |
|
13 | USE lpp.lpp_top_lfr_pkg.ALL; | |
14 | USE lpp.lpp_dma_pkg.ALL; |
|
14 | USE lpp.lpp_dma_pkg.ALL; | |
15 | USE lpp.lpp_demux.ALL; |
|
15 | USE lpp.lpp_demux.ALL; | |
16 | USE lpp.lpp_fft.ALL; |
|
16 | USE lpp.lpp_fft.ALL; | |
17 | use lpp.lpp_matrix.all; |
|
17 | use lpp.lpp_matrix.all; | |
18 | LIBRARY techmap; |
|
18 | LIBRARY techmap; | |
19 | USE techmap.gencomp.ALL; |
|
19 | USE techmap.gencomp.ALL; | |
20 |
|
20 | |||
21 | ENTITY lpp_top_lfr IS |
|
21 | ENTITY lpp_top_lfr IS | |
22 | GENERIC( |
|
22 | GENERIC( | |
23 | tech : INTEGER := 0; |
|
23 | tech : INTEGER := 0; | |
24 | hindex_SpectralMatrix : INTEGER := 2; |
|
24 | hindex_SpectralMatrix : INTEGER := 2; | |
25 | pindex : INTEGER := 4; |
|
25 | pindex : INTEGER := 4; | |
26 | paddr : INTEGER := 4; |
|
26 | paddr : INTEGER := 4; | |
27 | pmask : INTEGER := 16#fff#; |
|
27 | pmask : INTEGER := 16#fff#; | |
28 | pirq : INTEGER := 0 |
|
28 | pirq : INTEGER := 0 | |
29 | ); |
|
29 | ); | |
30 | PORT ( |
|
30 | PORT ( | |
31 | -- ADS7886 |
|
31 | -- ADS7886 | |
32 | cnv_run : IN STD_LOGIC; |
|
32 | cnv_run : IN STD_LOGIC; | |
33 | cnv : OUT STD_LOGIC; |
|
33 | cnv : OUT STD_LOGIC; | |
34 | sck : OUT STD_LOGIC; |
|
34 | sck : OUT STD_LOGIC; | |
35 | sdo : IN STD_LOGIC_VECTOR(7 DOWNTO 0); |
|
35 | sdo : IN STD_LOGIC_VECTOR(7 DOWNTO 0); | |
36 | -- |
|
36 | -- | |
37 | cnv_clk : IN STD_LOGIC; -- 49 MHz |
|
37 | cnv_clk : IN STD_LOGIC; -- 49 MHz | |
38 | cnv_rstn : IN STD_LOGIC; |
|
38 | cnv_rstn : IN STD_LOGIC; | |
39 | -- |
|
39 | -- | |
40 | clk : IN STD_LOGIC; -- 25 MHz |
|
40 | clk : IN STD_LOGIC; -- 25 MHz | |
41 | rstn : IN STD_LOGIC; |
|
41 | rstn : IN STD_LOGIC; | |
42 | -- |
|
42 | -- | |
43 | apbi : IN apb_slv_in_type; |
|
43 | apbi : IN apb_slv_in_type; | |
44 | apbo : OUT apb_slv_out_type; |
|
44 | apbo : OUT apb_slv_out_type; | |
45 |
|
45 | |||
46 | -- AMBA AHB Master Interface |
|
46 | -- AMBA AHB Master Interface | |
47 | AHB_DMA_SpectralMatrix_In : IN AHB_Mst_In_Type; |
|
47 | AHB_DMA_SpectralMatrix_In : IN AHB_Mst_In_Type; | |
48 | AHB_DMA_SpectralMatrix_Out : OUT AHB_Mst_Out_Type |
|
48 | AHB_DMA_SpectralMatrix_Out : OUT AHB_Mst_Out_Type | |
49 | ); |
|
49 | ); | |
50 | END lpp_top_lfr; |
|
50 | END lpp_top_lfr; | |
51 |
|
51 | |||
52 | ARCHITECTURE tb OF lpp_top_lfr IS |
|
52 | ARCHITECTURE tb OF lpp_top_lfr IS | |
53 |
|
53 | |||
54 | ----------------------------------------------------------------------------- |
|
54 | ----------------------------------------------------------------------------- | |
55 | -- f0 |
|
55 | -- f0 | |
56 | SIGNAL sample_f0_0_wen : STD_LOGIC_VECTOR(4 DOWNTO 0); |
|
56 | SIGNAL sample_f0_0_wen : STD_LOGIC_VECTOR(4 DOWNTO 0); | |
57 | SIGNAL sample_f0_1_wen : STD_LOGIC_VECTOR(4 DOWNTO 0); |
|
57 | SIGNAL sample_f0_1_wen : STD_LOGIC_VECTOR(4 DOWNTO 0); | |
58 | SIGNAL sample_f0_wdata : STD_LOGIC_VECTOR((5*16)-1 DOWNTO 0); |
|
58 | SIGNAL sample_f0_wdata : STD_LOGIC_VECTOR((5*16)-1 DOWNTO 0); | |
59 | -- |
|
59 | -- | |
60 | SIGNAL sample_f0_0_ren : STD_LOGIC_VECTOR(4 DOWNTO 0); |
|
60 | SIGNAL sample_f0_0_ren : STD_LOGIC_VECTOR(4 DOWNTO 0); | |
61 | SIGNAL sample_f0_0_rdata : STD_LOGIC_VECTOR((5*16)-1 DOWNTO 0); |
|
61 | SIGNAL sample_f0_0_rdata : STD_LOGIC_VECTOR((5*16)-1 DOWNTO 0); | |
62 | SIGNAL sample_f0_0_full : STD_LOGIC_VECTOR(4 DOWNTO 0); |
|
62 | SIGNAL sample_f0_0_full : STD_LOGIC_VECTOR(4 DOWNTO 0); | |
63 | SIGNAL sample_f0_0_empty : STD_LOGIC_VECTOR(4 DOWNTO 0); |
|
63 | SIGNAL sample_f0_0_empty : STD_LOGIC_VECTOR(4 DOWNTO 0); | |
64 | -- |
|
64 | -- | |
65 | SIGNAL sample_f0_1_ren : STD_LOGIC_VECTOR(4 DOWNTO 0); |
|
65 | SIGNAL sample_f0_1_ren : STD_LOGIC_VECTOR(4 DOWNTO 0); | |
66 | SIGNAL sample_f0_1_rdata : STD_LOGIC_VECTOR((5*16)-1 DOWNTO 0); |
|
66 | SIGNAL sample_f0_1_rdata : STD_LOGIC_VECTOR((5*16)-1 DOWNTO 0); | |
67 | SIGNAL sample_f0_1_full : STD_LOGIC_VECTOR(4 DOWNTO 0); |
|
67 | SIGNAL sample_f0_1_full : STD_LOGIC_VECTOR(4 DOWNTO 0); | |
68 | SIGNAL sample_f0_1_empty : STD_LOGIC_VECTOR(4 DOWNTO 0); |
|
68 | SIGNAL sample_f0_1_empty : STD_LOGIC_VECTOR(4 DOWNTO 0); | |
69 | ----------------------------------------------------------------------------- |
|
69 | ----------------------------------------------------------------------------- | |
70 | -- f1 |
|
70 | -- f1 | |
71 | SIGNAL sample_f1_wen : STD_LOGIC_VECTOR(4 DOWNTO 0); |
|
71 | SIGNAL sample_f1_wen : STD_LOGIC_VECTOR(4 DOWNTO 0); | |
72 | SIGNAL sample_f1_wdata : STD_LOGIC_VECTOR((5*16)-1 DOWNTO 0); |
|
72 | SIGNAL sample_f1_wdata : STD_LOGIC_VECTOR((5*16)-1 DOWNTO 0); | |
73 | -- |
|
73 | -- | |
74 | SIGNAL sample_f1_ren : STD_LOGIC_VECTOR(4 DOWNTO 0); |
|
74 | SIGNAL sample_f1_ren : STD_LOGIC_VECTOR(4 DOWNTO 0); | |
75 | SIGNAL sample_f1_rdata : STD_LOGIC_VECTOR((5*16)-1 DOWNTO 0); |
|
75 | SIGNAL sample_f1_rdata : STD_LOGIC_VECTOR((5*16)-1 DOWNTO 0); | |
76 | SIGNAL sample_f1_full : STD_LOGIC_VECTOR(4 DOWNTO 0); |
|
76 | SIGNAL sample_f1_full : STD_LOGIC_VECTOR(4 DOWNTO 0); | |
77 | SIGNAL sample_f1_empty : STD_LOGIC_VECTOR(4 DOWNTO 0); |
|
77 | SIGNAL sample_f1_empty : STD_LOGIC_VECTOR(4 DOWNTO 0); | |
78 | ----------------------------------------------------------------------------- |
|
78 | ----------------------------------------------------------------------------- | |
79 | -- f2 |
|
79 | -- f2 | |
80 | SIGNAL sample_f2_wen : STD_LOGIC_VECTOR(4 DOWNTO 0); |
|
80 | SIGNAL sample_f2_wen : STD_LOGIC_VECTOR(4 DOWNTO 0); | |
81 | SIGNAL sample_f2_wdata : STD_LOGIC_VECTOR((5*16)-1 DOWNTO 0); |
|
81 | SIGNAL sample_f2_wdata : STD_LOGIC_VECTOR((5*16)-1 DOWNTO 0); | |
82 | ----------------------------------------------------------------------------- |
|
82 | ----------------------------------------------------------------------------- | |
83 | -- f3 |
|
83 | -- f3 | |
84 | SIGNAL sample_f3_wen : STD_LOGIC_VECTOR(4 DOWNTO 0); |
|
84 | SIGNAL sample_f3_wen : STD_LOGIC_VECTOR(4 DOWNTO 0); | |
85 | SIGNAL sample_f3_wdata : STD_LOGIC_VECTOR((5*16)-1 DOWNTO 0); |
|
85 | SIGNAL sample_f3_wdata : STD_LOGIC_VECTOR((5*16)-1 DOWNTO 0); | |
86 | -- |
|
86 | -- | |
87 | SIGNAL sample_f3_ren : STD_LOGIC_VECTOR(4 DOWNTO 0); |
|
87 | SIGNAL sample_f3_ren : STD_LOGIC_VECTOR(4 DOWNTO 0); | |
88 | SIGNAL sample_f3_rdata : STD_LOGIC_VECTOR((5*16)-1 DOWNTO 0); |
|
88 | SIGNAL sample_f3_rdata : STD_LOGIC_VECTOR((5*16)-1 DOWNTO 0); | |
89 | SIGNAL sample_f3_full : STD_LOGIC_VECTOR(4 DOWNTO 0); |
|
89 | SIGNAL sample_f3_full : STD_LOGIC_VECTOR(4 DOWNTO 0); | |
90 | SIGNAL sample_f3_empty : STD_LOGIC_VECTOR(4 DOWNTO 0); |
|
90 | SIGNAL sample_f3_empty : STD_LOGIC_VECTOR(4 DOWNTO 0); | |
91 | ----------------------------------------------------------------------------- |
|
91 | ----------------------------------------------------------------------------- | |
92 |
|
92 | |||
93 | ----------------------------------------------------------------------------- |
|
93 | ----------------------------------------------------------------------------- | |
94 | -- SPECTRAL MATRIX |
|
94 | -- SPECTRAL MATRIX | |
95 | ----------------------------------------------------------------------------- |
|
95 | ----------------------------------------------------------------------------- | |
96 | SIGNAL sample_ren : STD_LOGIC_VECTOR(19 DOWNTO 0); |
|
96 | SIGNAL sample_ren : STD_LOGIC_VECTOR(19 DOWNTO 0); | |
97 |
|
97 | |||
98 | SIGNAL demux_empty : STD_LOGIC_VECTOR(4 DOWNTO 0); |
|
98 | SIGNAL demux_empty : STD_LOGIC_VECTOR(4 DOWNTO 0); | |
99 | SIGNAL demux_ren : STD_LOGIC_VECTOR(4 DOWNTO 0); |
|
99 | SIGNAL demux_ren : STD_LOGIC_VECTOR(4 DOWNTO 0); | |
100 | SIGNAL demux_data : STD_LOGIC_VECTOR((5*16)-1 DOWNTO 0); |
|
100 | SIGNAL demux_data : STD_LOGIC_VECTOR((5*16)-1 DOWNTO 0); | |
101 |
|
101 | |||
102 | SIGNAL fft_fifo_full : STD_LOGIC_VECTOR(4 DOWNTO 0); |
|
102 | SIGNAL fft_fifo_full : STD_LOGIC_VECTOR(4 DOWNTO 0); | |
103 | SIGNAL fft_fifo_data : STD_LOGIC_VECTOR((5*16)-1 DOWNTO 0); |
|
103 | SIGNAL fft_fifo_data : STD_LOGIC_VECTOR((5*16)-1 DOWNTO 0); | |
104 | SIGNAL fft_fifo_wen : STD_LOGIC_VECTOR(4 DOWNTO 0); |
|
104 | SIGNAL fft_fifo_wen : STD_LOGIC_VECTOR(4 DOWNTO 0); | |
105 | SIGNAL fft_fifo_reuse : STD_LOGIC_VECTOR(4 DOWNTO 0); |
|
105 | SIGNAL fft_fifo_reuse : STD_LOGIC_VECTOR(4 DOWNTO 0); | |
106 |
|
106 | |||
107 | SIGNAL SP_fifo_data : STD_LOGIC_VECTOR((5*16)-1 DOWNTO 0); |
|
107 | SIGNAL SP_fifo_data : STD_LOGIC_VECTOR((5*16)-1 DOWNTO 0); | |
108 | SIGNAL SP_fifo_ren : STD_LOGIC_VECTOR(4 DOWNTO 0); |
|
108 | SIGNAL SP_fifo_ren : STD_LOGIC_VECTOR(4 DOWNTO 0); | |
109 |
|
109 | |||
110 | SIGNAL fifo_data : STD_LOGIC_VECTOR(31 DOWNTO 0); |
|
110 | SIGNAL fifo_data : STD_LOGIC_VECTOR(31 DOWNTO 0); | |
111 | SIGNAL fifo_empty : STD_LOGIC; |
|
111 | SIGNAL fifo_empty : STD_LOGIC; | |
112 | SIGNAL fifo_ren : STD_LOGIC; |
|
112 | SIGNAL fifo_ren : STD_LOGIC; | |
113 | SIGNAL header : STD_LOGIC_VECTOR(31 DOWNTO 0); |
|
113 | SIGNAL header : STD_LOGIC_VECTOR(31 DOWNTO 0); | |
114 | SIGNAL header_val : STD_LOGIC; |
|
114 | SIGNAL header_val : STD_LOGIC; | |
115 | SIGNAL header_ack : STD_LOGIC; |
|
115 | SIGNAL header_ack : STD_LOGIC; | |
116 |
|
116 | |||
117 | ----------------------------------------------------------------------------- |
|
117 | ----------------------------------------------------------------------------- | |
118 | -- APB REG |
|
118 | -- APB REG | |
119 | ----------------------------------------------------------------------------- |
|
119 | ----------------------------------------------------------------------------- | |
120 | SIGNAL ready_matrix_f0_0 : STD_LOGIC; |
|
120 | SIGNAL ready_matrix_f0_0 : STD_LOGIC; | |
121 | SIGNAL ready_matrix_f0_1 : STD_LOGIC; |
|
121 | SIGNAL ready_matrix_f0_1 : STD_LOGIC; | |
122 | SIGNAL ready_matrix_f1 : STD_LOGIC; |
|
122 | SIGNAL ready_matrix_f1 : STD_LOGIC; | |
123 | SIGNAL ready_matrix_f2 : STD_LOGIC; |
|
123 | SIGNAL ready_matrix_f2 : STD_LOGIC; | |
124 | SIGNAL error_anticipating_empty_fifo : STD_LOGIC; |
|
124 | SIGNAL error_anticipating_empty_fifo : STD_LOGIC; | |
125 | SIGNAL error_bad_component_error : STD_LOGIC; |
|
125 | SIGNAL error_bad_component_error : STD_LOGIC; | |
126 | SIGNAL debug_reg : STD_LOGIC_VECTOR(31 DOWNTO 0); |
|
126 | SIGNAL debug_reg : STD_LOGIC_VECTOR(31 DOWNTO 0); | |
127 | SIGNAL status_ready_matrix_f0_0 : STD_LOGIC; |
|
127 | SIGNAL status_ready_matrix_f0_0 : STD_LOGIC; | |
128 | SIGNAL status_ready_matrix_f0_1 : STD_LOGIC; |
|
128 | SIGNAL status_ready_matrix_f0_1 : STD_LOGIC; | |
129 | SIGNAL status_ready_matrix_f1 : STD_LOGIC; |
|
129 | SIGNAL status_ready_matrix_f1 : STD_LOGIC; | |
130 | SIGNAL status_ready_matrix_f2 : STD_LOGIC; |
|
130 | SIGNAL status_ready_matrix_f2 : STD_LOGIC; | |
131 | SIGNAL status_error_anticipating_empty_fifo : STD_LOGIC; |
|
131 | SIGNAL status_error_anticipating_empty_fifo : STD_LOGIC; | |
132 | SIGNAL status_error_bad_component_error : STD_LOGIC; |
|
132 | SIGNAL status_error_bad_component_error : STD_LOGIC; | |
133 | SIGNAL config_active_interruption_onNewMatrix : STD_LOGIC; |
|
133 | SIGNAL config_active_interruption_onNewMatrix : STD_LOGIC; | |
134 | SIGNAL config_active_interruption_onError : STD_LOGIC; |
|
134 | SIGNAL config_active_interruption_onError : STD_LOGIC; | |
135 | SIGNAL addr_matrix_f0_0 : STD_LOGIC_VECTOR(31 DOWNTO 0); |
|
135 | SIGNAL addr_matrix_f0_0 : STD_LOGIC_VECTOR(31 DOWNTO 0); | |
136 | SIGNAL addr_matrix_f0_1 : STD_LOGIC_VECTOR(31 DOWNTO 0); |
|
136 | SIGNAL addr_matrix_f0_1 : STD_LOGIC_VECTOR(31 DOWNTO 0); | |
137 | SIGNAL addr_matrix_f1 : STD_LOGIC_VECTOR(31 DOWNTO 0); |
|
137 | SIGNAL addr_matrix_f1 : STD_LOGIC_VECTOR(31 DOWNTO 0); | |
138 | SIGNAL addr_matrix_f2 : STD_LOGIC_VECTOR(31 DOWNTO 0); |
|
138 | SIGNAL addr_matrix_f2 : STD_LOGIC_VECTOR(31 DOWNTO 0); | |
139 |
|
139 | |||
140 | BEGIN |
|
140 | BEGIN | |
141 |
|
141 | |||
142 | ----------------------------------------------------------------------------- |
|
142 | ----------------------------------------------------------------------------- | |
143 | -- CNA + FILTER |
|
143 | -- CNA + FILTER | |
144 | ----------------------------------------------------------------------------- |
|
144 | ----------------------------------------------------------------------------- | |
145 | lpp_top_acq_1 : lpp_top_acq |
|
145 | lpp_top_acq_1 : lpp_top_acq | |
146 | GENERIC MAP ( |
|
146 | GENERIC MAP ( | |
147 | tech => tech) |
|
147 | tech => tech) | |
148 | PORT MAP ( |
|
148 | PORT MAP ( | |
149 | cnv_run => cnv_run, |
|
149 | cnv_run => cnv_run, | |
150 | cnv => cnv, |
|
150 | cnv => cnv, | |
151 | sck => sck, |
|
151 | sck => sck, | |
152 | sdo => sdo, |
|
152 | sdo => sdo, | |
153 | cnv_clk => cnv_clk, |
|
153 | cnv_clk => cnv_clk, | |
154 | cnv_rstn => cnv_rstn, |
|
154 | cnv_rstn => cnv_rstn, | |
155 | clk => clk, |
|
155 | clk => clk, | |
156 | rstn => rstn, |
|
156 | rstn => rstn, | |
157 |
|
157 | |||
158 | sample_f0_0_wen => sample_f0_0_wen, |
|
158 | sample_f0_0_wen => sample_f0_0_wen, | |
159 | sample_f0_1_wen => sample_f0_1_wen, |
|
159 | sample_f0_1_wen => sample_f0_1_wen, | |
160 | sample_f0_wdata => sample_f0_wdata, |
|
160 | sample_f0_wdata => sample_f0_wdata, | |
161 | sample_f1_wen => sample_f1_wen, |
|
161 | sample_f1_wen => sample_f1_wen, | |
162 | sample_f1_wdata => sample_f1_wdata, |
|
162 | sample_f1_wdata => sample_f1_wdata, | |
163 | sample_f2_wen => sample_f2_wen, |
|
163 | sample_f2_wen => sample_f2_wen, | |
164 | sample_f2_wdata => sample_f2_wdata, |
|
164 | sample_f2_wdata => sample_f2_wdata, | |
165 | sample_f3_wen => sample_f3_wen, |
|
165 | sample_f3_wen => sample_f3_wen, | |
166 | sample_f3_wdata => sample_f3_wdata); |
|
166 | sample_f3_wdata => sample_f3_wdata); | |
167 |
|
167 | |||
168 | ----------------------------------------------------------------------------- |
|
168 | ----------------------------------------------------------------------------- | |
169 | -- FIFO |
|
169 | -- FIFO | |
170 | ----------------------------------------------------------------------------- |
|
170 | ----------------------------------------------------------------------------- | |
171 |
|
171 | |||
172 | lppFIFO_f0_0 : lppFIFOxN |
|
172 | lppFIFO_f0_0 : lppFIFOxN | |
173 | GENERIC MAP ( |
|
173 | GENERIC MAP ( | |
174 | tech => tech, |
|
174 | tech => tech, | |
175 | Data_sz => 16, |
|
175 | Data_sz => 16, | |
176 | FifoCnt => 5, |
|
176 | FifoCnt => 5, | |
177 | Enable_ReUse => '0') |
|
177 | Enable_ReUse => '0') | |
178 | PORT MAP ( |
|
178 | PORT MAP ( | |
179 | rst => rstn, |
|
179 | rst => rstn, | |
180 | wclk => clk, |
|
180 | wclk => clk, | |
181 | rclk => clk, |
|
181 | rclk => clk, | |
182 | ReUse => (OTHERS => '0'), |
|
182 | ReUse => (OTHERS => '0'), | |
183 |
|
183 | |||
184 | wen => sample_f0_0_wen, |
|
184 | wen => sample_f0_0_wen, | |
185 | ren => sample_f0_0_ren, |
|
185 | ren => sample_f0_0_ren, | |
186 | wdata => sample_f0_wdata, |
|
186 | wdata => sample_f0_wdata, | |
187 | rdata => sample_f0_0_rdata, |
|
187 | rdata => sample_f0_0_rdata, | |
188 | full => sample_f0_0_full, |
|
188 | full => sample_f0_0_full, | |
189 | empty => sample_f0_0_empty); |
|
189 | empty => sample_f0_0_empty); | |
190 |
|
190 | |||
191 | lppFIFO_f0_1 : lppFIFOxN |
|
191 | lppFIFO_f0_1 : lppFIFOxN | |
192 | GENERIC MAP ( |
|
192 | GENERIC MAP ( | |
193 | tech => tech, |
|
193 | tech => tech, | |
194 | Data_sz => 16, |
|
194 | Data_sz => 16, | |
195 | FifoCnt => 5, |
|
195 | FifoCnt => 5, | |
196 | Enable_ReUse => '0') |
|
196 | Enable_ReUse => '0') | |
197 | PORT MAP ( |
|
197 | PORT MAP ( | |
198 | rst => rstn, |
|
198 | rst => rstn, | |
199 | wclk => clk, |
|
199 | wclk => clk, | |
200 | rclk => clk, |
|
200 | rclk => clk, | |
201 | ReUse => (OTHERS => '0'), |
|
201 | ReUse => (OTHERS => '0'), | |
202 |
|
202 | |||
203 | wen => sample_f0_1_wen, |
|
203 | wen => sample_f0_1_wen, | |
204 | ren => sample_f0_1_ren, |
|
204 | ren => sample_f0_1_ren, | |
205 | wdata => sample_f0_wdata, |
|
205 | wdata => sample_f0_wdata, | |
206 | rdata => sample_f0_1_rdata, |
|
206 | rdata => sample_f0_1_rdata, | |
207 | full => sample_f0_1_full, |
|
207 | full => sample_f0_1_full, | |
208 | empty => sample_f0_1_empty); |
|
208 | empty => sample_f0_1_empty); | |
209 |
|
209 | |||
210 | lppFIFO_f1 : lppFIFOxN |
|
210 | lppFIFO_f1 : lppFIFOxN | |
211 | GENERIC MAP ( |
|
211 | GENERIC MAP ( | |
212 | tech => tech, |
|
212 | tech => tech, | |
213 | Data_sz => 16, |
|
213 | Data_sz => 16, | |
214 | FifoCnt => 5, |
|
214 | FifoCnt => 5, | |
215 | Enable_ReUse => '0') |
|
215 | Enable_ReUse => '0') | |
216 | PORT MAP ( |
|
216 | PORT MAP ( | |
217 | rst => rstn, |
|
217 | rst => rstn, | |
218 | wclk => clk, |
|
218 | wclk => clk, | |
219 | rclk => clk, |
|
219 | rclk => clk, | |
220 | ReUse => (OTHERS => '0'), |
|
220 | ReUse => (OTHERS => '0'), | |
221 |
|
221 | |||
222 | wen => sample_f1_wen, |
|
222 | wen => sample_f1_wen, | |
223 | ren => sample_f1_ren, |
|
223 | ren => sample_f1_ren, | |
224 | wdata => sample_f1_wdata, |
|
224 | wdata => sample_f1_wdata, | |
225 | rdata => sample_f1_rdata, |
|
225 | rdata => sample_f1_rdata, | |
226 | full => sample_f1_full, |
|
226 | full => sample_f1_full, | |
227 | empty => sample_f1_empty); |
|
227 | empty => sample_f1_empty); | |
228 |
|
228 | |||
229 | lppFIFO_f3 : lppFIFOxN |
|
229 | lppFIFO_f3 : lppFIFOxN | |
230 | GENERIC MAP ( |
|
230 | GENERIC MAP ( | |
231 | tech => tech, |
|
231 | tech => tech, | |
232 | Data_sz => 16, |
|
232 | Data_sz => 16, | |
233 | FifoCnt => 5, |
|
233 | FifoCnt => 5, | |
234 | Enable_ReUse => '0') |
|
234 | Enable_ReUse => '0') | |
235 | PORT MAP ( |
|
235 | PORT MAP ( | |
236 | rst => rstn, |
|
236 | rst => rstn, | |
237 | wclk => clk, |
|
237 | wclk => clk, | |
238 | rclk => clk, |
|
238 | rclk => clk, | |
239 | ReUse => (OTHERS => '0'), |
|
239 | ReUse => (OTHERS => '0'), | |
240 |
|
240 | |||
241 | wen => sample_f3_wen, |
|
241 | wen => sample_f3_wen, | |
242 | ren => sample_f3_ren, |
|
242 | ren => sample_f3_ren, | |
243 | wdata => sample_f3_wdata, |
|
243 | wdata => sample_f3_wdata, | |
244 | rdata => sample_f3_rdata, |
|
244 | rdata => sample_f3_rdata, | |
245 | full => sample_f3_full, |
|
245 | full => sample_f3_full, | |
246 | empty => sample_f3_empty); |
|
246 | empty => sample_f3_empty); | |
247 |
|
247 | |||
248 | ----------------------------------------------------------------------------- |
|
248 | ----------------------------------------------------------------------------- | |
249 | -- SPECTRAL MATRIX |
|
249 | -- SPECTRAL MATRIX | |
250 | ----------------------------------------------------------------------------- |
|
250 | ----------------------------------------------------------------------------- | |
251 | sample_f0_0_ren <= sample_ren(4 DOWNTO 0); |
|
251 | sample_f0_0_ren <= sample_ren(4 DOWNTO 0); | |
252 | sample_f0_1_ren <= sample_ren(9 DOWNTO 5); |
|
252 | sample_f0_1_ren <= sample_ren(9 DOWNTO 5); | |
253 | sample_f1_ren <= sample_ren(14 DOWNTO 10); |
|
253 | sample_f1_ren <= sample_ren(14 DOWNTO 10); | |
254 | sample_f3_ren <= sample_ren(19 DOWNTO 15); |
|
254 | sample_f3_ren <= sample_ren(19 DOWNTO 15); | |
255 |
|
255 | |||
256 | Demultiplex_1 : Demultiplex |
|
256 | Demultiplex_1 : Demultiplex | |
257 | GENERIC MAP ( |
|
257 | GENERIC MAP ( | |
258 | Data_sz => 16) |
|
258 | Data_sz => 16) | |
259 | PORT MAP ( |
|
259 | PORT MAP ( | |
260 | clk => clk, |
|
260 | clk => clk, | |
261 | rstn => rstn, |
|
261 | rstn => rstn, | |
262 |
|
262 | |||
263 | Read => demux_ren, |
|
263 | Read => demux_ren, | |
264 | EmptyF0a => sample_f0_0_empty, |
|
264 | EmptyF0a => sample_f0_0_empty, | |
265 | EmptyF0b => sample_f0_0_empty, |
|
265 | EmptyF0b => sample_f0_0_empty, | |
266 | EmptyF1 => sample_f1_empty, |
|
266 | EmptyF1 => sample_f1_empty, | |
267 | EmptyF2 => sample_f3_empty, |
|
267 | EmptyF2 => sample_f3_empty, | |
268 | DataF0a => sample_f0_0_rdata, |
|
268 | DataF0a => sample_f0_0_rdata, | |
269 | DataF0b => sample_f0_1_rdata, |
|
269 | DataF0b => sample_f0_1_rdata, | |
270 | DataF1 => sample_f1_rdata, |
|
270 | DataF1 => sample_f1_rdata, | |
271 | DataF2 => sample_f3_rdata, |
|
271 | DataF2 => sample_f3_rdata, | |
272 | Read_DEMUX => sample_ren, |
|
272 | Read_DEMUX => sample_ren, | |
273 | Empty => demux_empty, |
|
273 | Empty => demux_empty, | |
274 | Data => demux_data); |
|
274 | Data => demux_data); | |
275 |
|
275 | |||
276 | FFT_1 : FFT |
|
276 | FFT_1 : FFT | |
277 | GENERIC MAP ( |
|
277 | GENERIC MAP ( | |
278 | Data_sz => 16, |
|
278 | Data_sz => 16, | |
279 | NbData => 256) |
|
279 | NbData => 256) | |
280 | PORT MAP ( |
|
280 | PORT MAP ( | |
281 | clkm => clk, |
|
281 | clkm => clk, | |
282 | rstn => rstn, |
|
282 | rstn => rstn, | |
283 | FifoIN_Empty => demux_empty, |
|
283 | FifoIN_Empty => demux_empty, | |
284 | FifoIN_Data => demux_data, |
|
284 | FifoIN_Data => demux_data, | |
285 | FifoOUT_Full => fft_fifo_full, |
|
285 | FifoOUT_Full => fft_fifo_full, | |
286 | Read => demux_ren, |
|
286 | Read => demux_ren, | |
287 | Write => fft_fifo_wen, |
|
287 | Write => fft_fifo_wen, | |
288 | ReUse => fft_fifo_reuse, |
|
288 | ReUse => fft_fifo_reuse, | |
289 | Data => fft_fifo_data); |
|
289 | Data => fft_fifo_data); | |
290 |
|
290 | |||
291 | lppFIFO_fft : lppFIFOxN |
|
291 | lppFIFO_fft : lppFIFOxN | |
292 | GENERIC MAP ( |
|
292 | GENERIC MAP ( | |
293 | tech => tech, |
|
293 | tech => tech, | |
294 | Data_sz => 16, |
|
294 | Data_sz => 16, | |
295 | FifoCnt => 5, |
|
295 | FifoCnt => 5, | |
296 | Enable_ReUse => '1') |
|
296 | Enable_ReUse => '1') | |
297 | PORT MAP ( |
|
297 | PORT MAP ( | |
298 | rst => rstn, |
|
298 | rst => rstn, | |
299 | wclk => clk, |
|
299 | wclk => clk, | |
300 | rclk => clk, |
|
300 | rclk => clk, | |
301 | ReUse => fft_fifo_reuse, |
|
301 | ReUse => fft_fifo_reuse, | |
302 | wen => fft_fifo_wen, |
|
302 | wen => fft_fifo_wen, | |
303 | ren => SP_fifo_ren, |
|
303 | ren => SP_fifo_ren, | |
304 | wdata => fft_fifo_data, |
|
304 | wdata => fft_fifo_data, | |
305 | rdata => SP_fifo_data, |
|
305 | rdata => SP_fifo_data, | |
306 | full => fft_fifo_full, |
|
306 | full => fft_fifo_full, | |
307 | empty => OPEN); |
|
307 | empty => OPEN); | |
308 |
|
308 | |||
309 | MatriceSpectrale_1: MatriceSpectrale |
|
309 | MatriceSpectrale_1: MatriceSpectrale | |
310 | GENERIC MAP ( |
|
310 | GENERIC MAP ( | |
311 | Input_SZ => 16, |
|
311 | Input_SZ => 16, | |
312 | Result_SZ => 32) |
|
312 | Result_SZ => 32) | |
313 | PORT MAP ( |
|
313 | PORT MAP ( | |
314 | clkm => clk, |
|
314 | clkm => clk, | |
315 | rstn => rstn, |
|
315 | rstn => rstn, | |
316 |
|
316 | |||
317 | FifoIN_Full => fft_fifo_full, |
|
317 | FifoIN_Full => fft_fifo_full, | |
318 | FifoOUT_Full => , -- TODO |
|
318 | FifoOUT_Full => , -- TODO | |
319 | Data_IN => SP_fifo_data, |
|
319 | Data_IN => SP_fifo_data, | |
320 | ACQ => , -- TODO |
|
320 | ACQ => , -- TODO | |
321 | FlagError => , -- TODO |
|
321 | FlagError => , -- TODO | |
322 | Pong => , -- TODO |
|
322 | Pong => , -- TODO | |
323 | Write => , -- TODO |
|
323 | Write => , -- TODO | |
324 | Read => SP_fifo_ren, |
|
324 | Read => SP_fifo_ren, | |
325 | Data_OUT => ); -- TODO |
|
325 | Data_OUT => ); -- TODO | |
326 |
|
326 | |||
327 |
|
327 | |||
328 | ----------------------------------------------------------------------------- |
|
328 | ----------------------------------------------------------------------------- | |
329 | -- DMA SPECTRAL MATRIX |
|
329 | -- DMA SPECTRAL MATRIX | |
330 | ----------------------------------------------------------------------------- |
|
330 | ----------------------------------------------------------------------------- | |
331 | lpp_dma_ip_1 : lpp_dma_ip |
|
331 | lpp_dma_ip_1 : lpp_dma_ip | |
332 | GENERIC MAP ( |
|
332 | GENERIC MAP ( | |
333 | tech => tech, |
|
333 | tech => tech, | |
334 | hindex => hindex_SpectralMatrix) |
|
334 | hindex => hindex_SpectralMatrix) | |
335 | PORT MAP ( |
|
335 | PORT MAP ( | |
336 | HCLK => clk, |
|
336 | HCLK => clk, | |
337 | HRESETn => rstn, |
|
337 | HRESETn => rstn, | |
338 | AHB_Master_In => AHB_DMA_SpectralMatrix_In, |
|
338 | AHB_Master_In => AHB_DMA_SpectralMatrix_In, | |
339 | AHB_Master_Out => AHB_DMA_SpectralMatrix_Out, |
|
339 | AHB_Master_Out => AHB_DMA_SpectralMatrix_Out, | |
340 |
|
340 | |||
341 | -- Connect to Spectral Matrix -- |
|
341 | -- Connect to Spectral Matrix -- | |
342 | fifo_data => fifo_data, |
|
342 | fifo_data => fifo_data, | |
343 | fifo_empty => fifo_empty, |
|
343 | fifo_empty => fifo_empty, | |
344 | fifo_ren => fifo_ren, |
|
344 | fifo_ren => fifo_ren, | |
345 | header => header, |
|
345 | header => header, | |
346 | header_val => header_val, |
|
346 | header_val => header_val, | |
347 | header_ack => header_ack, |
|
347 | header_ack => header_ack, | |
348 |
|
348 | |||
349 | -- APB REG |
|
349 | -- APB REG | |
350 |
|
350 | |||
351 | ready_matrix_f0_0 => ready_matrix_f0_0, |
|
351 | ready_matrix_f0_0 => ready_matrix_f0_0, | |
352 | ready_matrix_f0_1 => ready_matrix_f0_1, |
|
352 | ready_matrix_f0_1 => ready_matrix_f0_1, | |
353 | ready_matrix_f1 => ready_matrix_f1, |
|
353 | ready_matrix_f1 => ready_matrix_f1, | |
354 | ready_matrix_f2 => ready_matrix_f2, |
|
354 | ready_matrix_f2 => ready_matrix_f2, | |
355 | error_anticipating_empty_fifo => error_anticipating_empty_fifo, |
|
355 | error_anticipating_empty_fifo => error_anticipating_empty_fifo, | |
356 | error_bad_component_error => error_bad_component_error, |
|
356 | error_bad_component_error => error_bad_component_error, | |
357 | debug_reg => debug_reg, |
|
357 | debug_reg => debug_reg, | |
358 | status_ready_matrix_f0_0 => status_ready_matrix_f0_0, |
|
358 | status_ready_matrix_f0_0 => status_ready_matrix_f0_0, | |
359 | status_ready_matrix_f0_1 => status_ready_matrix_f0_1, |
|
359 | status_ready_matrix_f0_1 => status_ready_matrix_f0_1, | |
360 | status_ready_matrix_f1 => status_ready_matrix_f1, |
|
360 | status_ready_matrix_f1 => status_ready_matrix_f1, | |
361 | status_ready_matrix_f2 => status_ready_matrix_f2, |
|
361 | status_ready_matrix_f2 => status_ready_matrix_f2, | |
362 | status_error_anticipating_empty_fifo => status_error_anticipating_empty_fifo, |
|
362 | status_error_anticipating_empty_fifo => status_error_anticipating_empty_fifo, | |
363 | status_error_bad_component_error => status_error_bad_component_error, |
|
363 | status_error_bad_component_error => status_error_bad_component_error, | |
364 | config_active_interruption_onNewMatrix => config_active_interruption_onNewMatrix, |
|
364 | config_active_interruption_onNewMatrix => config_active_interruption_onNewMatrix, | |
365 | config_active_interruption_onError => config_active_interruption_onError, |
|
365 | config_active_interruption_onError => config_active_interruption_onError, | |
366 | addr_matrix_f0_0 => addr_matrix_f0_0, |
|
366 | addr_matrix_f0_0 => addr_matrix_f0_0, | |
367 | addr_matrix_f0_1 => addr_matrix_f0_1, |
|
367 | addr_matrix_f0_1 => addr_matrix_f0_1, | |
368 | addr_matrix_f1 => addr_matrix_f1, |
|
368 | addr_matrix_f1 => addr_matrix_f1, | |
369 | addr_matrix_f2 => addr_matrix_f2); |
|
369 | addr_matrix_f2 => addr_matrix_f2); | |
370 |
|
370 | |||
371 | lpp_top_apbreg_1 : lpp_top_apbreg |
|
371 | lpp_top_apbreg_1 : lpp_top_apbreg | |
372 | GENERIC MAP ( |
|
372 | GENERIC MAP ( | |
373 | pindex => pindex, |
|
373 | pindex => pindex, | |
374 | paddr => paddr, |
|
374 | paddr => paddr, | |
375 | pmask => pmask, |
|
375 | pmask => pmask, | |
376 | pirq => pirq) |
|
376 | pirq => pirq) | |
377 | PORT MAP ( |
|
377 | PORT MAP ( | |
378 | HCLK => clk, |
|
378 | HCLK => clk, | |
379 | HRESETn => rstn, |
|
379 | HRESETn => rstn, | |
380 | apbi => apbi, |
|
380 | apbi => apbi, | |
381 | apbo => apbo, |
|
381 | apbo => apbo, | |
382 |
|
382 | |||
383 | ready_matrix_f0_0 => ready_matrix_f0_0, |
|
383 | ready_matrix_f0_0 => ready_matrix_f0_0, | |
384 | ready_matrix_f0_1 => ready_matrix_f0_1, |
|
384 | ready_matrix_f0_1 => ready_matrix_f0_1, | |
385 | ready_matrix_f1 => ready_matrix_f1, |
|
385 | ready_matrix_f1 => ready_matrix_f1, | |
386 | ready_matrix_f2 => ready_matrix_f2, |
|
386 | ready_matrix_f2 => ready_matrix_f2, | |
387 | error_anticipating_empty_fifo => error_anticipating_empty_fifo, |
|
387 | error_anticipating_empty_fifo => error_anticipating_empty_fifo, | |
388 | error_bad_component_error => error_bad_component_error, |
|
388 | error_bad_component_error => error_bad_component_error, | |
389 | debug_reg => debug_reg, |
|
389 | debug_reg => debug_reg, | |
390 | status_ready_matrix_f0_0 => status_ready_matrix_f0_0, |
|
390 | status_ready_matrix_f0_0 => status_ready_matrix_f0_0, | |
391 | status_ready_matrix_f0_1 => status_ready_matrix_f0_1, |
|
391 | status_ready_matrix_f0_1 => status_ready_matrix_f0_1, | |
392 | status_ready_matrix_f1 => status_ready_matrix_f1, |
|
392 | status_ready_matrix_f1 => status_ready_matrix_f1, | |
393 | status_ready_matrix_f2 => status_ready_matrix_f2, |
|
393 | status_ready_matrix_f2 => status_ready_matrix_f2, | |
394 | status_error_anticipating_empty_fifo => status_error_anticipating_empty_fifo, |
|
394 | status_error_anticipating_empty_fifo => status_error_anticipating_empty_fifo, | |
395 | status_error_bad_component_error => status_error_bad_component_error, |
|
395 | status_error_bad_component_error => status_error_bad_component_error, | |
396 | config_active_interruption_onNewMatrix => config_active_interruption_onNewMatrix, |
|
396 | config_active_interruption_onNewMatrix => config_active_interruption_onNewMatrix, | |
397 | config_active_interruption_onError => config_active_interruption_onError, |
|
397 | config_active_interruption_onError => config_active_interruption_onError, | |
398 | addr_matrix_f0_0 => addr_matrix_f0_0, |
|
398 | addr_matrix_f0_0 => addr_matrix_f0_0, | |
399 | addr_matrix_f0_1 => addr_matrix_f0_1, |
|
399 | addr_matrix_f0_1 => addr_matrix_f0_1, | |
400 | addr_matrix_f1 => addr_matrix_f1, |
|
400 | addr_matrix_f1 => addr_matrix_f1, | |
401 | addr_matrix_f2 => addr_matrix_f2); |
|
401 | addr_matrix_f2 => addr_matrix_f2); | |
402 |
|
402 | |||
403 |
|
403 | |||
404 |
-- |
|
404 | --DONE : add the irq alert for DMA matrix transfert ending | |
|
405 | ||||
405 |
|
|
406 | --TODO : add 5 bit register into APB to control the DATA SHIPING | |
|
407 | --TODO : data shiping | |||
|
408 | ||||
406 |
|
|
409 | --TODO : add Spectral Matrix (FFT + SP) | |
407 | --TODO : add DMA for WaveForms Picker |
|
410 | --TODO : add DMA for WaveForms Picker | |
408 | --TODO : add APB Reg to control WaveForms Picker |
|
411 | --TODO : add APB Reg to control WaveForms Picker | |
409 | --TODO : add WaveForms Picker |
|
412 | --TODO : add WaveForms Picker | |
410 |
|
413 | |||
411 | END tb; |
|
414 | END tb; |
General Comments 0
You need to be logged in to leave comments.
Login now