diff --git a/simulation/UVVMtests/tb/FULLModeToHost_tb.vhd b/simulation/UVVMtests/tb/FULLModeToHost_tb.vhd index 6975a4f7c9b1f9ae1d5ef820d13b59eb31dcc029..eb266cf3196acb7166303436927e88493a1bd829 100644 --- a/simulation/UVVMtests/tb/FULLModeToHost_tb.vhd +++ b/simulation/UVVMtests/tb/FULLModeToHost_tb.vhd @@ -265,6 +265,9 @@ decoding0: entity work.decoding m_axis => decoding_axis, m_axis_tready => decoding_axis_tready, m_axis_prog_empty => decoding_axis_prog_empty, + m_axis_noSC => open, + m_axis_noSC_tready => (others => (others => '1')), + m_axis_noSC_prog_empty => open, TTC_ToHost_Data_in => TTC_ToHost_Data_in, ElinkBusyIn => ElinkBusyIn, DmaBusyIn => DmaBusyIn, @@ -335,7 +338,10 @@ decoding0: entity work.decoding aresetn => aresetn, m_axis => emu_axis, m_axis_tready => emu_axis_tready, - m_axis_prog_empty => emu_axis_prog_empty + m_axis_prog_empty => emu_axis_prog_empty, + m_axis_noSC => open, + m_axis_noSC_tready => (others => (others => '1')), + m_axis_noSC_prog_empty => open ); fosel0: entity work.axis_32_fanout_selector diff --git a/simulation/UVVMtests/tb/GBTCrCoding_tb.vhd b/simulation/UVVMtests/tb/GBTCrCoding_tb.vhd index e1a17c2dbff0b50999494153cf32698c1b63033c..93357fe1fb5bc4c9a51501f0ca4c30d319342440 100644 --- a/simulation/UVVMtests/tb/GBTCrCoding_tb.vhd +++ b/simulation/UVVMtests/tb/GBTCrCoding_tb.vhd @@ -268,6 +268,9 @@ decoding0: entity work.decoding m_axis => decoding_axis, m_axis_tready => decoding_axis_tready, m_axis_prog_empty => decoding_axis_prog_empty, + m_axis_noSC => open, + m_axis_noSC_tready => (others => (others => '1')), + m_axis_noSC_prog_empty => open, TTC_ToHost_Data_in => TTC_ToHost_Data_in, ElinkBusyIn => ElinkBusyIn, DmaBusyIn => DmaBusyIn, diff --git a/simulation/UVVMtests/tb/GBTLinkToHost_tb.vhd b/simulation/UVVMtests/tb/GBTLinkToHost_tb.vhd index 7e0c9be6a2bbf6ce403f7958cb7c515908b3e19a..aab6b290a1099d68735f8bc9b5705dc4d9894d03 100644 --- a/simulation/UVVMtests/tb/GBTLinkToHost_tb.vhd +++ b/simulation/UVVMtests/tb/GBTLinkToHost_tb.vhd @@ -282,6 +282,9 @@ decoding0: entity work.decoding m_axis => decoding_axis, m_axis_tready => decoding_axis_tready, m_axis_prog_empty => decoding_axis_prog_empty, + m_axis_noSC => open, + m_axis_noSC_tready => (others => (others => '1')), + m_axis_noSC_prog_empty => open, TTC_ToHost_Data_in => TTC_ToHost_Data_in, ElinkBusyIn => ElinkBusyIn, DmaBusyIn => DmaBusyIn, diff --git a/simulation/UVVMtests/tb/XcodingEpath_tb.vhd b/simulation/UVVMtests/tb/XcodingEpath_tb.vhd index 0ea618ae67fe61108f27f5abb453d5037f79eb47..f4fe995064dd81f69e9a8caf645f0123a2704a34 100644 --- a/simulation/UVVMtests/tb/XcodingEpath_tb.vhd +++ b/simulation/UVVMtests/tb/XcodingEpath_tb.vhd @@ -259,6 +259,9 @@ decoding0: entity work.decoding m_axis => m_axis, m_axis_tready => m_axis_tready, m_axis_prog_empty => m_axis_prog_empty, + m_axis_noSC => open, + m_axis_noSC_tready => (others => (others => '1')), + m_axis_noSC_prog_empty => open, TTC_ToHost_Data_in => TTC_ToHost_Data_in, ElinkBusyIn => ElinkBusyIn, DmaBusyIn => DmaBusyIn, diff --git a/sources/FelixTop/felix_top.vhd b/sources/FelixTop/felix_top.vhd index 1401f734b18ccb25d8b32e78c59f72758c74f032..12149c265189eefbd3f4c22c445ef4d58299c3dc 100644 --- a/sources/FelixTop/felix_top.vhd +++ b/sources/FelixTop/felix_top.vhd @@ -118,7 +118,8 @@ entity felix_top is FULL_HALFRATE : boolean := false; CREnableFromHost : boolean := true; FROMHOST_LENGTH_IS_5BIT : boolean := true; - KCU_LOWER_LATENCY : integer := 0 + KCU_LOWER_LATENCY : integer := 0; + AddFULLMODEForDUNE : boolean := false --Add an additional FULL mode decoder without superchunk factor for DUNE ); port ( BUSY_OUT : out std_logic; @@ -435,6 +436,9 @@ begin signal decoding_axis : axis_32_2d_array_type(0 to GBT_NUM/ENDPOINTS-1, 0 to STREAMS_TOHOST-1); signal decoding_axis_tready : axis_tready_2d_array_type(0 to GBT_NUM/ENDPOINTS-1, 0 to STREAMS_TOHOST-1); signal decoding_axis_prog_empty : axis_tready_2d_array_type(0 to GBT_NUM/ENDPOINTS-1, 0 to STREAMS_TOHOST-1); + signal decoding_axis_noSC : axis_32_2d_array_type(0 to GBT_NUM/ENDPOINTS-1, 0 to STREAMS_TOHOST-1); + signal decoding_axis_noSC_tready : axis_tready_2d_array_type(0 to GBT_NUM/ENDPOINTS-1, 0 to STREAMS_TOHOST-1); + signal decoding_axis_noSC_prog_empty : axis_tready_2d_array_type(0 to GBT_NUM/ENDPOINTS-1, 0 to STREAMS_TOHOST-1); signal decoding_axis_aux : axis_32_array_type(0 to 1); signal decoding_axis_aux_tready : axis_tready_array_type(0 to 1); signal decoding_axis_aux_prog_empty : axis_tready_array_type(0 to 1); @@ -451,6 +455,12 @@ begin signal fanout_sel_axis : axis_32_2d_array_type(0 to GBT_NUM/ENDPOINTS-1, 0 to STREAMS_TOHOST-1); signal fanout_sel_axis_tready : axis_tready_2d_array_type(0 to GBT_NUM/ENDPOINTS-1, 0 to STREAMS_TOHOST-1); signal fanout_sel_axis_prog_empty : axis_tready_2d_array_type(0 to GBT_NUM/ENDPOINTS-1, 0 to STREAMS_TOHOST-1); + signal emu_axis_noSC : axis_32_2d_array_type(0 to GBT_NUM/ENDPOINTS-1, 0 to STREAMS_TOHOST-1); + signal emu_axis_noSC_tready : axis_tready_2d_array_type(0 to GBT_NUM/ENDPOINTS-1, 0 to STREAMS_TOHOST-1); + signal emu_axis_noSC_prog_empty : axis_tready_2d_array_type(0 to GBT_NUM/ENDPOINTS-1, 0 to STREAMS_TOHOST-1); + signal fanout_sel_axis_noSC : axis_32_2d_array_type(0 to GBT_NUM/ENDPOINTS-1, 0 to STREAMS_TOHOST-1); + signal fanout_sel_axis_noSC_tready : axis_tready_2d_array_type(0 to GBT_NUM/ENDPOINTS-1, 0 to STREAMS_TOHOST-1); + signal fanout_sel_axis_noSC_prog_empty : axis_tready_2d_array_type(0 to GBT_NUM/ENDPOINTS-1, 0 to STREAMS_TOHOST-1); signal appreg_clk: std_logic; signal register_map_control_appreg_clk : register_map_control_type; @@ -702,7 +712,8 @@ begin IncludeDecodingEpath8_8b10b => IncludeDecodingEpath8_8b10b, IncludeDecodingEpath16_8b10b => IncludeDecodingEpath16_8b10b, IncludeDecodingEpath32_8b10b => IncludeDecodingEpath32_8b10b, - PCIE_ENDPOINT => pcie_endpoint + PCIE_ENDPOINT => pcie_endpoint, + AddFULLMODEForDUNE => AddFULLMODEForDUNE ) Port map( RXUSRCLK => RXUSRCLK(((GBT_NUM/ENDPOINTS)*(pcie_endpoint+1))-1 downto (GBT_NUM/ENDPOINTS)*pcie_endpoint), @@ -720,6 +731,9 @@ begin m_axis => decoding_axis, m_axis_tready => decoding_axis_tready, m_axis_prog_empty => decoding_axis_prog_empty, + m_axis_noSC => decoding_axis_noSC, + m_axis_noSC_tready => decoding_axis_noSC_tready, + m_axis_noSC_prog_empty => decoding_axis_noSC_prog_empty, TTC_ToHost_Data_in => TTC_ToHost_Data, ElinkBusyIn => ElinkBusy, DmaBusyIn => dma_busy_arr(pcie_endpoint), @@ -849,7 +863,8 @@ begin generic map( GBT_NUM => GBT_NUM/ENDPOINTS, BLOCKSIZE => BLOCKSIZE, - use_blockram => true) + use_blockram => true, + AddFULLMODEForDUNE => AddFULLMODEForDUNE) port map( appreg_clk => appreg_clk, register_map_control => register_map_40_control, @@ -860,7 +875,10 @@ begin aresetn => aresetn, m_axis => emu_axis, m_axis_tready => emu_axis_tready, - m_axis_prog_empty => emu_axis_prog_empty + m_axis_prog_empty => emu_axis_prog_empty, + m_axis_noSC => emu_axis_noSC, + m_axis_noSC_tready => emu_axis_noSC_tready, + m_axis_noSC_prog_empty => emu_axis_noSC_prog_empty ); fosel0: entity work.axis_32_fanout_selector @@ -881,6 +899,26 @@ begin fanout_sel_axis_prog_empty => fanout_sel_axis_prog_empty, register_map_control => register_map_40_control ); + g_AddNoSCFullMode: if AddFULLMODEForDUNE generate + fosel_noSC0: entity work.axis_32_fanout_selector + generic map( + GBT_NUM => GBT_NUM/ENDPOINTS, + STREAMS_TOHOST => STREAMS_TOHOST + ) + port map( + aclk => decoding_aclk, + emu_axis => emu_axis_noSC, + emu_axis_tready => emu_axis_noSC_tready, + emu_axis_prog_empty => emu_axis_noSC_prog_empty, + decoding_axis => decoding_axis_noSC, + decoding_axis_tready => decoding_axis_noSC_tready, + decoding_axis_prog_empty => decoding_axis_noSC_prog_empty, + fanout_sel_axis => fanout_sel_axis_noSC, + fanout_sel_axis_tready => fanout_sel_axis_noSC_tready, + fanout_sel_axis_prog_empty => fanout_sel_axis_noSC_prog_empty, + register_map_control => register_map_40_control + ); + end generate; end generate; g_DisableFullModeEmulator: if FIRMWARE_MODE /= FIRMWARE_MODE_FULL generate diff --git a/sources/FullModeDataEmulator/FullModeDataEmulator.vhd b/sources/FullModeDataEmulator/FullModeDataEmulator.vhd index 604e56eb8b56a417312e5e46c04c3e63ccd0ba66..31c78314834fb8f9979cd3dd614f42a66c1c76d1 100644 --- a/sources/FullModeDataEmulator/FullModeDataEmulator.vhd +++ b/sources/FullModeDataEmulator/FullModeDataEmulator.vhd @@ -43,7 +43,8 @@ entity FullModeDataEmulator is generic ( GBT_NUM: integer := 24; BLOCKSIZE : integer; - use_blockram: boolean := true + use_blockram: boolean := true; + AddFULLMODEForDUNE : boolean := false ); port ( appreg_clk : in std_logic; @@ -56,7 +57,10 @@ port ( aresetn : in std_logic; m_axis : out axis_32_2d_array_type(0 to GBT_NUM-1, 0 to 0); m_axis_tready : in axis_tready_2d_array_type(0 to GBT_NUM-1, 0 to 0); - m_axis_prog_empty : out axis_tready_2d_array_type(0 to GBT_NUM-1, 0 to 0) + m_axis_prog_empty : out axis_tready_2d_array_type(0 to GBT_NUM-1, 0 to 0); + m_axis_noSC : out axis_32_2d_array_type(0 to GBT_NUM-1, 0 to 0); + m_axis_noSC_tready : in axis_tready_2d_array_type(0 to GBT_NUM-1, 0 to 0); + m_axis_noSC_prog_empty : out axis_tready_2d_array_type(0 to GBT_NUM-1, 0 to 0) ); end FullModeDataEmulator; @@ -411,6 +415,26 @@ ToAxi0: entity work.FullToAxis path_ena => path_ena(i), super_chunk_factor_link => register_map_control.SUPER_CHUNK_FACTOR_LINK(i) ); + + g_AdditionalFullModeForDUNE: if AddFULLMODEForDUNE generate + ToAxi0: entity work.FullToAxis + generic map( + BLOCKSIZE => BLOCKSIZE + ) + port map( + clk240 => clk240, + FMdin => FMdout_s, + LinkAligned => FMdout_rdy_s, + aclk => aclk, + aresetn => aresetn_sync, + m_axis => m_axis_noSC(i,0), + m_axis_tready => m_axis_noSC_tready(i,0), + m_axis_prog_empty => m_axis_noSC_prog_empty(i,0), + path_ena => path_ena(i), + super_chunk_factor_link => x"01" + ); + + end generate; end generate; diff --git a/sources/decoding/decoding.vhd b/sources/decoding/decoding.vhd index f7d63289d4e691113aff6a7d5cb327baf03c4910..bea182c3e1eb13bde3e7fb28bef84277f3a61718 100644 --- a/sources/decoding/decoding.vhd +++ b/sources/decoding/decoding.vhd @@ -64,7 +64,8 @@ entity decoding is IncludeDecodingEpath8_8b10b : std_logic_vector(6 downto 0) := "1111111"; IncludeDecodingEpath16_8b10b : std_logic_vector(6 downto 0) := "0000000"; --lpGBT only -- @suppress "Unused generic: IncludeDecodingEpath16_8b10b is not used in work.decoding(Behavioral)" IncludeDecodingEpath32_8b10b : std_logic_vector(6 downto 0) := "0000000"; --lpGBT only -- @suppress "Unused generic: IncludeDecodingEpath32_8b10b is not used in work.decoding(Behavioral)" - PCIE_ENDPOINT : integer := 0 + PCIE_ENDPOINT : integer := 0; + AddFULLMODEForDUNE : boolean := false ); Port ( RXUSRCLK : in std_logic_vector(GBT_NUM-1 downto 0); --Data clock for FULL mode @@ -82,6 +83,9 @@ entity decoding is m_axis : out axis_32_2d_array_type(0 to GBT_NUM-1, 0 to STREAMS_TOHOST-1); --Towards CRToHost m_axis_tready : in axis_tready_2d_array_type(0 to GBT_NUM-1, 0 to STREAMS_TOHOST-1); --From CRToHost m_axis_prog_empty : out axis_tready_2d_array_type(0 to GBT_NUM-1, 0 to STREAMS_TOHOST-1); --From CRToHost + m_axis_noSC : out axis_32_2d_array_type(0 to GBT_NUM-1, 0 to STREAMS_TOHOST-1); --Replication of axi stream for DUNE (no superchunk) + m_axis_noSC_tready : in axis_tready_2d_array_type(0 to GBT_NUM-1, 0 to STREAMS_TOHOST-1); --Replication of axi stream for DUNE (no superchunk) + m_axis_noSC_prog_empty : out axis_tready_2d_array_type(0 to GBT_NUM-1, 0 to STREAMS_TOHOST-1); --Replication of axi stream for DUNE (no superchunk) TTC_ToHost_Data_in : in TTC_ToHost_data_type; ElinkBusyIn : in busyOut_array_type(0 to GBT_NUM-1); DmaBusyIn : in std_logic; @@ -536,6 +540,26 @@ begin path_ena => register_map_control.DECODING_EGROUP_CTRL(i)(0).EPATH_ENA(0), --: in std_logic; super_chunk_factor_link => register_map_control.SUPER_CHUNK_FACTOR_LINK(i) ); + g_NoSuperchunkforDune: if AddFULLMODEForDUNE generate + decodingNoSC0: entity work.FullToAxis + generic map( + BLOCKSIZE => BLOCKSIZE + ) + port map( + clk240 => RXUSRCLK(i), + FMdin => FULL_UPLINK_USER_DATA(i), --: in std_logic_vector(32 downto 0); + LinkAligned => LinkAligned(i), --: in std_logic; + aclk => clk250, --: in std_logic; + aresetn => aresetn, --: in std_logic; + m_axis => m_axis_noSC(i,0), --: out axis_32_type; + m_axis_tready => m_axis_noSC_tready(i,0), --: in std_logic; + m_axis_prog_empty => m_axis_noSC_prog_empty(i,0), + path_ena => register_map_control.DECODING_EGROUP_CTRL(i)(0).EPATH_ENA(0), --: in std_logic; + super_chunk_factor_link => x"01" + ); + end generate g_NoSuperchunkforDune; + + register_map_decoding_monitor.DECODING_LINK_ALIGNED(i)(57 downto 1) <= (others => '0'); register_map_decoding_monitor.DECODING_LINK_ALIGNED(i)(0) <= LinkAligned(i);