@@ -741,8 +741,11 @@ architecture top of afc_ref_fofb_ctrl_gen is
741
741
);
742
742
743
743
constant c_FACQ_PARAMS_SYS_ID : t_facq_chan_param := (
744
- width => to_unsigned (768 , c_ACQ_CHAN_CMPLT_WIDTH_LOG2),
745
- num_atoms => to_unsigned (24 , c_ACQ_NUM_ATOMS_WIDTH_LOG2),
744
+ -- NOTE: Altough 768 bits would be enough, using this value as width somehow
745
+ -- causes ACQ samples to be weirdly misaligned (see https://github.com/lnls-dig/infra-cores/issues/18).
746
+ -- This issue isn't manifested when we use 1024 bits.
747
+ width => to_unsigned (1024 , c_ACQ_CHAN_CMPLT_WIDTH_LOG2),
748
+ num_atoms => to_unsigned (32 , c_ACQ_NUM_ATOMS_WIDTH_LOG2),
746
749
atom_width => to_unsigned (32 , c_ACQ_ATOM_WIDTH_LOG2)
747
750
);
748
751
@@ -2220,19 +2223,37 @@ begin
2220
2223
-- ACQ Core 4
2221
2224
-- ------------------
2222
2225
2226
+ -- std_logic_vector(to_unsigned(63, 16)) & std_logic_vector(to_unsigned(62, 16)) & std_logic_vector(to_unsigned(61, 16)) & std_logic_vector(to_unsigned(60, 16)) &
2227
+ -- std_logic_vector(to_unsigned(59, 16)) & std_logic_vector(to_unsigned(58, 16)) & std_logic_vector(to_unsigned(57, 16)) & std_logic_vector(to_unsigned(56, 16)) &
2228
+ -- std_logic_vector(to_unsigned(55, 16)) & std_logic_vector(to_unsigned(54, 16)) & std_logic_vector(to_unsigned(53, 16)) & std_logic_vector(to_unsigned(52, 16)) &
2229
+ -- std_logic_vector(to_unsigned(51, 16)) & std_logic_vector(to_unsigned(50, 16)) & std_logic_vector(to_unsigned(49, 16)) & std_logic_vector(to_unsigned(48, 16)) &
2230
+ -- std_logic_vector(to_unsigned(47, 16)) & std_logic_vector(to_unsigned(46, 16)) & std_logic_vector(to_unsigned(45, 16)) & std_logic_vector(to_unsigned(44, 16)) &
2231
+ -- std_logic_vector(to_unsigned(43, 16)) & std_logic_vector(to_unsigned(42, 16)) & std_logic_vector(to_unsigned(41, 16)) & std_logic_vector(to_unsigned(40, 16)) &
2232
+ -- std_logic_vector(to_unsigned(39, 16)) & std_logic_vector(to_unsigned(38, 16)) & std_logic_vector(to_unsigned(37, 16)) & std_logic_vector(to_unsigned(36, 16)) &
2233
+ -- std_logic_vector(to_unsigned(35, 16)) & std_logic_vector(to_unsigned(34, 16)) & std_logic_vector(to_unsigned(33, 16)) & std_logic_vector(to_unsigned(32, 16)) &
2234
+ -- std_logic_vector(to_unsigned(31, 16)) & std_logic_vector(to_unsigned(30, 16)) & std_logic_vector(to_unsigned(29, 16)) & std_logic_vector(to_unsigned(28, 16)) &
2235
+ -- std_logic_vector(to_unsigned(27, 16)) & std_logic_vector(to_unsigned(26, 16)) & std_logic_vector(to_unsigned(25, 16)) & std_logic_vector(to_unsigned(24, 16)) &
2236
+ -- std_logic_vector(to_unsigned(23, 16)) & std_logic_vector(to_unsigned(22, 16)) & std_logic_vector(to_unsigned(21, 16)) & std_logic_vector(to_unsigned(20, 16)) &
2237
+ -- std_logic_vector(to_unsigned(19, 16)) & std_logic_vector(to_unsigned(18, 16)) & std_logic_vector(to_unsigned(17, 16)) & std_logic_vector(to_unsigned(16, 16)) &
2238
+ -- std_logic_vector(to_unsigned(15, 16)) & std_logic_vector(to_unsigned(14, 16)) & std_logic_vector(to_unsigned(13, 16)) & std_logic_vector(to_unsigned(12, 16)) &
2239
+ -- std_logic_vector(to_unsigned(11, 16)) & std_logic_vector(to_unsigned(10, 16)) & std_logic_vector(to_unsigned(9, 16)) & std_logic_vector(to_unsigned(8, 16)) &
2240
+ -- std_logic_vector(to_unsigned(7, 16)) & std_logic_vector(to_unsigned(6, 16)) & std_logic_vector(to_unsigned(5, 16)) & std_logic_vector(to_unsigned(4, 16)) &
2241
+ -- std_logic_vector(to_unsigned(3, 16)) & std_logic_vector(to_unsigned(2, 16)) & std_logic_vector(to_unsigned(1, 16)) & std_logic_vector(to_unsigned(0, 16));
2242
+
2223
2243
-- SYS ID
2224
2244
acq_chan_array(c_ACQ_CORE_SYS_ID_ID, c_ACQ_SYS_ID_ID).val(to_integer (c_FACQ_CHANNELS(c_ACQ_SYS_ID_ID).width )- 1 downto 0 ) <=
2225
- std_logic_vector (bpm_pos_flat_x(7 )) & std_logic_vector (bpm_pos_flat_x(6 )) & std_logic_vector (bpm_pos_flat_x(5 )) & std_logic_vector (bpm_pos_flat_x(4 )) & -- BPM x positions (767 downto 512, 8x32)
2226
- std_logic_vector (bpm_pos_flat_x(3 )) & std_logic_vector (bpm_pos_flat_x(2 )) & std_logic_vector (bpm_pos_flat_x(1 )) & std_logic_vector (bpm_pos_flat_x(0 )) &
2227
- std_logic_vector (bpm_pos_flat_y(7 )) & std_logic_vector (bpm_pos_flat_y(6 )) & std_logic_vector (bpm_pos_flat_y(5 )) & std_logic_vector (bpm_pos_flat_y(4 )) & -- BPM y positions (511 downto 256, 8x32)
2228
- std_logic_vector (bpm_pos_flat_y(3 )) & std_logic_vector (bpm_pos_flat_y(2 )) & std_logic_vector (bpm_pos_flat_y(1 )) & std_logic_vector (bpm_pos_flat_y(0 )) &
2245
+ std_logic_vector (to_unsigned (0 , 288 )) & -- [DEBUG] Padding with 0s (1023 downto 736)
2246
+ bpm_pos_flat_x_rcvd & bpm_pos_flat_y_rcvd & -- [DEBUG] Flatenizers' 'received' flag (735 downto 720, 2x8)
2247
+ f_fofb_cc_packet_to_slv(acq_dcc_fmc_packet)(def_PacketTimeframeCntr16MSB downto def_PacketTimeframeCntr16LSB) & -- [DEBUG] Timeframe counter (719 downto 704, 1x16)
2229
2248
-- TODO: These bits should be filled with channels 11-8, but they aren't instantiated yet
2230
- std_logic_vector (to_unsigned (0 , 64 )) & -- FOFB setpoints (255 downto 64, 12x16)
2231
- std_logic_vector (fofb_sp_arr(7 )) & std_logic_vector (fofb_sp_arr(6 )) & std_logic_vector (fofb_sp_arr(5 )) & std_logic_vector (fofb_sp_arr(4 )) &
2232
- std_logic_vector (fofb_sp_arr(3 )) & std_logic_vector (fofb_sp_arr(2 )) & std_logic_vector (fofb_sp_arr(1 )) & std_logic_vector (fofb_sp_arr(0 )) &
2233
- bpm_pos_flat_x_rcvd & bpm_pos_flat_y_rcvd & -- [DEBUG] Flatenizers' 'received' flag (64 downto 49, 2x8)
2234
- f_fofb_cc_packet_to_slv(acq_dcc_fmc_packet)(def_PacketTimeframeCntr16MSB downto def_PacketTimeframeCntr16LSB) & -- [DEBUG] Timeframe counter (49 downto 33, 1x16)
2235
- std_logic_vector (to_unsigned (0 , 32 ));
2249
+ std_logic_vector (to_unsigned (0 , 64 )) & -- FOFB channels setpoints 11-0 (703 downto 512, 12x16)
2250
+ -- NOTE: These 16-bit values are being swapped at each 2 so they end up being allocated on RAM in descending order after ACQ endianness procedures.
2251
+ std_logic_vector (fofb_sp_arr(6 )) & std_logic_vector (fofb_sp_arr(7 )) & std_logic_vector (fofb_sp_arr(4 )) & std_logic_vector (fofb_sp_arr(5 )) &
2252
+ std_logic_vector (fofb_sp_arr(2 )) & std_logic_vector (fofb_sp_arr(3 )) & std_logic_vector (fofb_sp_arr(0 )) & std_logic_vector (fofb_sp_arr(1 )) &
2253
+ std_logic_vector (bpm_pos_flat_y(7 )) & std_logic_vector (bpm_pos_flat_y(6 )) & std_logic_vector (bpm_pos_flat_y(5 )) & std_logic_vector (bpm_pos_flat_y(4 )) & -- P2P BPM y positions 7-0 (511 downto 256, 8x32)
2254
+ std_logic_vector (bpm_pos_flat_y(3 )) & std_logic_vector (bpm_pos_flat_y(2 )) & std_logic_vector (bpm_pos_flat_y(1 )) & std_logic_vector (bpm_pos_flat_y(0 )) &
2255
+ std_logic_vector (bpm_pos_flat_x(7 )) & std_logic_vector (bpm_pos_flat_x(6 )) & std_logic_vector (bpm_pos_flat_x(5 )) & std_logic_vector (bpm_pos_flat_x(4 )) & -- P2P BPM x positions 7-0 (255 downto 0, 8x32)
2256
+ std_logic_vector (bpm_pos_flat_x(3 )) & std_logic_vector (bpm_pos_flat_x(2 )) & std_logic_vector (bpm_pos_flat_x(1 )) & std_logic_vector (bpm_pos_flat_x(0 ));
2236
2257
acq_chan_array(c_ACQ_CORE_SYS_ID_ID, c_ACQ_SYS_ID_ID).dvalid <= or fofb_sp_valid_arr;
2237
2258
acq_chan_array(c_ACQ_CORE_SYS_ID_ID, c_ACQ_SYS_ID_ID).trig <= trig_pulse_rcv(c_TRIG_MUX_SYS_ID_ID, c_ACQ_SYS_ID_ID).pulse;
2238
2259
0 commit comments