##// END OF EJS Templates
1.1.34 : idem 1.1.33 avec reset soft pour LFR subsystem
pellion -
r463:832e74562224 (LFR-EM) WFP_MS-1-1-34 JC
parent child
Show More
@@ -139,6 +139,9 ARCHITECTURE beh OF LFR_em IS
139 -----------------------------------------------------------------------------
139 -----------------------------------------------------------------------------
140 SIGNAL rstn : STD_LOGIC;
140 SIGNAL rstn : STD_LOGIC;
141
141
142 SIGNAL LFR_soft_rstn : STD_LOGIC;
143 SIGNAL LFR_rstn : STD_LOGIC;
144
142 SIGNAL ADC_smpclk_s : STD_LOGIC;
145 SIGNAL ADC_smpclk_s : STD_LOGIC;
143
146
144 BEGIN -- beh
147 BEGIN -- beh
@@ -252,7 +255,9 BEGIN -- beh
252 apbi => apbi_ext,
255 apbi => apbi_ext,
253 apbo => apbo_ext(6),
256 apbo => apbo_ext(6),
254 coarse_time => coarse_time,
257 coarse_time => coarse_time,
255 fine_time => fine_time);
258 fine_time => fine_time,
259 LFR_soft_rstn => LFR_soft_rstn
260 );
256
261
257 -----------------------------------------------------------------------
262 -----------------------------------------------------------------------
258 --- SpaceWire --------------------------------------------------------
263 --- SpaceWire --------------------------------------------------------
@@ -343,6 +348,8 BEGIN -- beh
343 -------------------------------------------------------------------------------
348 -------------------------------------------------------------------------------
344 -- LFR ------------------------------------------------------------------------
349 -- LFR ------------------------------------------------------------------------
345 -------------------------------------------------------------------------------
350 -------------------------------------------------------------------------------
351 LFR_rstn <= LFR_soft_rstn AND rstn;
352
346 lpp_lfr_1 : lpp_lfr
353 lpp_lfr_1 : lpp_lfr
347 GENERIC MAP (
354 GENERIC MAP (
348 Mem_use => use_RAM,
355 Mem_use => use_RAM,
@@ -357,13 +364,13 BEGIN -- beh
357 pirq_ms => 6,
364 pirq_ms => 6,
358 pirq_wfp => 14,
365 pirq_wfp => 14,
359 hindex => 2,
366 hindex => 2,
360 top_lfr_version => X"010121") -- aa.bb.cc version
367 top_lfr_version => X"010122") -- aa.bb.cc version
361 -- AA : BOARD NUMBER
368 -- AA : BOARD NUMBER
362 -- 0 => MINI_LFR
369 -- 0 => MINI_LFR
363 -- 1 => EM
370 -- 1 => EM
364 PORT MAP (
371 PORT MAP (
365 clk => clk_25,
372 clk => clk_25,
366 rstn => rstn,
373 rstn => LFR_rstn,
367 sample_B => sample_s(2 DOWNTO 0),
374 sample_B => sample_s(2 DOWNTO 0),
368 sample_E => sample_s(7 DOWNTO 3),
375 sample_E => sample_s(7 DOWNTO 3),
369 sample_val => sample_val,
376 sample_val => sample_val,
@@ -122,12 +122,12 ARCHITECTURE beh OF MINI_LFR_top IS
122 --
122 --
123 SIGNAL errorn : STD_LOGIC;
123 SIGNAL errorn : STD_LOGIC;
124 -- UART AHB ---------------------------------------------------------------
124 -- UART AHB ---------------------------------------------------------------
125 SIGNAL ahbrxd : STD_ULOGIC; -- DSU rx data
125 -- SIGNAL ahbrxd : STD_ULOGIC; -- DSU rx data
126 SIGNAL ahbtxd : STD_ULOGIC; -- DSU tx data
126 -- SIGNAL ahbtxd : STD_ULOGIC; -- DSU tx data
127
127
128 -- UART APB ---------------------------------------------------------------
128 -- UART APB ---------------------------------------------------------------
129 SIGNAL urxd1 : STD_ULOGIC; -- UART1 rx data
129 -- SIGNAL urxd1 : STD_ULOGIC; -- UART1 rx data
130 SIGNAL utxd1 : STD_ULOGIC; -- UART1 tx data
130 -- SIGNAL utxd1 : STD_ULOGIC; -- UART1 tx data
131 --
131 --
132 SIGNAL I00_s : STD_LOGIC;
132 SIGNAL I00_s : STD_LOGIC;
133
133
@@ -439,6 +439,8 BEGIN -- beh
439 dconnect => swni.dconnect(j*2+1 DOWNTO j*2));
439 dconnect => swni.dconnect(j*2+1 DOWNTO j*2));
440 END GENERATE spw_inputloop;
440 END GENERATE spw_inputloop;
441
441
442 swni.rmapnodeaddr <= (others => '0');
443
442 -- SPW core
444 -- SPW core
443 sw0 : grspwm GENERIC MAP(
445 sw0 : grspwm GENERIC MAP(
444 tech => apa3e,
446 tech => apa3e,
@@ -514,12 +516,14 BEGIN -- beh
514 fine_time => fine_time,
516 fine_time => fine_time,
515 data_shaping_BW => bias_fail_sw_sig);
517 data_shaping_BW => bias_fail_sw_sig);
516
518
519 observation_reg <= (others => '0');
520 observation_vector_0 <= (others => '0');
521 observation_vector_1 <= (others => '0');
522
517 all_sample: FOR I IN 7 DOWNTO 0 GENERATE
523 all_sample: FOR I IN 7 DOWNTO 0 GENERATE
518 sample_s(I) <= sample(I)(11 DOWNTO 0) & '0' & '0' & '0' & '0';
524 sample_s(I) <= sample(I)(11 DOWNTO 0) & '0' & '0' & '0' & '0';
519 END GENERATE all_sample;
525 END GENERATE all_sample;
520
526
521
522
523 top_ad_conv_ADS7886_v2_1 : top_ad_conv_ADS7886_v2
527 top_ad_conv_ADS7886_v2_1 : top_ad_conv_ADS7886_v2
524 GENERIC MAP(
528 GENERIC MAP(
525 ChannelCount => 8,
529 ChannelCount => 8,
@@ -556,6 +560,9 BEGIN -- beh
556 GENERIC MAP(pindex => 11, paddr => 11, imask => 16#0000#, nbits => 8)
560 GENERIC MAP(pindex => 11, paddr => 11, imask => 16#0000#, nbits => 8)
557 PORT MAP(rstn_25, clk_25, apbi_ext, apbo_ext(11), gpioi, gpioo);
561 PORT MAP(rstn_25, clk_25, apbi_ext, apbo_ext(11), gpioi, gpioo);
558
562
563 gpioi.sig_en <= (others => '0');
564 gpioi.sig_in <= (others => '0');
565 gpioi.din <= (others => '0');
559 --pio_pad_0 : iopad
566 --pio_pad_0 : iopad
560 -- GENERIC MAP (tech => CFG_PADTECH)
567 -- GENERIC MAP (tech => CFG_PADTECH)
561 -- PORT MAP (IO0, gpioo.dout(0), gpioo.oen(0), gpioi.din(0));
568 -- PORT MAP (IO0, gpioo.dout(0), gpioo.oen(0), gpioi.din(0));
@@ -688,4 +695,4 BEGIN -- beh
688 END GENERATE ahbo_m_ext_not_used;
695 END GENERATE ahbo_m_ext_not_used;
689 END GENERATE all_ahbo_m_ext;
696 END GENERATE all_ahbo_m_ext;
690
697
691 END beh;
698 END beh; No newline at end of file
@@ -19,6 +19,9 USE lpp.lpp_sim_pkg.ALL;
19 USE lpp.lpp_lfr_apbreg_pkg.ALL;
19 USE lpp.lpp_lfr_apbreg_pkg.ALL;
20 USE lpp.lpp_lfr_time_management_apbreg_pkg.ALL;
20 USE lpp.lpp_lfr_time_management_apbreg_pkg.ALL;
21
21
22 LIBRARY postlayout;
23 USE postlayout.ALL;
24
22 ENTITY testbench IS
25 ENTITY testbench IS
23 END;
26 END;
24
27
@@ -84,8 +84,8 ARCHITECTURE ar_MAC OF MAC IS
84 -- SIGNAL clr_MAC_D_D : STD_LOGIC;
84 -- SIGNAL clr_MAC_D_D : STD_LOGIC;
85 -- SIGNAL MAC_MUL_ADD_2C_D : STD_LOGIC_VECTOR(1 DOWNTO 0);
85 -- SIGNAL MAC_MUL_ADD_2C_D : STD_LOGIC_VECTOR(1 DOWNTO 0);
86
86
87 SIGNAL load_mult_result : STD_LOGIC;
87 -- SIGNAL load_mult_result : STD_LOGIC;
88 SIGNAL load_mult_result_D : STD_LOGIC;
88 -- SIGNAL load_mult_result_D : STD_LOGIC;
89
89
90 BEGIN
90 BEGIN
91
91
@@ -100,7 +100,7 BEGIN
100 ctrl => MAC_MUL_ADD_s,
100 ctrl => MAC_MUL_ADD_s,
101 MULT => mult,
101 MULT => mult,
102 ADD => add,
102 ADD => add,
103 LOAD_ADDER => load_mult_result,
103 --LOAD_ADDER => load_mult_result,
104 MACMUX_sel => MACMUXsel,
104 MACMUX_sel => MACMUXsel,
105 MACMUX2_sel => MACMUX2sel
105 MACMUX2_sel => MACMUX2sel
106
106
@@ -128,14 +128,14 BEGIN
128 );
128 );
129 --==============================================================
129 --==============================================================
130
130
131 PROCESS (clk, reset)
131 --PROCESS (clk, reset)
132 BEGIN -- PROCESS
132 --BEGIN -- PROCESS
133 IF reset = '0' THEN -- asynchronous reset (active low)
133 -- IF reset = '0' THEN -- asynchronous reset (active low)
134 load_mult_result_D <= '0';
134 -- load_mult_result_D <= '0';
135 ELSIF clk'EVENT AND clk = '1' THEN -- rising clock edge
135 -- ELSIF clk'EVENT AND clk = '1' THEN -- rising clock edge
136 load_mult_result_D <= load_mult_result;
136 -- load_mult_result_D <= load_mult_result;
137 END IF;
137 -- END IF;
138 END PROCESS;
138 --END PROCESS;
139
139
140 --==============================================================
140 --==============================================================
141 --======================A D D E R ==============================
141 --======================A D D E R ==============================
@@ -149,7 +149,7 BEGIN
149 clk => clk,
149 clk => clk,
150 reset => reset,
150 reset => reset,
151 clr => clr_MAC_D,
151 clr => clr_MAC_D,
152 load => load_mult_result_D,
152 load => MACMUX2sel_D, --load_mult_result_D,
153 add => add_D,
153 add => add_D,
154 OP1 => ADDERinA,
154 OP1 => ADDERinA,
155 OP2 => ADDERinB,
155 OP2 => ADDERinB,
@@ -186,7 +186,6 BEGIN
186 RES => OP2_2C
186 RES => OP2_2C
187 );
187 );
188
188
189
190 clr_MACREG_comp : MAC_REG
189 clr_MACREG_comp : MAC_REG
191 GENERIC MAP(size => 1)
190 GENERIC MAP(size => 1)
192 PORT MAP(
191 PORT MAP(
@@ -31,7 +31,7 port(
31 ctrl : in std_logic_vector(1 downto 0);
31 ctrl : in std_logic_vector(1 downto 0);
32 MULT : out std_logic;
32 MULT : out std_logic;
33 ADD : out std_logic;
33 ADD : out std_logic;
34 LOAD_ADDER : out std_logic;
34 -- LOAD_ADDER : out std_logic;
35 MACMUX_sel : out std_logic;
35 MACMUX_sel : out std_logic;
36 MACMUX2_sel : out std_logic
36 MACMUX2_sel : out std_logic
37
37
@@ -50,7 +50,7 begin
50
50
51 MULT <= '0' when (ctrl = "00" or ctrl = "11") else '1';
51 MULT <= '0' when (ctrl = "00" or ctrl = "11") else '1';
52 ADD <= '0' when (ctrl = "00" or ctrl = "10") else '1';
52 ADD <= '0' when (ctrl = "00" or ctrl = "10") else '1';
53 LOAD_ADDER <= '1' when (ctrl = "10") else '0'; -- PATCH JC : mem mult result
53 --LOAD_ADDER <= '1' when ( ctrl = "10") else '0'; -- PATCH JC : mem mult result
54 -- to permit to compute a
54 -- to permit to compute a
55 -- MULT follow by a MAC
55 -- MULT follow by a MAC
56 --MACMUX_sel <= '0' when (ctrl = "00" or ctrl = "01") else '1';
56 --MACMUX_sel <= '0' when (ctrl = "00" or ctrl = "01") else '1';
@@ -217,7 +217,7 Constant CLR_MAC_V0 : std_logic_vector(3
217 ctrl : IN STD_LOGIC_VECTOR(1 DOWNTO 0);
217 ctrl : IN STD_LOGIC_VECTOR(1 DOWNTO 0);
218 MULT : OUT STD_LOGIC;
218 MULT : OUT STD_LOGIC;
219 ADD : OUT STD_LOGIC;
219 ADD : OUT STD_LOGIC;
220 LOAD_ADDER : out std_logic;
220 -- LOAD_ADDER : out std_logic;
221 MACMUX_sel : OUT STD_LOGIC;
221 MACMUX_sel : OUT STD_LOGIC;
222 MACMUX2_sel : OUT STD_LOGIC
222 MACMUX2_sel : OUT STD_LOGIC
223 );
223 );
@@ -57,7 +57,7 ARCHITECTURE ar_ADS7886_drvr_v2 OF ADS78
57 SIGNAL cnv_sync_r : STD_LOGIC;
57 SIGNAL cnv_sync_r : STD_LOGIC;
58 SIGNAL cnv_done : STD_LOGIC;
58 SIGNAL cnv_done : STD_LOGIC;
59 SIGNAL sample_bit_counter : INTEGER;
59 SIGNAL sample_bit_counter : INTEGER;
60 SIGNAL shift_reg : Samples(ChannelCount-1 DOWNTO 0);
60 SIGNAL shift_reg : Samples_15(ChannelCount-1 DOWNTO 0);
61
61
62 BEGIN
62 BEGIN
63
63
@@ -82,7 +82,7 cnv_sync <= cnv_clk;
82 BEGIN -- PROCESS
82 BEGIN -- PROCESS
83 IF rstn = '0' THEN
83 IF rstn = '0' THEN
84 FOR k IN 0 TO ChannelCount-1 LOOP
84 FOR k IN 0 TO ChannelCount-1 LOOP
85 shift_reg(k)(15 downto 0) <= (OTHERS => '0');
85 shift_reg(k)(14 downto 0) <= (OTHERS => '0');
86 sample(k)(15 downto 0) <= (OTHERS => '0');
86 sample(k)(15 downto 0) <= (OTHERS => '0');
87 END LOOP;
87 END LOOP;
88 sample_bit_counter <= 0;
88 sample_bit_counter <= 0;
@@ -107,7 +107,7 cnv_sync <= cnv_clk;
107 IF (sample_bit_counter MOD 2) = 1 THEN -- get data on each channel
107 IF (sample_bit_counter MOD 2) = 1 THEN -- get data on each channel
108 FOR k IN 0 TO ChannelCount-1 LOOP
108 FOR k IN 0 TO ChannelCount-1 LOOP
109 shift_reg(k)(0) <= sdo(k);
109 shift_reg(k)(0) <= sdo(k);
110 shift_reg(k)(15 DOWNTO 1) <= shift_reg(k)(14 DOWNTO 0);
110 shift_reg(k)(14 DOWNTO 1) <= shift_reg(k)(13 DOWNTO 0);
111 END LOOP;
111 END LOOP;
112 SCK <= '0';
112 SCK <= '0';
113 ELSE
113 ELSE
@@ -116,4 +116,4 cnv_sync <= cnv_clk;
116 END IF;
116 END IF;
117 END PROCESS;
117 END PROCESS;
118
118
119 END ar_ADS7886_drvr_v2; No newline at end of file
119 END ar_ADS7886_drvr_v2;
@@ -48,6 +48,7 PACKAGE lpp_ad_conv IS
48 --TYPE AD7688_in IS ARRAY(NATURAL RANGE <>) OF AD7688_in_element;
48 --TYPE AD7688_in IS ARRAY(NATURAL RANGE <>) OF AD7688_in_element;
49
49
50 TYPE Samples IS ARRAY(NATURAL RANGE <>) OF STD_LOGIC_VECTOR(15 DOWNTO 0);
50 TYPE Samples IS ARRAY(NATURAL RANGE <>) OF STD_LOGIC_VECTOR(15 DOWNTO 0);
51 TYPE Samples_15 IS ARRAY(NATURAL RANGE <>) OF STD_LOGIC_VECTOR(14 DOWNTO 0);
51
52
52 SUBTYPE Samples24 IS STD_LOGIC_VECTOR(23 DOWNTO 0);
53 SUBTYPE Samples24 IS STD_LOGIC_VECTOR(23 DOWNTO 0);
53
54
@@ -91,11 +91,11 ARCHITECTURE beh OF lpp_lfr IS
91
91
92 -- SM
92 -- SM
93 SIGNAL ready_matrix_f0 : STD_LOGIC;
93 SIGNAL ready_matrix_f0 : STD_LOGIC;
94 SIGNAL ready_matrix_f0_1 : STD_LOGIC;
94 -- SIGNAL ready_matrix_f0_1 : STD_LOGIC;
95 SIGNAL ready_matrix_f1 : STD_LOGIC;
95 SIGNAL ready_matrix_f1 : STD_LOGIC;
96 SIGNAL ready_matrix_f2 : STD_LOGIC;
96 SIGNAL ready_matrix_f2 : STD_LOGIC;
97 SIGNAL status_ready_matrix_f0 : STD_LOGIC;
97 SIGNAL status_ready_matrix_f0 : STD_LOGIC;
98 SIGNAL status_ready_matrix_f0_1 : STD_LOGIC;
98 -- SIGNAL status_ready_matrix_f0_1 : STD_LOGIC;
99 SIGNAL status_ready_matrix_f1 : STD_LOGIC;
99 SIGNAL status_ready_matrix_f1 : STD_LOGIC;
100 SIGNAL status_ready_matrix_f2 : STD_LOGIC;
100 SIGNAL status_ready_matrix_f2 : STD_LOGIC;
101 SIGNAL addr_matrix_f0 : STD_LOGIC_VECTOR(31 DOWNTO 0);
101 SIGNAL addr_matrix_f0 : STD_LOGIC_VECTOR(31 DOWNTO 0);
@@ -129,24 +129,24 ARCHITECTURE beh OF lpp_lfr IS
129 -----------------------------------------------------------------------------
129 -----------------------------------------------------------------------------
130 --
130 --
131 -----------------------------------------------------------------------------
131 -----------------------------------------------------------------------------
132 SIGNAL data_f0_addr_out_s : STD_LOGIC_VECTOR(31 DOWNTO 0);
132 -- SIGNAL data_f0_addr_out_s : STD_LOGIC_VECTOR(31 DOWNTO 0);
133 SIGNAL data_f0_data_out_valid_s : STD_LOGIC;
133 -- SIGNAL data_f0_data_out_valid_s : STD_LOGIC;
134 SIGNAL data_f0_data_out_valid_burst_s : STD_LOGIC;
134 -- SIGNAL data_f0_data_out_valid_burst_s : STD_LOGIC;
135 --f1
135 --f1
136 SIGNAL data_f1_addr_out_s : STD_LOGIC_VECTOR(31 DOWNTO 0);
136 -- SIGNAL data_f1_addr_out_s : STD_LOGIC_VECTOR(31 DOWNTO 0);
137 SIGNAL data_f1_data_out_valid_s : STD_LOGIC;
137 -- SIGNAL data_f1_data_out_valid_s : STD_LOGIC;
138 SIGNAL data_f1_data_out_valid_burst_s : STD_LOGIC;
138 -- SIGNAL data_f1_data_out_valid_burst_s : STD_LOGIC;
139 --f2
139 --f2
140 SIGNAL data_f2_addr_out_s : STD_LOGIC_VECTOR(31 DOWNTO 0);
140 -- SIGNAL data_f2_addr_out_s : STD_LOGIC_VECTOR(31 DOWNTO 0);
141 SIGNAL data_f2_data_out_valid_s : STD_LOGIC;
141 -- SIGNAL data_f2_data_out_valid_s : STD_LOGIC;
142 SIGNAL data_f2_data_out_valid_burst_s : STD_LOGIC;
142 -- SIGNAL data_f2_data_out_valid_burst_s : STD_LOGIC;
143 --f3
143 --f3
144 SIGNAL data_f3_addr_out_s : STD_LOGIC_VECTOR(31 DOWNTO 0);
144 -- SIGNAL data_f3_addr_out_s : STD_LOGIC_VECTOR(31 DOWNTO 0);
145 SIGNAL data_f3_data_out_valid_s : STD_LOGIC;
145 -- SIGNAL data_f3_data_out_valid_s : STD_LOGIC;
146 SIGNAL data_f3_data_out_valid_burst_s : STD_LOGIC;
146 -- SIGNAL data_f3_data_out_valid_burst_s : STD_LOGIC;
147
147
148 SIGNAL wfp_status_buffer_ready : STD_LOGIC_VECTOR(3 DOWNTO 0);
148 SIGNAL wfp_status_buffer_ready : STD_LOGIC_VECTOR(3 DOWNTO 0);
149 SIGNAL wfp_addr_buffer : STD_LOGIC_VECTOR(32*4 DOWNTO 0);
149 SIGNAL wfp_addr_buffer : STD_LOGIC_VECTOR(32*4-1 DOWNTO 0);
150 SIGNAL wfp_length_buffer : STD_LOGIC_VECTOR(25 DOWNTO 0);
150 SIGNAL wfp_length_buffer : STD_LOGIC_VECTOR(25 DOWNTO 0);
151 SIGNAL wfp_ready_buffer : STD_LOGIC_VECTOR(3 DOWNTO 0);
151 SIGNAL wfp_ready_buffer : STD_LOGIC_VECTOR(3 DOWNTO 0);
152 SIGNAL wfp_buffer_time : STD_LOGIC_VECTOR(48*4-1 DOWNTO 0);
152 SIGNAL wfp_buffer_time : STD_LOGIC_VECTOR(48*4-1 DOWNTO 0);
@@ -154,51 +154,51 ARCHITECTURE beh OF lpp_lfr IS
154 -----------------------------------------------------------------------------
154 -----------------------------------------------------------------------------
155 -- DMA RR
155 -- DMA RR
156 -----------------------------------------------------------------------------
156 -----------------------------------------------------------------------------
157 SIGNAL dma_sel_valid : STD_LOGIC;
157 -- SIGNAL dma_sel_valid : STD_LOGIC;
158 SIGNAL dma_rr_valid : STD_LOGIC_VECTOR(3 DOWNTO 0);
158 -- SIGNAL dma_rr_valid : STD_LOGIC_VECTOR(3 DOWNTO 0);
159 SIGNAL dma_rr_grant_s : STD_LOGIC_VECTOR(3 DOWNTO 0);
159 -- SIGNAL dma_rr_grant_s : STD_LOGIC_VECTOR(3 DOWNTO 0);
160 SIGNAL dma_rr_grant_ms : STD_LOGIC_VECTOR(3 DOWNTO 0);
160 -- SIGNAL dma_rr_grant_ms : STD_LOGIC_VECTOR(3 DOWNTO 0);
161 SIGNAL dma_rr_valid_ms : STD_LOGIC_VECTOR(3 DOWNTO 0);
161 -- SIGNAL dma_rr_valid_ms : STD_LOGIC_VECTOR(3 DOWNTO 0);
162
162
163 SIGNAL dma_rr_grant : STD_LOGIC_VECTOR(4 DOWNTO 0);
163 -- SIGNAL dma_rr_grant : STD_LOGIC_VECTOR(4 DOWNTO 0);
164 SIGNAL dma_sel : STD_LOGIC_VECTOR(4 DOWNTO 0);
164 -- SIGNAL dma_sel : STD_LOGIC_VECTOR(4 DOWNTO 0);
165
165
166 -----------------------------------------------------------------------------
166 -----------------------------------------------------------------------------
167 -- DMA_REG
167 -- DMA_REG
168 -----------------------------------------------------------------------------
168 -----------------------------------------------------------------------------
169 SIGNAL ongoing_reg : STD_LOGIC;
169 -- SIGNAL ongoing_reg : STD_LOGIC;
170 SIGNAL dma_sel_reg : STD_LOGIC_VECTOR(3 DOWNTO 0);
170 -- SIGNAL dma_sel_reg : STD_LOGIC_VECTOR(3 DOWNTO 0);
171 SIGNAL dma_send_reg : STD_LOGIC;
171 -- SIGNAL dma_send_reg : STD_LOGIC;
172 SIGNAL dma_valid_burst_reg : STD_LOGIC; -- (1 => BURST , 0 => SINGLE)
172 -- SIGNAL dma_valid_burst_reg : STD_LOGIC; -- (1 => BURST , 0 => SINGLE)
173 SIGNAL dma_address_reg : STD_LOGIC_VECTOR(31 DOWNTO 0);
173 -- SIGNAL dma_address_reg : STD_LOGIC_VECTOR(31 DOWNTO 0);
174 SIGNAL dma_data_reg : STD_LOGIC_VECTOR(31 DOWNTO 0);
174 -- SIGNAL dma_data_reg : STD_LOGIC_VECTOR(31 DOWNTO 0);
175
175
176
176
177 -----------------------------------------------------------------------------
177 -----------------------------------------------------------------------------
178 -- DMA
178 -- DMA
179 -----------------------------------------------------------------------------
179 -----------------------------------------------------------------------------
180 SIGNAL dma_send : STD_LOGIC;
180 -- SIGNAL dma_send : STD_LOGIC;
181 SIGNAL dma_valid_burst : STD_LOGIC; -- (1 => BURST , 0 => SINGLE)
181 -- SIGNAL dma_valid_burst : STD_LOGIC; -- (1 => BURST , 0 => SINGLE)
182 SIGNAL dma_done : STD_LOGIC;
182 -- SIGNAL dma_done : STD_LOGIC;
183 SIGNAL dma_ren : STD_LOGIC;
183 -- SIGNAL dma_ren : STD_LOGIC;
184 SIGNAL dma_address : STD_LOGIC_VECTOR(31 DOWNTO 0);
184 -- SIGNAL dma_address : STD_LOGIC_VECTOR(31 DOWNTO 0);
185 SIGNAL dma_data : STD_LOGIC_VECTOR(31 DOWNTO 0);
185 -- SIGNAL dma_data : STD_LOGIC_VECTOR(31 DOWNTO 0);
186 SIGNAL dma_data_2 : STD_LOGIC_VECTOR(31 DOWNTO 0);
186 -- SIGNAL dma_data_2 : STD_LOGIC_VECTOR(31 DOWNTO 0);
187
187
188 -----------------------------------------------------------------------------
188 -----------------------------------------------------------------------------
189 -- MS
189 -- MS
190 -----------------------------------------------------------------------------
190 -----------------------------------------------------------------------------
191
191
192 SIGNAL data_ms_addr : STD_LOGIC_VECTOR(31 DOWNTO 0);
192 -- SIGNAL data_ms_addr : STD_LOGIC_VECTOR(31 DOWNTO 0);
193 SIGNAL data_ms_data : STD_LOGIC_VECTOR(31 DOWNTO 0);
193 -- SIGNAL data_ms_data : STD_LOGIC_VECTOR(31 DOWNTO 0);
194 SIGNAL data_ms_valid : STD_LOGIC;
194 -- SIGNAL data_ms_valid : STD_LOGIC;
195 SIGNAL data_ms_valid_burst : STD_LOGIC;
195 -- SIGNAL data_ms_valid_burst : STD_LOGIC;
196 SIGNAL data_ms_ren : STD_LOGIC;
196 -- SIGNAL data_ms_ren : STD_LOGIC;
197 SIGNAL data_ms_done : STD_LOGIC;
197 -- SIGNAL data_ms_done : STD_LOGIC;
198 SIGNAL dma_ms_ongoing : STD_LOGIC;
198 -- SIGNAL dma_ms_ongoing : STD_LOGIC;
199
199
200 -- SIGNAL run_ms : STD_LOGIC;
200 -- SIGNAL run_ms : STD_LOGIC;
201 SIGNAL ms_softandhard_rstn : STD_LOGIC;
201 -- SIGNAL ms_softandhard_rstn : STD_LOGIC;
202
202
203 SIGNAL matrix_time_f0 : STD_LOGIC_VECTOR(47 DOWNTO 0);
203 SIGNAL matrix_time_f0 : STD_LOGIC_VECTOR(47 DOWNTO 0);
204 -- SIGNAL matrix_time_f0_1 : STD_LOGIC_VECTOR(47 DOWNTO 0);
204 -- SIGNAL matrix_time_f0_1 : STD_LOGIC_VECTOR(47 DOWNTO 0);
@@ -210,7 +210,7 ARCHITECTURE beh OF lpp_lfr IS
210 SIGNAL error_input_fifo_write : STD_LOGIC_VECTOR(2 DOWNTO 0);
210 SIGNAL error_input_fifo_write : STD_LOGIC_VECTOR(2 DOWNTO 0);
211
211
212 -- SIGNAL debug_ms : STD_LOGIC_VECTOR(31 DOWNTO 0);
212 -- SIGNAL debug_ms : STD_LOGIC_VECTOR(31 DOWNTO 0);
213 SIGNAL debug_signal : STD_LOGIC_VECTOR(31 DOWNTO 0);
213 -- SIGNAL debug_signal : STD_LOGIC_VECTOR(31 DOWNTO 0);
214
214
215 -----------------------------------------------------------------------------
215 -----------------------------------------------------------------------------
216 SIGNAL dma_fifo_burst_valid : STD_LOGIC_VECTOR(4 DOWNTO 0);
216 SIGNAL dma_fifo_burst_valid : STD_LOGIC_VECTOR(4 DOWNTO 0);
@@ -133,7 +133,7 ENTITY lpp_lfr_apbreg IS
133 start_date : OUT STD_LOGIC_VECTOR(30 DOWNTO 0);
133 start_date : OUT STD_LOGIC_VECTOR(30 DOWNTO 0);
134
134
135 wfp_status_buffer_ready : OUT STD_LOGIC_VECTOR(3 DOWNTO 0);
135 wfp_status_buffer_ready : OUT STD_LOGIC_VECTOR(3 DOWNTO 0);
136 wfp_addr_buffer : OUT STD_LOGIC_VECTOR(32*4 DOWNTO 0);
136 wfp_addr_buffer : OUT STD_LOGIC_VECTOR(32*4-1 DOWNTO 0);
137 wfp_length_buffer : OUT STD_LOGIC_VECTOR(25 DOWNTO 0);
137 wfp_length_buffer : OUT STD_LOGIC_VECTOR(25 DOWNTO 0);
138 wfp_ready_buffer : IN STD_LOGIC_VECTOR(3 DOWNTO 0);
138 wfp_ready_buffer : IN STD_LOGIC_VECTOR(3 DOWNTO 0);
139 wfp_buffer_time : IN STD_LOGIC_VECTOR(48*4-1 DOWNTO 0);
139 wfp_buffer_time : IN STD_LOGIC_VECTOR(48*4-1 DOWNTO 0);
@@ -238,28 +238,28 ARCHITECTURE beh OF lpp_lfr_apbreg IS
238 --
238 --
239 -----------------------------------------------------------------------------
239 -----------------------------------------------------------------------------
240 SIGNAL reg0_ready_matrix_f0 : STD_LOGIC;
240 SIGNAL reg0_ready_matrix_f0 : STD_LOGIC;
241 SIGNAL reg0_addr_matrix_f0 : STD_LOGIC_VECTOR(31 DOWNTO 0);
241 -- SIGNAL reg0_addr_matrix_f0 : STD_LOGIC_VECTOR(31 DOWNTO 0);
242 SIGNAL reg0_matrix_time_f0 : STD_LOGIC_VECTOR(47 DOWNTO 0);
242 -- SIGNAL reg0_matrix_time_f0 : STD_LOGIC_VECTOR(47 DOWNTO 0);
243
243
244 SIGNAL reg1_ready_matrix_f0 : STD_LOGIC;
244 SIGNAL reg1_ready_matrix_f0 : STD_LOGIC;
245 SIGNAL reg1_addr_matrix_f0 : STD_LOGIC_VECTOR(31 DOWNTO 0);
245 -- SIGNAL reg1_addr_matrix_f0 : STD_LOGIC_VECTOR(31 DOWNTO 0);
246 SIGNAL reg1_matrix_time_f0 : STD_LOGIC_VECTOR(47 DOWNTO 0);
246 -- SIGNAL reg1_matrix_time_f0 : STD_LOGIC_VECTOR(47 DOWNTO 0);
247
247
248 SIGNAL reg0_ready_matrix_f1 : STD_LOGIC;
248 SIGNAL reg0_ready_matrix_f1 : STD_LOGIC;
249 SIGNAL reg0_addr_matrix_f1 : STD_LOGIC_VECTOR(31 DOWNTO 0);
249 -- SIGNAL reg0_addr_matrix_f1 : STD_LOGIC_VECTOR(31 DOWNTO 0);
250 SIGNAL reg0_matrix_time_f1 : STD_LOGIC_VECTOR(47 DOWNTO 0);
250 -- SIGNAL reg0_matrix_time_f1 : STD_LOGIC_VECTOR(47 DOWNTO 0);
251
251
252 SIGNAL reg1_ready_matrix_f1 : STD_LOGIC;
252 SIGNAL reg1_ready_matrix_f1 : STD_LOGIC;
253 SIGNAL reg1_addr_matrix_f1 : STD_LOGIC_VECTOR(31 DOWNTO 0);
253 -- SIGNAL reg1_addr_matrix_f1 : STD_LOGIC_VECTOR(31 DOWNTO 0);
254 SIGNAL reg1_matrix_time_f1 : STD_LOGIC_VECTOR(47 DOWNTO 0);
254 -- SIGNAL reg1_matrix_time_f1 : STD_LOGIC_VECTOR(47 DOWNTO 0);
255
255
256 SIGNAL reg0_ready_matrix_f2 : STD_LOGIC;
256 SIGNAL reg0_ready_matrix_f2 : STD_LOGIC;
257 SIGNAL reg0_addr_matrix_f2 : STD_LOGIC_VECTOR(31 DOWNTO 0);
257 -- SIGNAL reg0_addr_matrix_f2 : STD_LOGIC_VECTOR(31 DOWNTO 0);
258 SIGNAL reg0_matrix_time_f2 : STD_LOGIC_VECTOR(47 DOWNTO 0);
258 -- SIGNAL reg0_matrix_time_f2 : STD_LOGIC_VECTOR(47 DOWNTO 0);
259
259
260 SIGNAL reg1_ready_matrix_f2 : STD_LOGIC;
260 SIGNAL reg1_ready_matrix_f2 : STD_LOGIC;
261 SIGNAL reg1_addr_matrix_f2 : STD_LOGIC_VECTOR(31 DOWNTO 0);
261 -- SIGNAL reg1_addr_matrix_f2 : STD_LOGIC_VECTOR(31 DOWNTO 0);
262 SIGNAL reg1_matrix_time_f2 : STD_LOGIC_VECTOR(47 DOWNTO 0);
262 -- SIGNAL reg1_matrix_time_f2 : STD_LOGIC_VECTOR(47 DOWNTO 0);
263 SIGNAL apbo_irq_ms : STD_LOGIC;
263 SIGNAL apbo_irq_ms : STD_LOGIC;
264 SIGNAL apbo_irq_wfp : STD_LOGIC;
264 SIGNAL apbo_irq_wfp : STD_LOGIC;
265 -----------------------------------------------------------------------------
265 -----------------------------------------------------------------------------
@@ -778,4 +778,4 BEGIN -- beh
778
778
779 END beh;
779 END beh;
780
780
781 -------------------------------------------------------------------------------
781 ------------------------------------------------------------------------------- No newline at end of file
@@ -121,7 +121,9 ARCHITECTURE Behavioral OF lpp_lfr_ms IS
121 -----------------------------------------------------------------------------
121 -----------------------------------------------------------------------------
122 TYPE fsm_select_channel IS (IDLE, SWITCH_F0_A, SWITCH_F0_B, SWITCH_F1, SWITCH_F2);
122 TYPE fsm_select_channel IS (IDLE, SWITCH_F0_A, SWITCH_F0_B, SWITCH_F1, SWITCH_F2);
123 SIGNAL state_fsm_select_channel : fsm_select_channel;
123 SIGNAL state_fsm_select_channel : fsm_select_channel;
124 SIGNAL pre_state_fsm_select_channel : fsm_select_channel;
124 -- SIGNAL pre_state_fsm_select_channel : fsm_select_channel;
125 SIGNAL select_channel : STD_LOGIC_VECTOR(1 DOWNTO 0);
126 SIGNAL select_channel_reg : STD_LOGIC_VECTOR(1 DOWNTO 0);
125
127
126 SIGNAL sample_rdata : STD_LOGIC_VECTOR((5*16)-1 DOWNTO 0);
128 SIGNAL sample_rdata : STD_LOGIC_VECTOR((5*16)-1 DOWNTO 0);
127 SIGNAL sample_ren : STD_LOGIC_VECTOR(4 DOWNTO 0);
129 SIGNAL sample_ren : STD_LOGIC_VECTOR(4 DOWNTO 0);
@@ -133,7 +135,9 ARCHITECTURE Behavioral OF lpp_lfr_ms IS
133 -----------------------------------------------------------------------------
135 -----------------------------------------------------------------------------
134 TYPE fsm_load_FFT IS (IDLE, FIFO_1, FIFO_2, FIFO_3, FIFO_4, FIFO_5);
136 TYPE fsm_load_FFT IS (IDLE, FIFO_1, FIFO_2, FIFO_3, FIFO_4, FIFO_5);
135 SIGNAL state_fsm_load_FFT : fsm_load_FFT;
137 SIGNAL state_fsm_load_FFT : fsm_load_FFT;
136 SIGNAL next_state_fsm_load_FFT : fsm_load_FFT;
138 -- SIGNAL next_state_fsm_load_FFT : fsm_load_FFT;
139 SIGNAL select_fifo : STD_LOGIC_VECTOR(2 DOWNTO 0);
140 SIGNAL select_fifo_reg : STD_LOGIC_VECTOR(2 DOWNTO 0);
137
141
138 SIGNAL sample_ren_s : STD_LOGIC_VECTOR(4 DOWNTO 0);
142 SIGNAL sample_ren_s : STD_LOGIC_VECTOR(4 DOWNTO 0);
139 SIGNAL sample_load : STD_LOGIC;
143 SIGNAL sample_load : STD_LOGIC;
@@ -199,7 +203,7 ARCHITECTURE Behavioral OF lpp_lfr_ms IS
199 SIGNAL FSM_DMA_fifo_empty : STD_LOGIC;
203 SIGNAL FSM_DMA_fifo_empty : STD_LOGIC;
200 SIGNAL FSM_DMA_fifo_empty_threshold : STD_LOGIC;
204 SIGNAL FSM_DMA_fifo_empty_threshold : STD_LOGIC;
201 SIGNAL FSM_DMA_fifo_data : STD_LOGIC_VECTOR(31 DOWNTO 0);
205 SIGNAL FSM_DMA_fifo_data : STD_LOGIC_VECTOR(31 DOWNTO 0);
202 SIGNAL FSM_DMA_fifo_status : STD_LOGIC_VECTOR(53 DOWNTO 0);
206 SIGNAL FSM_DMA_fifo_status : STD_LOGIC_VECTOR(53 DOWNTO 4);
203 -----------------------------------------------------------------------------
207 -----------------------------------------------------------------------------
204 SIGNAL MEM_OUT_SM_Write : STD_LOGIC_VECTOR(1 DOWNTO 0);
208 SIGNAL MEM_OUT_SM_Write : STD_LOGIC_VECTOR(1 DOWNTO 0);
205 SIGNAL MEM_OUT_SM_Read : STD_LOGIC_VECTOR(1 DOWNTO 0);
209 SIGNAL MEM_OUT_SM_Read : STD_LOGIC_VECTOR(1 DOWNTO 0);
@@ -233,8 +237,8 ARCHITECTURE Behavioral OF lpp_lfr_ms IS
233 SIGNAL status_MS_input : STD_LOGIC_VECTOR(49 DOWNTO 0);
237 SIGNAL status_MS_input : STD_LOGIC_VECTOR(49 DOWNTO 0);
234 SIGNAL status_component : STD_LOGIC_VECTOR(53 DOWNTO 0);
238 SIGNAL status_component : STD_LOGIC_VECTOR(53 DOWNTO 0);
235
239
236 SIGNAL status_component_fifo_0 : STD_LOGIC_VECTOR(53 DOWNTO 0);
240 SIGNAL status_component_fifo_0 : STD_LOGIC_VECTOR(53 DOWNTO 4);
237 SIGNAL status_component_fifo_1 : STD_LOGIC_VECTOR(53 DOWNTO 0);
241 SIGNAL status_component_fifo_1 : STD_LOGIC_VECTOR(53 DOWNTO 4);
238 SIGNAL status_component_fifo_0_end : STD_LOGIC;
242 SIGNAL status_component_fifo_0_end : STD_LOGIC;
239 SIGNAL status_component_fifo_1_end : STD_LOGIC;
243 SIGNAL status_component_fifo_1_end : STD_LOGIC;
240 -----------------------------------------------------------------------------
244 -----------------------------------------------------------------------------
@@ -471,36 +475,45 BEGIN
471 BEGIN
475 BEGIN
472 IF rstn = '0' THEN
476 IF rstn = '0' THEN
473 state_fsm_select_channel <= IDLE;
477 state_fsm_select_channel <= IDLE;
478 select_channel <= (OTHERS => '0');
474 ELSIF clk'EVENT AND clk = '1' THEN
479 ELSIF clk'EVENT AND clk = '1' THEN
475 CASE state_fsm_select_channel IS
480 CASE state_fsm_select_channel IS
476 WHEN IDLE =>
481 WHEN IDLE =>
477 IF sample_f1_full = "11111" THEN
482 IF sample_f1_full = "11111" THEN
478 state_fsm_select_channel <= SWITCH_F1;
483 state_fsm_select_channel <= SWITCH_F1;
484 select_channel <= "10";
479 ELSIF sample_f1_almost_full = "00000" THEN
485 ELSIF sample_f1_almost_full = "00000" THEN
480 IF sample_f0_A_full = "11111" THEN
486 IF sample_f0_A_full = "11111" THEN
481 state_fsm_select_channel <= SWITCH_F0_A;
487 state_fsm_select_channel <= SWITCH_F0_A;
488 select_channel <= "00";
482 ELSIF sample_f0_B_full = "11111" THEN
489 ELSIF sample_f0_B_full = "11111" THEN
483 state_fsm_select_channel <= SWITCH_F0_B;
490 state_fsm_select_channel <= SWITCH_F0_B;
491 select_channel <= "01";
484 ELSIF sample_f2_full = "11111" THEN
492 ELSIF sample_f2_full = "11111" THEN
485 state_fsm_select_channel <= SWITCH_F2;
493 state_fsm_select_channel <= SWITCH_F2;
494 select_channel <= "11";
486 END IF;
495 END IF;
487 END IF;
496 END IF;
488
497
489 WHEN SWITCH_F0_A =>
498 WHEN SWITCH_F0_A =>
490 IF sample_f0_A_empty = "11111" THEN
499 IF sample_f0_A_empty = "11111" THEN
491 state_fsm_select_channel <= IDLE;
500 state_fsm_select_channel <= IDLE;
501 select_channel <= (OTHERS => '0');
492 END IF;
502 END IF;
493 WHEN SWITCH_F0_B =>
503 WHEN SWITCH_F0_B =>
494 IF sample_f0_B_empty = "11111" THEN
504 IF sample_f0_B_empty = "11111" THEN
495 state_fsm_select_channel <= IDLE;
505 state_fsm_select_channel <= IDLE;
506 select_channel <= (OTHERS => '0');
496 END IF;
507 END IF;
497 WHEN SWITCH_F1 =>
508 WHEN SWITCH_F1 =>
498 IF sample_f1_empty = "11111" THEN
509 IF sample_f1_empty = "11111" THEN
499 state_fsm_select_channel <= IDLE;
510 state_fsm_select_channel <= IDLE;
511 select_channel <= (OTHERS => '0');
500 END IF;
512 END IF;
501 WHEN SWITCH_F2 =>
513 WHEN SWITCH_F2 =>
502 IF sample_f2_empty = "11111" THEN
514 IF sample_f2_empty = "11111" THEN
503 state_fsm_select_channel <= IDLE;
515 state_fsm_select_channel <= IDLE;
516 select_channel <= (OTHERS => '0');
504 END IF;
517 END IF;
505 WHEN OTHERS => NULL;
518 WHEN OTHERS => NULL;
506 END CASE;
519 END CASE;
@@ -511,9 +524,11 BEGIN
511 PROCESS (clk, rstn)
524 PROCESS (clk, rstn)
512 BEGIN
525 BEGIN
513 IF rstn = '0' THEN
526 IF rstn = '0' THEN
514 pre_state_fsm_select_channel <= IDLE;
527 select_channel_reg <= (OTHERS => '0');
528 --pre_state_fsm_select_channel <= IDLE;
515 ELSIF clk'EVENT AND clk = '1' THEN
529 ELSIF clk'EVENT AND clk = '1' THEN
516 pre_state_fsm_select_channel <= state_fsm_select_channel;
530 select_channel_reg <= select_channel;
531 --pre_state_fsm_select_channel <= state_fsm_select_channel;
517 END IF;
532 END IF;
518 END PROCESS;
533 END PROCESS;
519
534
@@ -533,9 +548,13 BEGIN
533 sample_f2_full WHEN state_fsm_select_channel = SWITCH_F2 ELSE
548 sample_f2_full WHEN state_fsm_select_channel = SWITCH_F2 ELSE
534 (OTHERS => '0');
549 (OTHERS => '0');
535
550
536 sample_rdata <= sample_f0_A_rdata WHEN pre_state_fsm_select_channel = SWITCH_F0_A ELSE
551 --sample_rdata <= sample_f0_A_rdata WHEN pre_state_fsm_select_channel = SWITCH_F0_A ELSE
537 sample_f0_B_rdata WHEN pre_state_fsm_select_channel = SWITCH_F0_B ELSE
552 -- sample_f0_B_rdata WHEN pre_state_fsm_select_channel = SWITCH_F0_B ELSE
538 sample_f1_rdata WHEN pre_state_fsm_select_channel = SWITCH_F1 ELSE
553 -- sample_f1_rdata WHEN pre_state_fsm_select_channel = SWITCH_F1 ELSE
554 -- sample_f2_rdata; -- WHEN state_fsm_select_channel = SWITCH_F2 ELSE
555 sample_rdata <= sample_f0_A_rdata WHEN select_channel_reg = "00" ELSE
556 sample_f0_B_rdata WHEN select_channel_reg = "01" ELSE
557 sample_f1_rdata WHEN select_channel_reg = "10" ELSE
539 sample_f2_rdata; -- WHEN state_fsm_select_channel = SWITCH_F2 ELSE
558 sample_f2_rdata; -- WHEN state_fsm_select_channel = SWITCH_F2 ELSE
540
559
541
560
@@ -564,6 +583,7 BEGIN
564 sample_ren_s <= (OTHERS => '1');
583 sample_ren_s <= (OTHERS => '1');
565 state_fsm_load_FFT <= IDLE;
584 state_fsm_load_FFT <= IDLE;
566 status_MS_input <= (OTHERS => '0');
585 status_MS_input <= (OTHERS => '0');
586 select_fifo <= "000";
567 --next_state_fsm_load_FFT <= IDLE;
587 --next_state_fsm_load_FFT <= IDLE;
568 --sample_valid <= '0';
588 --sample_valid <= '0';
569 ELSIF clk'EVENT AND clk = '1' THEN
589 ELSIF clk'EVENT AND clk = '1' THEN
@@ -574,6 +594,7 BEGIN
574 IF sample_full = "11111" AND sample_load = '1' THEN
594 IF sample_full = "11111" AND sample_load = '1' THEN
575 state_fsm_load_FFT <= FIFO_1;
595 state_fsm_load_FFT <= FIFO_1;
576 status_MS_input <= status_channel;
596 status_MS_input <= status_channel;
597 select_fifo <= "000";
577 END IF;
598 END IF;
578
599
579 WHEN FIFO_1 =>
600 WHEN FIFO_1 =>
@@ -581,6 +602,7 BEGIN
581 IF sample_empty(0) = '1' THEN
602 IF sample_empty(0) = '1' THEN
582 sample_ren_s <= (OTHERS => '1');
603 sample_ren_s <= (OTHERS => '1');
583 state_fsm_load_FFT <= FIFO_2;
604 state_fsm_load_FFT <= FIFO_2;
605 select_fifo <= "001";
584 END IF;
606 END IF;
585
607
586 WHEN FIFO_2 =>
608 WHEN FIFO_2 =>
@@ -588,6 +610,7 BEGIN
588 IF sample_empty(1) = '1' THEN
610 IF sample_empty(1) = '1' THEN
589 sample_ren_s <= (OTHERS => '1');
611 sample_ren_s <= (OTHERS => '1');
590 state_fsm_load_FFT <= FIFO_3;
612 state_fsm_load_FFT <= FIFO_3;
613 select_fifo <= "010";
591 END IF;
614 END IF;
592
615
593 WHEN FIFO_3 =>
616 WHEN FIFO_3 =>
@@ -595,6 +618,7 BEGIN
595 IF sample_empty(2) = '1' THEN
618 IF sample_empty(2) = '1' THEN
596 sample_ren_s <= (OTHERS => '1');
619 sample_ren_s <= (OTHERS => '1');
597 state_fsm_load_FFT <= FIFO_4;
620 state_fsm_load_FFT <= FIFO_4;
621 select_fifo <= "011";
598 END IF;
622 END IF;
599
623
600 WHEN FIFO_4 =>
624 WHEN FIFO_4 =>
@@ -602,6 +626,7 BEGIN
602 IF sample_empty(3) = '1' THEN
626 IF sample_empty(3) = '1' THEN
603 sample_ren_s <= (OTHERS => '1');
627 sample_ren_s <= (OTHERS => '1');
604 state_fsm_load_FFT <= FIFO_5;
628 state_fsm_load_FFT <= FIFO_5;
629 select_fifo <= "100";
605 END IF;
630 END IF;
606
631
607 WHEN FIFO_5 =>
632 WHEN FIFO_5 =>
@@ -609,6 +634,7 BEGIN
609 IF sample_empty(4) = '1' THEN
634 IF sample_empty(4) = '1' THEN
610 sample_ren_s <= (OTHERS => '1');
635 sample_ren_s <= (OTHERS => '1');
611 state_fsm_load_FFT <= IDLE;
636 state_fsm_load_FFT <= IDLE;
637 select_fifo <= "000";
612 END IF;
638 END IF;
613 WHEN OTHERS => NULL;
639 WHEN OTHERS => NULL;
614 END CASE;
640 END CASE;
@@ -619,9 +645,11 BEGIN
619 BEGIN
645 BEGIN
620 IF rstn = '0' THEN
646 IF rstn = '0' THEN
621 sample_valid_r <= '0';
647 sample_valid_r <= '0';
622 next_state_fsm_load_FFT <= IDLE;
648 select_fifo_reg <= (OTHERS => '0');
649 --next_state_fsm_load_FFT <= IDLE;
623 ELSIF clk'EVENT AND clk = '1' THEN
650 ELSIF clk'EVENT AND clk = '1' THEN
624 next_state_fsm_load_FFT <= state_fsm_load_FFT;
651 select_fifo_reg <= select_fifo;
652 --next_state_fsm_load_FFT <= state_fsm_load_FFT;
625 IF sample_ren_s = "11111" THEN
653 IF sample_ren_s = "11111" THEN
626 sample_valid_r <= '0';
654 sample_valid_r <= '0';
627 ELSE
655 ELSE
@@ -632,10 +660,15 BEGIN
632
660
633 sample_valid <= '0' WHEN fft_ongoing_counter = '1' ELSE sample_valid_r AND sample_load;
661 sample_valid <= '0' WHEN fft_ongoing_counter = '1' ELSE sample_valid_r AND sample_load;
634
662
635 sample_data <= sample_rdata(16*1-1 DOWNTO 16*0) WHEN next_state_fsm_load_FFT = FIFO_1 ELSE
663 --sample_data <= sample_rdata(16*1-1 DOWNTO 16*0) WHEN next_state_fsm_load_FFT = FIFO_1 ELSE
636 sample_rdata(16*2-1 DOWNTO 16*1) WHEN next_state_fsm_load_FFT = FIFO_2 ELSE
664 -- sample_rdata(16*2-1 DOWNTO 16*1) WHEN next_state_fsm_load_FFT = FIFO_2 ELSE
637 sample_rdata(16*3-1 DOWNTO 16*2) WHEN next_state_fsm_load_FFT = FIFO_3 ELSE
665 -- sample_rdata(16*3-1 DOWNTO 16*2) WHEN next_state_fsm_load_FFT = FIFO_3 ELSE
638 sample_rdata(16*4-1 DOWNTO 16*3) WHEN next_state_fsm_load_FFT = FIFO_4 ELSE
666 -- sample_rdata(16*4-1 DOWNTO 16*3) WHEN next_state_fsm_load_FFT = FIFO_4 ELSE
667 -- sample_rdata(16*5-1 DOWNTO 16*4); --WHEN next_state_fsm_load_FFT = FIFO_5 ELSE
668 sample_data <= sample_rdata(16*1-1 DOWNTO 16*0) WHEN select_fifo_reg = "000" ELSE
669 sample_rdata(16*2-1 DOWNTO 16*1) WHEN select_fifo_reg = "001" ELSE
670 sample_rdata(16*3-1 DOWNTO 16*2) WHEN select_fifo_reg = "010" ELSE
671 sample_rdata(16*4-1 DOWNTO 16*3) WHEN select_fifo_reg = "011" ELSE
639 sample_rdata(16*5-1 DOWNTO 16*4); --WHEN next_state_fsm_load_FFT = FIFO_5 ELSE
672 sample_rdata(16*5-1 DOWNTO 16*4); --WHEN next_state_fsm_load_FFT = FIFO_5 ELSE
640
673
641 -----------------------------------------------------------------------------
674 -----------------------------------------------------------------------------
@@ -852,9 +885,9 BEGIN
852 status_component_fifo_1_end <= '0';
885 status_component_fifo_1_end <= '0';
853 IF SM_correlation_begin = '1' THEN
886 IF SM_correlation_begin = '1' THEN
854 IF current_matrix_write = '0' THEN
887 IF current_matrix_write = '0' THEN
855 status_component_fifo_0 <= status_component;
888 status_component_fifo_0 <= status_component(53 DOWNTO 4);
856 ELSE
889 ELSE
857 status_component_fifo_1 <= status_component;
890 status_component_fifo_1 <= status_component(53 DOWNTO 4);
858 END IF;
891 END IF;
859 END IF;
892 END IF;
860
893
@@ -311,7 +311,7 PACKAGE lpp_lfr_pkg IS
311 run : OUT STD_LOGIC;
311 run : OUT STD_LOGIC;
312 start_date : OUT STD_LOGIC_VECTOR(30 DOWNTO 0);
312 start_date : OUT STD_LOGIC_VECTOR(30 DOWNTO 0);
313 wfp_status_buffer_ready : OUT STD_LOGIC_VECTOR(3 DOWNTO 0);
313 wfp_status_buffer_ready : OUT STD_LOGIC_VECTOR(3 DOWNTO 0);
314 wfp_addr_buffer : OUT STD_LOGIC_VECTOR(32*4 DOWNTO 0);
314 wfp_addr_buffer : OUT STD_LOGIC_VECTOR(32*4-1 DOWNTO 0);
315 wfp_length_buffer : OUT STD_LOGIC_VECTOR(25 DOWNTO 0);
315 wfp_length_buffer : OUT STD_LOGIC_VECTOR(25 DOWNTO 0);
316 wfp_ready_buffer : IN STD_LOGIC_VECTOR(3 DOWNTO 0);
316 wfp_ready_buffer : IN STD_LOGIC_VECTOR(3 DOWNTO 0);
317 wfp_buffer_time : IN STD_LOGIC_VECTOR(48*4-1 DOWNTO 0);
317 wfp_buffer_time : IN STD_LOGIC_VECTOR(48*4-1 DOWNTO 0);
@@ -84,7 +84,7 ENTITY lpp_waveform IS
84
84
85 -- REG DMA
85 -- REG DMA
86 status_buffer_ready : IN STD_LOGIC_VECTOR(3 DOWNTO 0);
86 status_buffer_ready : IN STD_LOGIC_VECTOR(3 DOWNTO 0);
87 addr_buffer : IN STD_LOGIC_VECTOR(32*4 DOWNTO 0);
87 addr_buffer : IN STD_LOGIC_VECTOR(32*4-1 DOWNTO 0);
88 length_buffer : IN STD_LOGIC_VECTOR(25 DOWNTO 0);
88 length_buffer : IN STD_LOGIC_VECTOR(25 DOWNTO 0);
89
89
90 ready_buffer : OUT STD_LOGIC_VECTOR(3 DOWNTO 0);
90 ready_buffer : OUT STD_LOGIC_VECTOR(3 DOWNTO 0);
@@ -73,11 +73,11 ARCHITECTURE ar_lpp_waveform_fifo_arbite
73 -- DATA MUX
73 -- DATA MUX
74 -----------------------------------------------------------------------------
74 -----------------------------------------------------------------------------
75 TYPE WORD_VECTOR IS ARRAY (NATURAL RANGE <>) OF STD_LOGIC_VECTOR(31 DOWNTO 0);
75 TYPE WORD_VECTOR IS ARRAY (NATURAL RANGE <>) OF STD_LOGIC_VECTOR(31 DOWNTO 0);
76 SIGNAL data_0 : WORD_VECTOR(3 DOWNTO 0);
76 SIGNAL data_0 : WORD_VECTOR(2 DOWNTO 0);
77 SIGNAL data_1 : WORD_VECTOR(3 DOWNTO 0);
77 SIGNAL data_1 : WORD_VECTOR(2 DOWNTO 0);
78 SIGNAL data_2 : WORD_VECTOR(3 DOWNTO 0);
78 SIGNAL data_2 : WORD_VECTOR(2 DOWNTO 0);
79 SIGNAL data_3 : WORD_VECTOR(3 DOWNTO 0);
79 SIGNAL data_3 : WORD_VECTOR(2 DOWNTO 0);
80 SIGNAL data_sel : WORD_VECTOR(3 DOWNTO 0);
80 SIGNAL data_sel : WORD_VECTOR(2 DOWNTO 0);
81
81
82 -----------------------------------------------------------------------------
82 -----------------------------------------------------------------------------
83 -- RR and SELECTION
83 -- RR and SELECTION
@@ -267,4 +267,3 END ARCHITECTURE;
267
267
268
268
269
269
270
@@ -113,4 +113,3 END ARCHITECTURE;
113
113
114
114
115
115
116
@@ -129,7 +129,7 PACKAGE lpp_waveform_pkg IS
129 nb_snapshot_param : IN STD_LOGIC_VECTOR(nb_snapshot_param_size-1 DOWNTO 0);
129 nb_snapshot_param : IN STD_LOGIC_VECTOR(nb_snapshot_param_size-1 DOWNTO 0);
130 status_new_err : OUT STD_LOGIC_VECTOR(3 DOWNTO 0);
130 status_new_err : OUT STD_LOGIC_VECTOR(3 DOWNTO 0);
131 status_buffer_ready : IN STD_LOGIC_VECTOR(3 DOWNTO 0);
131 status_buffer_ready : IN STD_LOGIC_VECTOR(3 DOWNTO 0);
132 addr_buffer : IN STD_LOGIC_VECTOR(32*4 DOWNTO 0);
132 addr_buffer : IN STD_LOGIC_VECTOR(32*4-1 DOWNTO 0);
133 length_buffer : IN STD_LOGIC_VECTOR(25 DOWNTO 0);
133 length_buffer : IN STD_LOGIC_VECTOR(25 DOWNTO 0);
134 ready_buffer : OUT STD_LOGIC_VECTOR(3 DOWNTO 0);
134 ready_buffer : OUT STD_LOGIC_VECTOR(3 DOWNTO 0);
135 buffer_time : OUT STD_LOGIC_VECTOR(48*4-1 DOWNTO 0);
135 buffer_time : OUT STD_LOGIC_VECTOR(48*4-1 DOWNTO 0);
General Comments 0
You need to be logged in to leave comments. Login now