Skip to content

Commit

Permalink
[WIP] afc_ref_fofb_ctrl_gen.vhd: add shaper filter
Browse files Browse the repository at this point in the history
  • Loading branch information
guilhermerc committed Sep 22, 2023
1 parent 7442612 commit fdef3ad
Showing 1 changed file with 37 additions and 4 deletions.
41 changes: 37 additions & 4 deletions hdl/top/afc_ref_design_gen/afc_ref_fofb_ctrl_gen.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,14 @@ architecture top of afc_ref_fofb_ctrl_gen is
signal distort_bpm_pos_flat_y : t_bpm_pos_arr(c_MAX_NUM_BPM_POS_PER_FLAT-1 downto 0);
signal distort_bpm_pos_flat_y_rcvd : std_logic_vector(c_MAX_NUM_BPM_POS_PER_FLAT-1 downto 0);

-----------------------------------------------------------------------------
-- FOFB shaper filters signals
-----------------------------------------------------------------------------
CONSTANT c_FOFB_SHAPER_FILT_EXTRA_BITS : NATURAL := 1;

SIGNAL filt_distort_fofb_proc_sp_arr : t_sp_arr(c_FOFB_CHANNELS-1 DOWNTO 0);
SIGNAL filt_distort_fofb_proc_sp_valid_arr : STD_LOGIC_VECTOR(c_FOFB_CHANNELS-1 DOWNTO 0);

-----------------------------------------------------------------------------
-- RTM signals
-----------------------------------------------------------------------------
Expand Down Expand Up @@ -839,8 +847,9 @@ architecture top of afc_ref_fofb_ctrl_gen is
constant c_RTM_LAMP_ID : natural := 2;
constant c_FOFB_PROCESSING_ID : natural := 3;
constant c_FOFB_SYS_ID_ID : natural := 4;
-- +2 for accounting for FOFB processing and FOFB system identification cores
constant c_USER_NUM_CORES : natural := c_NUM_FOFC_CC_CORES + c_RTM_LAMP_NUM_CORES + 2;
CONSTANT c_FOFB_SHAPER_FILT_ID : NATURAL := 5;
-- +3 is accounting for FOFB {processing, system identification, shaper filter} cores
constant c_USER_NUM_CORES : natural := c_NUM_FOFC_CC_CORES + c_RTM_LAMP_NUM_CORES + 3;
constant c_RTM_LAMP_SDB : boolean := (g_RTM = "RTMLAMP");

constant c_USER_SDB_RECORD_ARRAY : t_sdb_record_array(c_USER_NUM_CORES-1 downto 0) :=
Expand All @@ -849,7 +858,8 @@ architecture top of afc_ref_fofb_ctrl_gen is
c_FOFB_CC_P2P_ID => f_sdb_auto_device(c_xwb_fofb_cc_regs_sdb, true),
c_RTM_LAMP_ID => f_sdb_auto_device(c_xwb_rtm_lamp_regs_sdb, c_RTM_LAMP_SDB),
c_FOFB_PROCESSING_ID => f_sdb_auto_device(c_xwb_fofb_processing_regs_sdb, true),
c_FOFB_SYS_ID_ID => f_sdb_auto_device(c_xwb_fofb_sys_id_regs_sdb, true)
c_FOFB_SYS_ID_ID => f_sdb_auto_device(c_xwb_fofb_sys_id_regs_sdb, true),
c_FOFB_SHAPER_FILT_ID => f_sdb_auto_device(c_xwb_fofb_shaper_filter_regs_sdb, TRUE)
);

-----------------------------------------------------------------------------
Expand Down Expand Up @@ -1894,6 +1904,29 @@ begin
wb_slv_o => user_wb_in(c_FOFB_SYS_ID_ID)
);

----------------------------------------------------------------------
-- FOFB SHAPER FILTERS --
----------------------------------------------------------------------

cmp_xwb_fofb_shaper_filt : xwb_fofb_shaper_filt
GENERIC MAP (
g_CHANNELS => c_FOFB_CHANNELS,
g_EXTRA_BITS => c_FOFB_SHAPER_FILT_EXTRA_BITS,
g_INTERFACE_MODE => PIPELINED,
g_ADDRESS_GRANULARITY => BYTE,
g_WITH_EXTRA_WB_REG => FALSE
)
PORT MAP (
clk_i => clk_sys,
rst_n_i => clk_sys_rstn,
sp_arr_i => distort_fofb_proc_sp_arr,
sp_valid_arr_i => distort_fofb_proc_sp_valid_arr,
filt_sp_arr_o => filt_distort_fofb_proc_sp_arr,
filt_sp_valid_arr_o => filt_distort_fofb_proc_sp_valid_arr,
wb_slv_i => user_wb_out(c_FOFB_SHAPER_FILT_ID),
wb_slv_o => user_wb_in(c_FOFB_SHAPER_FILT_ID)
);

----------------------------------------------------------------------
-- RTM 8SFP OHWR --
----------------------------------------------------------------------
Expand Down Expand Up @@ -2198,7 +2231,7 @@ begin

-- Convert signed elements to std_logic_vector
gen_conv_pi_sp: for i in 0 to c_FOFB_CHANNELS-1 generate
pi_sp_ext(i) <= std_logic_vector(distort_fofb_proc_sp_arr(i));
pi_sp_ext(i) <= STD_LOGIC_VECTOR(filt_distort_fofb_proc_sp_arr(i));
end generate;

----------------------------------------------------------------------
Expand Down

0 comments on commit fdef3ad

Please sign in to comment.