diff --git a/dependencies.yml b/dependencies.yml index 0cbe131cbe6e15a919fa141564d1e7e6163a8e5b..169f1b665a931bc07a228c70ad102d069d803065 100644 --- a/dependencies.yml +++ b/dependencies.yml @@ -45,7 +45,7 @@ sources: url: https://gitlab.cern.ch/gbtsc-fpga-support/gbt-sc.git dtc: - branch: master + branch: feature/heterogeneous-dtc url: https://gitlab.cern.ch/cms-tracker-phase2-data-processing/BE_firmware/dtc.git dtc-stub-processing: diff --git a/top/firmware/cfg/top.dep b/top/firmware/cfg/top.dep index 2b37dc34fb52519cea4a6724b0c16a47e881702b..2a604b26f35b8813ef95afc931d7059902ec45f5 100644 --- a/top/firmware/cfg/top.dep +++ b/top/firmware/cfg/top.dep @@ -1,6 +1,6 @@ include -c histogram:top histogram.dep -include -c dtc:dtc-fe/2S/5G-FEC12 module.dep -include -c dtc:dtc-fe/2S/5G-FEC12 framer.dep +include -c dtc:dtc-fe common.dep +include -c dtc:dtc-fe framers.dep include -c dtc:dtc-be/common daqpath.dep include -c dtc:dtc-be/common common.dep include -c dtc-stub-processing:common tools.dep diff --git a/top/firmware/hdl/emp_payload.vhd b/top/firmware/hdl/emp_payload.vhd index 9830d5926666fcb0b548910cea39b8da7cc5b851..41590672bffe494998af95dce7f082e1cacdf3c6 100644 --- a/top/firmware/hdl/emp_payload.vhd +++ b/top/firmware/hdl/emp_payload.vhd @@ -205,17 +205,17 @@ begin LinkInterfaceInstance : entity work.LinkInterface --==============================-- generic map ( - module_type => "2S" + module_type => cDTCInputLinkMap(i).module_type ) port map ( --- Input Ports --- clk_p => clk_p, clk40 => clk40, - link_in => d(cDTCInputLinkMap(i)), + link_in => d(cDTCInputLinkMap(i).index), daq_read => daq_read(i), global_fcmd => global_fcmd, --- Output Ports --- - link_out => q(cDTCInputLinkMap(i)), + link_out => q(cDTCInputLinkMap(i).index), stub_out => stubs(i), header_out => header_array(cNumberOfCICs * i + cNumberOfCICs - 1 downto cNumberOfCICs * i), daq_out => daq_data(i), diff --git a/top/firmware/hdl/link_maps.vhd b/top/firmware/hdl/link_maps.vhd index d0ca6517cd88b2c93ed21c23763bf86053a0588d..711c7cec70b26eefb12dbc12e78f02286afc8977 100644 --- a/top/firmware/hdl/link_maps.vhd +++ b/top/firmware/hdl/link_maps.vhd @@ -1,14 +1,38 @@ library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.NUMERIC_STD.ALL; +use work.dtc_link_maps_func.all; package dtc_link_maps is + constant cNumberOfFEModules : integer := 4; constant cNumberOfOutputLinks : integer := 4; - type tDTCInputLinkMap is array(0 to cNumberOfFEModules - 1) of integer; - constant cDTCInputLinkMap : tDTCInputLinkMap := (8, 9, 10, 11); + type tDTCInputLinkMap is array(0 to cNumberOfFEModules - 1) of tDTCInputLinkConfig; + constant cDTCInputLinkMap : tDTCInputLinkMap := ( + 0 => (8, "2S", "CIC2"), + 1 => (9, "2S", "CIC2"), + 2 => (10, "2S", "CIC2"), + 3 => (11, "2S", "CIC2") + ); type tDTCOutputLinkMap is array(0 to cNumberOfOutputLinks - 1) of integer; - constant cDTCOutputLinkMap : tDTCOutputLinkMap := (16, 17, 18, 19); + constant cDTCOutputLinkMap : tDTCOutputLinkMap := ( + 16, 17, 18, 19 + ); + + function selectModuleTypeFromChannel(channel : in integer) return string; end package dtc_link_maps; + +package body dtc_link_maps is + + function selectModuleTypeFromChannel(channel : in integer) return string is + begin + for i in 0 to cDTCInputLinkMap'length - 1 loop + if cDTCInputLinkMap(i).index = channel then + return cDTCInputLinkMap(i).module_type; + end if; + end loop; + end selectModuleTypeFromChannel; + +end package body dtc_link_maps;