Commit cfa9dbec authored by John Gill's avatar John Gill

RF changes for timestamps, etc

parent fe7a8fb1
...@@ -265,6 +265,34 @@ memory-map: ...@@ -265,6 +265,34 @@ memory-map:
description: value description: value
range: 4-0 range: 4-0
preset: 0x0 preset: 0x0
- reg:
name: TS_FirstTrigTAIsec
description: "Timestamp TAI seconds of the first VTU output trigger after a start pulse"
comment:
width: 64
type: unsigned
access: ro
- reg:
name: TS_FirstTrigTAIcycles
description: "Timestamp TAI cycles of the first VTU output trigger after a start pulse"
comment:
width: 32
type: unsigned
access: ro
- reg:
name: TS_LastTrigTAIsec
description: "Timestamp TAI seconds of the last VTU output trigger"
comment:
width: 64
type: unsigned
access: ro
- reg:
name: TS_LastTrigTAIcycles
description: "Timestamp TAI cycles of the last VTU output trigger"
comment:
width: 32
type: unsigned
access: ro
- submap: - submap:
name: trigdiag name: trigdiag
filename: vtudiag_regs.cheby filename: vtudiag_regs.cheby
......
-- Do not edit. Generated on Tue Sep 07 11:28:03 2021 by jgill -- Do not edit. Generated on Mon Mar 13 15:51:07 2023 by jgill
-- With Cheby 1.4.dev0 and these options: -- With Cheby 1.4.dev0 and these options:
-- -i trigunit_regs.cheby --gen-hdl trigunit_regs.vhd -- -i trigunit_regs.cheby --gen-hdl trigunit_regs.vhd
...@@ -84,6 +84,18 @@ entity trigunit_regs is ...@@ -84,6 +84,18 @@ entity trigunit_regs is
-- value -- value
trigODelay_delay_o : out std_logic_vector(4 downto 0); trigODelay_delay_o : out std_logic_vector(4 downto 0);
-- Timestamp TAI seconds of the first VTU output trigger after a start pulse
TS_FirstTrigTAIsec_i : in std_logic_vector(63 downto 0);
-- Timestamp TAI cycles of the first VTU output trigger after a start pulse
TS_FirstTrigTAIcycles_i : in std_logic_vector(31 downto 0);
-- Timestamp TAI seconds of the last VTU output trigger
TS_LastTrigTAIsec_i : in std_logic_vector(63 downto 0);
-- Timestamp TAI cycles of the last VTU output trigger
TS_LastTrigTAIcycles_i : in std_logic_vector(31 downto 0);
-- Control register -- Control register
-- Enable the unit -- Enable the unit
trigdiag_control_enable_o : out std_logic; trigdiag_control_enable_o : out std_logic;
...@@ -359,6 +371,14 @@ begin ...@@ -359,6 +371,14 @@ begin
end if; end if;
end process; end process;
-- Register TS_FirstTrigTAIsec
-- Register TS_FirstTrigTAIcycles
-- Register TS_LastTrigTAIsec
-- Register TS_LastTrigTAIcycles
-- Register trigdiag_control -- Register trigdiag_control
trigdiag_control_enable_o <= trigdiag_control_enable_reg; trigdiag_control_enable_o <= trigdiag_control_enable_reg;
trigdiag_control_window_o <= trigdiag_control_window_reg; trigdiag_control_window_o <= trigdiag_control_window_reg;
...@@ -546,7 +566,63 @@ begin ...@@ -546,7 +566,63 @@ begin
when others => when others =>
wr_ack_int <= wr_req_d0; wr_ack_int <= wr_req_d0;
end case; end case;
when "1001" =>
case wr_adr_d0(2 downto 1) is
when "00" =>
-- Reg TS_FirstTrigTAIsec
wr_ack_int <= wr_req_d0;
when "01" =>
-- Reg TS_FirstTrigTAIsec
wr_ack_int <= wr_req_d0;
when "10" =>
-- Reg TS_FirstTrigTAIsec
wr_ack_int <= wr_req_d0;
when "11" =>
-- Reg TS_FirstTrigTAIsec
wr_ack_int <= wr_req_d0;
when others =>
wr_ack_int <= wr_req_d0;
end case;
when "1010" => when "1010" =>
case wr_adr_d0(2 downto 1) is
when "00" =>
-- Reg TS_FirstTrigTAIcycles
wr_ack_int <= wr_req_d0;
when "01" =>
-- Reg TS_FirstTrigTAIcycles
wr_ack_int <= wr_req_d0;
when others =>
wr_ack_int <= wr_req_d0;
end case;
when "1011" =>
case wr_adr_d0(2 downto 1) is
when "00" =>
-- Reg TS_LastTrigTAIsec
wr_ack_int <= wr_req_d0;
when "01" =>
-- Reg TS_LastTrigTAIsec
wr_ack_int <= wr_req_d0;
when "10" =>
-- Reg TS_LastTrigTAIsec
wr_ack_int <= wr_req_d0;
when "11" =>
-- Reg TS_LastTrigTAIsec
wr_ack_int <= wr_req_d0;
when others =>
wr_ack_int <= wr_req_d0;
end case;
when "1100" =>
case wr_adr_d0(2 downto 1) is
when "00" =>
-- Reg TS_LastTrigTAIcycles
wr_ack_int <= wr_req_d0;
when "01" =>
-- Reg TS_LastTrigTAIcycles
wr_ack_int <= wr_req_d0;
when others =>
wr_ack_int <= wr_req_d0;
end case;
when "1110" =>
case wr_adr_d0(2 downto 2) is case wr_adr_d0(2 downto 2) is
when "0" => when "0" =>
case wr_adr_d0(1 downto 1) is case wr_adr_d0(1 downto 1) is
...@@ -574,7 +650,7 @@ begin ...@@ -574,7 +650,7 @@ begin
when others => when others =>
wr_ack_int <= wr_req_d0; wr_ack_int <= wr_req_d0;
end case; end case;
when "1011" => when "1111" =>
case wr_adr_d0(2 downto 1) is case wr_adr_d0(2 downto 1) is
when "00" => when "00" =>
-- Reg trigdiag_counter -- Reg trigdiag_counter
...@@ -591,7 +667,7 @@ begin ...@@ -591,7 +667,7 @@ begin
end process; end process;
-- Process for read requests. -- Process for read requests.
process (adr_int, rd_req_int, status_wrongWvalue_i, status_wrongHTvalue_i, status_wrongBvalue_i, status_running_i, status_startReady_i, status_missReady_i, status_missValid_i, status_idle_i, status_started_i, control_vtuReset_reg, configOffline_valid_i, configOffline_htSwitchingEnable_reg, configOffline_mode_reg, bValueOffline_reg, htValueOffline_reg, wValueOffline_reg, configOnline_htSwitchingEnable_i, configOnline_mode_i, bValueOnline_i, htValueOnline_i, wValueOnline_i, trigOHCDelay_set_reg, trigODelay_delay_reg, trigdiag_control_window_reg, trigdiag_control_enable_reg, trigdiag_generation_i, trigdiag_freq_i, trigdiag_counter_i) begin process (adr_int, rd_req_int, status_wrongWvalue_i, status_wrongHTvalue_i, status_wrongBvalue_i, status_running_i, status_startReady_i, status_missReady_i, status_missValid_i, status_idle_i, status_started_i, control_vtuReset_reg, configOffline_valid_i, configOffline_htSwitchingEnable_reg, configOffline_mode_reg, bValueOffline_reg, htValueOffline_reg, wValueOffline_reg, configOnline_htSwitchingEnable_i, configOnline_mode_i, bValueOnline_i, htValueOnline_i, wValueOnline_i, trigOHCDelay_set_reg, trigODelay_delay_reg, TS_FirstTrigTAIsec_i, TS_FirstTrigTAIcycles_i, TS_LastTrigTAIsec_i, TS_LastTrigTAIcycles_i, trigdiag_control_window_reg, trigdiag_control_enable_reg, trigdiag_generation_i, trigdiag_freq_i, trigdiag_counter_i) begin
-- By default ack read requests -- By default ack read requests
rd_dat_d0 <= (others => 'X'); rd_dat_d0 <= (others => 'X');
case adr_int(6 downto 3) is case adr_int(6 downto 3) is
...@@ -783,7 +859,75 @@ begin ...@@ -783,7 +859,75 @@ begin
when others => when others =>
rd_ack_d0 <= rd_req_int; rd_ack_d0 <= rd_req_int;
end case; end case;
when "1001" =>
case adr_int(2 downto 1) is
when "00" =>
-- Reg TS_FirstTrigTAIsec
rd_ack_d0 <= rd_req_int;
rd_dat_d0 <= TS_FirstTrigTAIsec_i(63 downto 48);
when "01" =>
-- Reg TS_FirstTrigTAIsec
rd_ack_d0 <= rd_req_int;
rd_dat_d0 <= TS_FirstTrigTAIsec_i(47 downto 32);
when "10" =>
-- Reg TS_FirstTrigTAIsec
rd_ack_d0 <= rd_req_int;
rd_dat_d0 <= TS_FirstTrigTAIsec_i(31 downto 16);
when "11" =>
-- Reg TS_FirstTrigTAIsec
rd_ack_d0 <= rd_req_int;
rd_dat_d0 <= TS_FirstTrigTAIsec_i(15 downto 0);
when others =>
rd_ack_d0 <= rd_req_int;
end case;
when "1010" => when "1010" =>
case adr_int(2 downto 1) is
when "00" =>
-- Reg TS_FirstTrigTAIcycles
rd_ack_d0 <= rd_req_int;
rd_dat_d0 <= TS_FirstTrigTAIcycles_i(31 downto 16);
when "01" =>
-- Reg TS_FirstTrigTAIcycles
rd_ack_d0 <= rd_req_int;
rd_dat_d0 <= TS_FirstTrigTAIcycles_i(15 downto 0);
when others =>
rd_ack_d0 <= rd_req_int;
end case;
when "1011" =>
case adr_int(2 downto 1) is
when "00" =>
-- Reg TS_LastTrigTAIsec
rd_ack_d0 <= rd_req_int;
rd_dat_d0 <= TS_LastTrigTAIsec_i(63 downto 48);
when "01" =>
-- Reg TS_LastTrigTAIsec
rd_ack_d0 <= rd_req_int;
rd_dat_d0 <= TS_LastTrigTAIsec_i(47 downto 32);
when "10" =>
-- Reg TS_LastTrigTAIsec
rd_ack_d0 <= rd_req_int;
rd_dat_d0 <= TS_LastTrigTAIsec_i(31 downto 16);
when "11" =>
-- Reg TS_LastTrigTAIsec
rd_ack_d0 <= rd_req_int;
rd_dat_d0 <= TS_LastTrigTAIsec_i(15 downto 0);
when others =>
rd_ack_d0 <= rd_req_int;
end case;
when "1100" =>
case adr_int(2 downto 1) is
when "00" =>
-- Reg TS_LastTrigTAIcycles
rd_ack_d0 <= rd_req_int;
rd_dat_d0 <= TS_LastTrigTAIcycles_i(31 downto 16);
when "01" =>
-- Reg TS_LastTrigTAIcycles
rd_ack_d0 <= rd_req_int;
rd_dat_d0 <= TS_LastTrigTAIcycles_i(15 downto 0);
when others =>
rd_ack_d0 <= rd_req_int;
end case;
when "1110" =>
case adr_int(2 downto 2) is case adr_int(2 downto 2) is
when "0" => when "0" =>
case adr_int(1 downto 1) is case adr_int(1 downto 1) is
...@@ -817,7 +961,7 @@ begin ...@@ -817,7 +961,7 @@ begin
when others => when others =>
rd_ack_d0 <= rd_req_int; rd_ack_d0 <= rd_req_int;
end case; end case;
when "1011" => when "1111" =>
case adr_int(2 downto 1) is case adr_int(2 downto 1) is
when "00" => when "00" =>
-- Reg trigdiag_counter -- Reg trigdiag_counter
......
-- Do not edit. Generated on Tue Sep 07 11:28:03 2021 by jgill -- Do not edit. Generated on Mon Mar 13 15:51:08 2023 by jgill
-- With Cheby 1.4.dev0 and these options: -- With Cheby 1.4.dev0 and these options:
-- -i wr2rf_init_rf_regs.cheby --gen-hdl wr2rf_init_rf_regs.vhd -- -i wr2rf_init_rf_regs.cheby --gen-hdl wr2rf_init_rf_regs.vhd
......
-- Do not edit. Generated on Tue Sep 07 11:28:04 2021 by jgill -- Do not edit. Generated on Mon Mar 13 15:51:08 2023 by jgill
-- With Cheby 1.4.dev0 and these options: -- With Cheby 1.4.dev0 and these options:
-- -i RFNCO.cheby --gen-hdl -- -i RFNCO.cheby --gen-hdl
......
-- Do not edit. Generated on Tue Sep 07 11:28:03 2021 by jgill -- Do not edit. Generated on Mon Mar 13 15:51:08 2023 by jgill
-- With Cheby 1.4.dev0 and these options: -- With Cheby 1.4.dev0 and these options:
-- -i wr2rf_rftrigger_regs.cheby --gen-hdl wr2rf_rftrigger_regs.vhd -- -i wr2rf_rftrigger_regs.cheby --gen-hdl wr2rf_rftrigger_regs.vhd
......
-- Do not edit. Generated on Tue Sep 07 11:28:05 2021 by jgill -- Do not edit. Generated on Mon Mar 13 15:51:09 2023 by jgill
-- With Cheby 1.4.dev0 and these options: -- With Cheby 1.4.dev0 and these options:
-- -i wr2rf_vme_regs.cheby --gen-hdl wr2rf_vme_regs.vhd -- -i wr2rf_vme_regs.cheby --gen-hdl wr2rf_vme_regs.vhd
......
This diff is collapsed.
...@@ -350,8 +350,8 @@ begin ...@@ -350,8 +350,8 @@ begin
init_hwinfo_ident_jtagRemoteDisable_i => '1', init_hwinfo_ident_jtagRemoteDisable_i => '1',
init_hwinfo_ident_extendedID_i => "0000000", init_hwinfo_ident_extendedID_i => "0000000",
init_hwinfo_ident_cardID_i => x"56", init_hwinfo_ident_cardID_i => x"56",
init_hwinfo_firmwareVersion_i => x"0000_15_00", init_hwinfo_firmwareVersion_i => x"0000_16_00",
init_hwinfo_memMapVersion_i => x"0000_15_00", init_hwinfo_memMapVersion_i => x"0000_16_00",
init_hwinfo_echo_echo_o => open, init_hwinfo_echo_echo_o => open,
init_fw_update_i => wb_fw_update_in, init_fw_update_i => wb_fw_update_in,
......
...@@ -52,6 +52,10 @@ entity wr2rf_rftrigger is ...@@ -52,6 +52,10 @@ entity wr2rf_rftrigger is
wb_i : in t_wishbone_slave_in; wb_i : in t_wishbone_slave_in;
wb_o : out t_wishbone_slave_out; wb_o : out t_wishbone_slave_out;
-- TAI
tm_tai_i : in std_logic_vector(39 downto 0);
tm_cycles_i : in std_logic_vector(27 downto 0);
-- Pulse from the Reset/sync logic. -- Pulse from the Reset/sync logic.
rf_t1_sync_i : in std_logic; rf_t1_sync_i : in std_logic;
rf_t1_sync_p_o : inout std_logic; rf_t1_sync_p_o : inout std_logic;
...@@ -420,6 +424,8 @@ begin ...@@ -420,6 +424,8 @@ begin
rst_serdes_i => t1_rst_vtu_pulse_r, rst_serdes_i => t1_rst_vtu_pulse_r,
wb_i => t1_wb_in, wb_i => t1_wb_in,
wb_o => t1_wb_out, wb_o => t1_wb_out,
tm_tai_i => tm_tai_i,
tm_cycles_i => tm_cycles_i,
clk_rf_io_i => rf_clk_io, clk_rf_io_i => rf_clk_io,
clk_rf_i => clk_rf, clk_rf_i => clk_rf,
...@@ -471,6 +477,8 @@ begin ...@@ -471,6 +477,8 @@ begin
rst_serdes_i => t2_rst_vtu_pulse_r, rst_serdes_i => t2_rst_vtu_pulse_r,
wb_i => t2_wb_in, wb_i => t2_wb_in,
wb_o => t2_wb_out, wb_o => t2_wb_out,
tm_tai_i => tm_tai_i,
tm_cycles_i => tm_cycles_i,
clk_rf_io_i => rf_clk_io, clk_rf_io_i => rf_clk_io,
clk_rf_i => clk_rf, clk_rf_i => clk_rf,
......
...@@ -43,7 +43,7 @@ entity wr2rf_vme is ...@@ -43,7 +43,7 @@ entity wr2rf_vme is
generic ( generic (
g_simulation : integer := 0; g_simulation : integer := 0;
g_dpram_size : integer := 131072/4; g_dpram_size : integer := 131072/4;
g_dpram_initf : string := "../../../../dependencies/wrpc-sw/wrc-wr2rf-enabled-snmp-and-auxdiags.bram"; g_dpram_initf : string := "../../../../dependencies/wrpc-sw-file/wrc-wr2rf-enabled-snmp-and-auxdiags.bram";
-- g_dpram_initf : string := ""; -- g_dpram_initf : string := "";
g_diag_id : integer := 0; g_diag_id : integer := 0;
g_diag_ver : integer := 0; g_diag_ver : integer := 0;
...@@ -1363,6 +1363,8 @@ begin ...@@ -1363,6 +1363,8 @@ begin
iodelay_reset_i => iodelay_reset, iodelay_reset_i => iodelay_reset,
wb_i => wb_rf1_vtus_out, wb_i => wb_rf1_vtus_out,
wb_o => wb_rf1_vtus_in, wb_o => wb_rf1_vtus_in,
tm_tai_i => tm_tai,
tm_cycles_i => tm_cycles,
rf_t1_sync_i => nco_reset_rf1_trig1, rf_t1_sync_i => nco_reset_rf1_trig1,
rf_t1_sync_cdelay_i => rf1_t1_sync_cdelay, rf_t1_sync_cdelay_i => rf1_t1_sync_cdelay,
...@@ -1415,6 +1417,8 @@ begin ...@@ -1415,6 +1417,8 @@ begin
iodelay_reset_i => iodelay_reset, iodelay_reset_i => iodelay_reset,
wb_i => wb_rf2_vtus_out, wb_i => wb_rf2_vtus_out,
wb_o => wb_rf2_vtus_in, wb_o => wb_rf2_vtus_in,
tm_tai_i => tm_tai,
tm_cycles_i => tm_cycles,
rf_t1_sync_i => nco_reset_rf2_trig1, rf_t1_sync_i => nco_reset_rf2_trig1,
rf_t1_sync_cdelay_i => rf2_t1_sync_cdelay, rf_t1_sync_cdelay_i => rf2_t1_sync_cdelay,
......
...@@ -64,8 +64,20 @@ ...@@ -64,8 +64,20 @@
#define TRIGUNIT_REGS_TRIGODELAY_DELAY_MASK 0x1fUL #define TRIGUNIT_REGS_TRIGODELAY_DELAY_MASK 0x1fUL
#define TRIGUNIT_REGS_TRIGODELAY_DELAY_SHIFT 0 #define TRIGUNIT_REGS_TRIGODELAY_DELAY_SHIFT 0
/* Timestamp TAI seconds of the first VTU output trigger after a start pulse */
#define TRIGUNIT_REGS_TS_FIRSTTRIGTAISEC 0x48UL
/* Timestamp TAI cycles of the first VTU output trigger after a start pulse */
#define TRIGUNIT_REGS_TS_FIRSTTRIGTAICYCLES 0x50UL
/* Timestamp TAI seconds of the last VTU output trigger */
#define TRIGUNIT_REGS_TS_LASTTRIGTAISEC 0x58UL
/* Timestamp TAI cycles of the last VTU output trigger */
#define TRIGUNIT_REGS_TS_LASTTRIGTAICYCLES 0x60UL
/* None */ /* None */
#define TRIGUNIT_REGS_TRIGDIAG 0x50UL #define TRIGUNIT_REGS_TRIGDIAG 0x70UL
#define TRIGUNIT_REGS_TRIGDIAG_SIZE 16 /* 0x10 */ #define TRIGUNIT_REGS_TRIGDIAG_SIZE 16 /* 0x10 */
struct trigunit_regs { struct trigunit_regs {
...@@ -113,14 +125,29 @@ struct trigunit_regs { ...@@ -113,14 +125,29 @@ struct trigunit_regs {
/* [0x42]: REG (rw) Delay on the trigger output */ /* [0x42]: REG (rw) Delay on the trigger output */
uint16_t trigODelay; uint16_t trigODelay;
/* padding to: 20 words */ /* padding to: 18 words */
uint32_t __padding_2[3]; uint32_t __padding_2[1];
/* [0x50]: SUBMAP (no description) */ /* [0x48]: REG (ro) Timestamp TAI seconds of the first VTU output trigger after a start pulse */
struct vtudiag_regs trigdiag; uint64_t TS_FirstTrigTAIsec;
/* [0x50]: REG (ro) Timestamp TAI cycles of the first VTU output trigger after a start pulse */
uint32_t TS_FirstTrigTAIcycles;
/* padding to: 20 words */ /* padding to: 22 words */
uint32_t __padding_3[8]; uint32_t __padding_3[1];
/* [0x58]: REG (ro) Timestamp TAI seconds of the last VTU output trigger */
uint64_t TS_LastTrigTAIsec;
/* [0x60]: REG (ro) Timestamp TAI cycles of the last VTU output trigger */
uint32_t TS_LastTrigTAIcycles;
/* padding to: 28 words */
uint32_t __padding_4[3];
/* [0x70]: SUBMAP (no description) */
struct vtudiag_regs trigdiag;
}; };
#endif /* __CHEBY__TRIGUNIT_REGS__H__ */ #endif /* __CHEBY__TRIGUNIT_REGS__H__ */
#ifndef __CHEBY__WR2RF_INIT_REGS__H__ #ifndef __CHEBY__WR2RF_INIT_REGS__H__
#define __CHEBY__WR2RF_INIT_REGS__H__ #define __CHEBY__WR2RF_INIT_REGS__H__
#include "wr2rf_init_rf_regs.h"
#include "hwInfo.h" #include "hwInfo.h"
#include "wr2rf_init_rf_regs.h"
#include "oc_spi16_regs.h" #include "oc_spi16_regs.h"
#define WR2RF_INIT_REGS_SIZE 16384 /* 0x4000 = 16KB */ #define WR2RF_INIT_REGS_SIZE 16384 /* 0x4000 = 16KB */
......
#ifndef __CHEBY__WR2RF_RFTRIGGER_REGS__H__ #ifndef __CHEBY__WR2RF_RFTRIGGER_REGS__H__
#define __CHEBY__WR2RF_RFTRIGGER_REGS__H__ #define __CHEBY__WR2RF_RFTRIGGER_REGS__H__
#include "trigunit_regs.h"
#include "vtudiag_regs.h" #include "vtudiag_regs.h"
#include "trigunit_regs.h"
#define WR2RF_RFTRIGGER_REGS_SIZE 272 /* 0x110 */ #define WR2RF_RFTRIGGER_REGS_SIZE 272 /* 0x110 */
/* None */ /* None */
......
#ifndef __CHEBY__WR2RF_VME_REGS__H__ #ifndef __CHEBY__WR2RF_VME_REGS__H__
#define __CHEBY__WR2RF_VME_REGS__H__ #define __CHEBY__WR2RF_VME_REGS__H__
#include "wr2rf_ctrl_regs.h"
#include "wr2rf_init_regs.h" #include "wr2rf_init_regs.h"
#include "wr2rf_ctrl_regs.h"
#define WR2RF_VME_REGS_SIZE 32768 /* 0x8000 = 32KB */ #define WR2RF_VME_REGS_SIZE 32768 /* 0x8000 = 32KB */
/* Memory map for the initialization part */ /* Memory map for the initialization part */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment