Commit d82f7502 authored by Tristan Gingold's avatar Tristan Gingold

wr2rf: adjust registers map and signals for io changes.

parent 9d687efc
-- Do not edit. Generated on Mon May 04 16:51:42 2020 by gingold
-- Do not edit. Generated on Mon Jun 29 17:15:37 2020 by tgingold
-- With Cheby 1.4.dev0 and these options:
-- -i trigunit_regs.cheby --gen-hdl trigunit_regs.vhd
......@@ -368,177 +368,177 @@ begin
trigODelay_wreq <= '0';
trigdiag_control_wreq <= '0';
case wr_adr_d0(6 downto 3) is
when "0000" =>
when "0000" =>
case wr_adr_d0(2 downto 1) is
when "00" =>
when "00" =>
-- Reg status
wr_ack_int <= wr_req_d0;
when "01" =>
when "01" =>
-- Reg control
control_wreq <= wr_req_d0;
wr_ack_int <= control_wack;
when "10" =>
when "10" =>
-- Reg configOffline
configOffline_wreq <= wr_req_d0;
wr_ack_int <= configOffline_wack;
when others =>
wr_ack_int <= wr_req_d0;
end case;
when "0001" =>
when "0001" =>
case wr_adr_d0(2 downto 1) is
when "00" =>
when "00" =>
-- Reg bValueOffline
bValueOffline_wreq(3) <= wr_req_d0;
wr_ack_int <= bValueOffline_wack(3);
when "01" =>
when "01" =>
-- Reg bValueOffline
bValueOffline_wreq(2) <= wr_req_d0;
wr_ack_int <= bValueOffline_wack(2);
when "10" =>
when "10" =>
-- Reg bValueOffline
bValueOffline_wreq(1) <= wr_req_d0;
wr_ack_int <= bValueOffline_wack(1);
when "11" =>
when "11" =>
-- Reg bValueOffline
bValueOffline_wreq(0) <= wr_req_d0;
wr_ack_int <= bValueOffline_wack(0);
when others =>
wr_ack_int <= wr_req_d0;
end case;
when "0010" =>
when "0010" =>
case wr_adr_d0(2 downto 1) is
when "00" =>
when "00" =>
-- Reg htValueOffline
htValueOffline_wreq(3) <= wr_req_d0;
wr_ack_int <= htValueOffline_wack(3);
when "01" =>
when "01" =>
-- Reg htValueOffline
htValueOffline_wreq(2) <= wr_req_d0;
wr_ack_int <= htValueOffline_wack(2);
when "10" =>
when "10" =>
-- Reg htValueOffline
htValueOffline_wreq(1) <= wr_req_d0;
wr_ack_int <= htValueOffline_wack(1);
when "11" =>
when "11" =>
-- Reg htValueOffline
htValueOffline_wreq(0) <= wr_req_d0;
wr_ack_int <= htValueOffline_wack(0);
when others =>
wr_ack_int <= wr_req_d0;
end case;
when "0011" =>
when "0011" =>
case wr_adr_d0(2 downto 1) is
when "00" =>
when "00" =>
-- Reg wValueOffline
wValueOffline_wreq(3) <= wr_req_d0;
wr_ack_int <= wValueOffline_wack(3);
when "01" =>
when "01" =>
-- Reg wValueOffline
wValueOffline_wreq(2) <= wr_req_d0;
wr_ack_int <= wValueOffline_wack(2);
when "10" =>
when "10" =>
-- Reg wValueOffline
wValueOffline_wreq(1) <= wr_req_d0;
wr_ack_int <= wValueOffline_wack(1);
when "11" =>
when "11" =>
-- Reg wValueOffline
wValueOffline_wreq(0) <= wr_req_d0;
wr_ack_int <= wValueOffline_wack(0);
when others =>
wr_ack_int <= wr_req_d0;
end case;
when "0100" =>
when "0100" =>
case wr_adr_d0(2 downto 1) is
when "00" =>
when "00" =>
-- Reg configOnline
wr_ack_int <= wr_req_d0;
when others =>
wr_ack_int <= wr_req_d0;
end case;
when "0101" =>
when "0101" =>
case wr_adr_d0(2 downto 1) is
when "00" =>
when "00" =>
-- Reg bValueOnline
wr_ack_int <= wr_req_d0;
when "01" =>
when "01" =>
-- Reg bValueOnline
wr_ack_int <= wr_req_d0;
when "10" =>
when "10" =>
-- Reg bValueOnline
wr_ack_int <= wr_req_d0;
when "11" =>
when "11" =>
-- Reg bValueOnline
wr_ack_int <= wr_req_d0;
when others =>
wr_ack_int <= wr_req_d0;
end case;
when "0110" =>
when "0110" =>
case wr_adr_d0(2 downto 1) is
when "00" =>
when "00" =>
-- Reg htValueOnline
wr_ack_int <= wr_req_d0;
when "01" =>
when "01" =>
-- Reg htValueOnline
wr_ack_int <= wr_req_d0;
when "10" =>
when "10" =>
-- Reg htValueOnline
wr_ack_int <= wr_req_d0;
when "11" =>
when "11" =>
-- Reg htValueOnline
wr_ack_int <= wr_req_d0;
when others =>
wr_ack_int <= wr_req_d0;
end case;
when "0111" =>
when "0111" =>
case wr_adr_d0(2 downto 1) is
when "00" =>
when "00" =>
-- Reg wValueOnline
wr_ack_int <= wr_req_d0;
when "01" =>
when "01" =>
-- Reg wValueOnline
wr_ack_int <= wr_req_d0;
when "10" =>
when "10" =>
-- Reg wValueOnline
wr_ack_int <= wr_req_d0;
when "11" =>
when "11" =>
-- Reg wValueOnline
wr_ack_int <= wr_req_d0;
when others =>
wr_ack_int <= wr_req_d0;
end case;
when "1000" =>
when "1000" =>
case wr_adr_d0(2 downto 1) is
when "00" =>
when "00" =>
-- Reg syncIDelay
syncIDelay_wreq <= wr_req_d0;
wr_ack_int <= wr_req_d0;
when "01" =>
when "01" =>
-- Reg trigODelay
trigODelay_wreq <= wr_req_d0;
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 2) is
when "0" =>
when "0" =>
case wr_adr_d0(1 downto 1) is
when "0" =>
when "0" =>
-- Reg trigdiag_control
trigdiag_control_wreq <= wr_req_d0;
wr_ack_int <= trigdiag_control_wack;
when "1" =>
when "1" =>
-- Reg trigdiag_generation
wr_ack_int <= wr_req_d0;
when others =>
wr_ack_int <= wr_req_d0;
end case;
when "1" =>
when "1" =>
case wr_adr_d0(1 downto 1) is
when "0" =>
when "0" =>
-- Reg trigdiag_freq
wr_ack_int <= wr_req_d0;
when "1" =>
when "1" =>
-- Reg trigdiag_freq
wr_ack_int <= wr_req_d0;
when others =>
......@@ -547,12 +547,12 @@ begin
when others =>
wr_ack_int <= wr_req_d0;
end case;
when "1011" =>
when "1011" =>
case wr_adr_d0(2 downto 1) is
when "00" =>
when "00" =>
-- Reg trigdiag_counter
wr_ack_int <= wr_req_d0;
when "01" =>
when "01" =>
-- Reg trigdiag_counter
wr_ack_int <= wr_req_d0;
when others =>
......@@ -568,9 +568,9 @@ begin
-- By default ack read requests
rd_dat_d0 <= (others => 'X');
case adr_int(6 downto 3) is
when "0000" =>
when "0000" =>
case adr_int(2 downto 1) is
when "00" =>
when "00" =>
-- Reg status
rd_ack_d0 <= rd_req_int;
rd_dat_d0(0) <= '0';
......@@ -582,10 +582,10 @@ begin
rd_dat_d0(6) <= status_missReady_i;
rd_dat_d0(7) <= status_missValid_i;
rd_dat_d0(15 downto 8) <= (others => '0');
when "01" =>
when "01" =>
-- Reg control
rd_ack_d0 <= rd_req_int;
when "10" =>
when "10" =>
-- Reg configOffline
rd_ack_d0 <= rd_req_int;
rd_dat_d0(0) <= configOffline_valid_i;
......@@ -596,72 +596,72 @@ begin
when others =>
rd_ack_d0 <= rd_req_int;
end case;
when "0001" =>
when "0001" =>
case adr_int(2 downto 1) is
when "00" =>
when "00" =>
-- Reg bValueOffline
rd_ack_d0 <= rd_req_int;
rd_dat_d0 <= bValueOffline_reg(63 downto 48);
when "01" =>
when "01" =>
-- Reg bValueOffline
rd_ack_d0 <= rd_req_int;
rd_dat_d0 <= bValueOffline_reg(47 downto 32);
when "10" =>
when "10" =>
-- Reg bValueOffline
rd_ack_d0 <= rd_req_int;
rd_dat_d0 <= bValueOffline_reg(31 downto 16);
when "11" =>
when "11" =>
-- Reg bValueOffline
rd_ack_d0 <= rd_req_int;
rd_dat_d0 <= bValueOffline_reg(15 downto 0);
when others =>
rd_ack_d0 <= rd_req_int;
end case;
when "0010" =>
when "0010" =>
case adr_int(2 downto 1) is
when "00" =>
when "00" =>
-- Reg htValueOffline
rd_ack_d0 <= rd_req_int;
rd_dat_d0 <= htValueOffline_reg(63 downto 48);
when "01" =>
when "01" =>
-- Reg htValueOffline
rd_ack_d0 <= rd_req_int;
rd_dat_d0 <= htValueOffline_reg(47 downto 32);
when "10" =>
when "10" =>
-- Reg htValueOffline
rd_ack_d0 <= rd_req_int;
rd_dat_d0 <= htValueOffline_reg(31 downto 16);
when "11" =>
when "11" =>
-- Reg htValueOffline
rd_ack_d0 <= rd_req_int;
rd_dat_d0 <= htValueOffline_reg(15 downto 0);
when others =>
rd_ack_d0 <= rd_req_int;
end case;
when "0011" =>
when "0011" =>
case adr_int(2 downto 1) is
when "00" =>
when "00" =>
-- Reg wValueOffline
rd_ack_d0 <= rd_req_int;
rd_dat_d0 <= wValueOffline_reg(63 downto 48);
when "01" =>
when "01" =>
-- Reg wValueOffline
rd_ack_d0 <= rd_req_int;
rd_dat_d0 <= wValueOffline_reg(47 downto 32);
when "10" =>
when "10" =>
-- Reg wValueOffline
rd_ack_d0 <= rd_req_int;
rd_dat_d0 <= wValueOffline_reg(31 downto 16);
when "11" =>
when "11" =>
-- Reg wValueOffline
rd_ack_d0 <= rd_req_int;
rd_dat_d0 <= wValueOffline_reg(15 downto 0);
when others =>
rd_ack_d0 <= rd_req_int;
end case;
when "0100" =>
when "0100" =>
case adr_int(2 downto 1) is
when "00" =>
when "00" =>
-- Reg configOnline
rd_ack_d0 <= rd_req_int;
rd_dat_d0(0) <= '0';
......@@ -672,77 +672,77 @@ begin
when others =>
rd_ack_d0 <= rd_req_int;
end case;
when "0101" =>
when "0101" =>
case adr_int(2 downto 1) is
when "00" =>
when "00" =>
-- Reg bValueOnline
rd_ack_d0 <= rd_req_int;
rd_dat_d0 <= bValueOnline_i(63 downto 48);
when "01" =>
when "01" =>
-- Reg bValueOnline
rd_ack_d0 <= rd_req_int;
rd_dat_d0 <= bValueOnline_i(47 downto 32);
when "10" =>
when "10" =>
-- Reg bValueOnline
rd_ack_d0 <= rd_req_int;
rd_dat_d0 <= bValueOnline_i(31 downto 16);
when "11" =>
when "11" =>
-- Reg bValueOnline
rd_ack_d0 <= rd_req_int;
rd_dat_d0 <= bValueOnline_i(15 downto 0);
when others =>
rd_ack_d0 <= rd_req_int;
end case;
when "0110" =>
when "0110" =>
case adr_int(2 downto 1) is
when "00" =>
when "00" =>
-- Reg htValueOnline
rd_ack_d0 <= rd_req_int;
rd_dat_d0 <= htValueOnline_i(63 downto 48);
when "01" =>
when "01" =>
-- Reg htValueOnline
rd_ack_d0 <= rd_req_int;
rd_dat_d0 <= htValueOnline_i(47 downto 32);
when "10" =>
when "10" =>
-- Reg htValueOnline
rd_ack_d0 <= rd_req_int;
rd_dat_d0 <= htValueOnline_i(31 downto 16);
when "11" =>
when "11" =>
-- Reg htValueOnline
rd_ack_d0 <= rd_req_int;
rd_dat_d0 <= htValueOnline_i(15 downto 0);
when others =>
rd_ack_d0 <= rd_req_int;
end case;
when "0111" =>
when "0111" =>
case adr_int(2 downto 1) is
when "00" =>
when "00" =>
-- Reg wValueOnline
rd_ack_d0 <= rd_req_int;
rd_dat_d0 <= wValueOnline_i(63 downto 48);
when "01" =>
when "01" =>
-- Reg wValueOnline
rd_ack_d0 <= rd_req_int;
rd_dat_d0 <= wValueOnline_i(47 downto 32);
when "10" =>
when "10" =>
-- Reg wValueOnline
rd_ack_d0 <= rd_req_int;
rd_dat_d0 <= wValueOnline_i(31 downto 16);
when "11" =>
when "11" =>
-- Reg wValueOnline
rd_ack_d0 <= rd_req_int;
rd_dat_d0 <= wValueOnline_i(15 downto 0);
when others =>
rd_ack_d0 <= rd_req_int;
end case;
when "1000" =>
when "1000" =>
case adr_int(2 downto 1) is
when "00" =>
when "00" =>
-- Reg syncIDelay
rd_ack_d0 <= rd_req_int;
rd_dat_d0(4 downto 0) <= syncIDelay_delay_i;
rd_dat_d0(15 downto 5) <= (others => '0');
when "01" =>
when "01" =>
-- Reg trigODelay
rd_ack_d0 <= rd_req_int;
rd_dat_d0(4 downto 0) <= trigODelay_delay_i;
......@@ -750,31 +750,31 @@ begin
when others =>
rd_ack_d0 <= rd_req_int;
end case;
when "1010" =>
when "1010" =>
case adr_int(2 downto 2) is
when "0" =>
when "0" =>
case adr_int(1 downto 1) is
when "0" =>
when "0" =>
-- Reg trigdiag_control
rd_ack_d0 <= rd_req_int;
rd_dat_d0(2 downto 0) <= trigdiag_control_window_reg;
rd_dat_d0(3) <= '0';
rd_dat_d0(4) <= trigdiag_control_enable_reg;
rd_dat_d0(15 downto 5) <= (others => '0');
when "1" =>
when "1" =>
-- Reg trigdiag_generation
rd_ack_d0 <= rd_req_int;
rd_dat_d0 <= trigdiag_generation_i;
when others =>
rd_ack_d0 <= rd_req_int;
end case;
when "1" =>
when "1" =>
case adr_int(1 downto 1) is
when "0" =>
when "0" =>
-- Reg trigdiag_freq
rd_ack_d0 <= rd_req_int;
rd_dat_d0 <= trigdiag_freq_i(31 downto 16);
when "1" =>
when "1" =>
-- Reg trigdiag_freq
rd_ack_d0 <= rd_req_int;
rd_dat_d0 <= trigdiag_freq_i(15 downto 0);
......@@ -784,13 +784,13 @@ begin
when others =>
rd_ack_d0 <= rd_req_int;
end case;
when "1011" =>
when "1011" =>
case adr_int(2 downto 1) is
when "00" =>
when "00" =>
-- Reg trigdiag_counter
rd_ack_d0 <= rd_req_int;
rd_dat_d0 <= trigdiag_counter_i(31 downto 16);
when "01" =>
when "01" =>
-- Reg trigdiag_counter
rd_ack_d0 <= rd_req_int;
rd_dat_d0 <= trigdiag_counter_i(15 downto 0);
......
......@@ -58,9 +58,9 @@ entity wr2rf_core is
tmg_clk_term_en_o : out std_logic_vector(2 downto 1);
tmg_io_term_en_o : out std_logic_vector(4 downto 1);
tmg_clk_oe_o : out std_logic_vector(1 downto 0);
tmg_io_dir_o : out std_logic;
ext_ref_dir_o : out std_logic;
tmg_clk_oe_o : out std_logic_vector(1 downto 0);
tmg_io_oe_o : out std_logic_vector(4 downto 1);
ext_ref_dir_o : out std_logic;
dds_cs_n_o : out std_logic;
rf1_iqdac_cs_n_o : out std_logic;
......@@ -143,8 +143,8 @@ begin
init_tmg_io_term_o => tmg_io_term_en_o,
init_tmg_clk_term_o => tmg_clk_term_en_o,
init_tmg_clk_oe_o => tmg_clk_oe_o,
init_tmg_io_dir_o => tmg_io_dir_o,
init_tmg_clk_oe_o => tmg_clk_oe_o,
init_tmg_io_oe_o => tmg_io_oe_o,
init_pin_ctrl_ext_ref_dir_o => ext_ref_dir_o,
init_pll_spi_i => pll_spi_in,
......
......@@ -55,18 +55,18 @@ memory-map:
name: io_term
description: terminations for UBT
range: 3-0
- field:
name: io_oe
description: Output enable for general IO signals (not clocks)
range: 7-4
- field:
name: clk_term
description: terminations for UBT
range: 5-4
range: 9-8
- field:
name: clk_oe
description: independent bidirectional control for clock outputs
range: 9-8
- field:
name: io_dir
description: bidirectional control for x4 general IO signals (not clocks)
range: 10
range: 11-10
- reg:
name: pin_ctrl
description: timing io grouping of signals
......
-- Do not edit. Generated on Wed May 20 15:05:47 2020 by tgingold
-- Do not edit. Generated on Mon Jun 29 17:15:38 2020 by tgingold
-- With Cheby 1.4.dev0 and these options:
-- -i wr2rf_init_rf_regs.cheby --gen-hdl wr2rf_init_rf_regs.vhd
......@@ -355,43 +355,43 @@ begin
rf2_ch_1_csr_wreq <= '0';
rf2_ch_1_delay_wreq <= '0';
case wr_adr_d0(4 downto 1) is
when "0000" =>
when "0000" =>
-- Reg rf1_common
rf1_common_wreq <= wr_req_d0;
wr_ack_int <= rf1_common_wack;
when "0100" =>
when "0100" =>
-- Reg rf1_ch_0_csr
rf1_ch_0_csr_wreq <= wr_req_d0;
wr_ack_int <= rf1_ch_0_csr_wack;
when "0101" =>
when "0101" =>
-- Reg rf1_ch_0_delay
rf1_ch_0_delay_wreq <= wr_req_d0;
wr_ack_int <= rf1_ch_0_delay_wack;
when "0110" =>
when "0110" =>
-- Reg rf1_ch_1_csr
rf1_ch_1_csr_wreq <= wr_req_d0;
wr_ack_int <= rf1_ch_1_csr_wack;
when "0111" =>
when "0111" =>
-- Reg rf1_ch_1_delay
rf1_ch_1_delay_wreq <= wr_req_d0;
wr_ack_int <= rf1_ch_1_delay_wack;
when "1000" =>
when "1000" =>
-- Reg rf2_common
rf2_common_wreq <= wr_req_d0;
wr_ack_int <= rf2_common_wack;
when "1100" =>
when "1100" =>
-- Reg rf2_ch_0_csr
rf2_ch_0_csr_wreq <= wr_req_d0;
wr_ack_int <= rf2_ch_0_csr_wack;
when "1101" =>
when "1101" =>
-- Reg rf2_ch_0_delay
rf2_ch_0_delay_wreq <= wr_req_d0;
wr_ack_int <= rf2_ch_0_delay_wack;
when "1110" =>
when "1110" =>
-- Reg rf2_ch_1_csr
rf2_ch_1_csr_wreq <= wr_req_d0;
wr_ack_int <= rf2_ch_1_csr_wack;
when "1111" =>
when "1111" =>
-- Reg rf2_ch_1_delay
rf2_ch_1_delay_wreq <= wr_req_d0;
wr_ack_int <= rf2_ch_1_delay_wack;
......@@ -405,52 +405,52 @@ begin
-- By default ack read requests
rd_dat_d0 <= (others => 'X');
case adr_int(4 downto 1) is
when "0000" =>
when "0000" =>
-- Reg rf1_common
rd_ack_d0 <= rd_req_int;
rd_dat_d0(0) <= rf1_common_mixer_en_reg;
rd_dat_d0(2 downto 1) <= rf1_common_mux_sel_reg;
rd_dat_d0(15 downto 3) <= (others => '0');
when "0100" =>
when "0100" =>
-- Reg rf1_ch_0_csr
rd_ack_d0 <= rd_req_int;
rd_dat_d0(0) <= rf1_ch_0_csr_delay_oen_reg;
rd_dat_d0(1) <= rf1_ch_0_csr_mux_sel_reg;
rd_dat_d0(15 downto 2) <= (others => '0');
when "0101" =>
when "0101" =>
-- Reg rf1_ch_0_delay
rd_ack_d0 <= rd_req_int;
when "0110" =>
when "0110" =>
-- Reg rf1_ch_1_csr
rd_ack_d0 <= rd_req_int;
rd_dat_d0(0) <= rf1_ch_1_csr_delay_oen_reg;
rd_dat_d0(1) <= rf1_ch_1_csr_mux_sel_reg;
rd_dat_d0(15 downto 2) <= (others => '0');
when "0111" =>
when "0111" =>
-- Reg rf1_ch_1_delay
rd_ack_d0 <= rd_req_int;
when "1000" =>
when "1000" =>
-- Reg rf2_common
rd_ack_d0 <= rd_req_int;
rd_dat_d0(0) <= rf2_common_mixer_en_reg;
rd_dat_d0(2 downto 1) <= rf2_common_mux_sel_reg;
rd_dat_d0(15 downto 3) <= (others => '0');
when "1100" =>
when "1100" =>
-- Reg rf2_ch_0_csr
rd_ack_d0 <= rd_req_int;
rd_dat_d0(0) <= rf2_ch_0_csr_delay_oen_reg;
rd_dat_d0(1) <= rf2_ch_0_csr_mux_sel_reg;
rd_dat_d0(15 downto 2) <= (others => '0');
when "1101" =>
when "1101" =>
-- Reg rf2_ch_0_delay
rd_ack_d0 <= rd_req_int;
when "1110" =>
when "1110" =>
-- Reg rf2_ch_1_csr
rd_ack_d0 <= rd_req_int;
rd_dat_d0(0) <= rf2_ch_1_csr_delay_oen_reg;
rd_dat_d0(1) <= rf2_ch_1_csr_mux_sel_reg;
rd_dat_d0(15 downto 2) <= (others => '0');
when "1111" =>
when "1111" =>
-- Reg rf2_ch_1_delay
rd_ack_d0 <= rd_req_int;
when others =>
......
-- Do not edit. Generated on Wed May 20 15:05:47 2020 by tgingold
-- Do not edit. Generated on Mon Jun 29 17:15:38 2020 by tgingold
-- With Cheby 1.4.dev0 and these options:
-- -i wr2rf_rftrigger_regs.cheby --gen-hdl wr2rf_rftrigger_regs.vhd
......@@ -200,45 +200,45 @@ begin
t2_we <= '0';
rf_diag_control_wreq <= '0';
case wr_adr_d0(8 downto 7) is
when "00" =>
when "00" =>
-- Submap t1
t1_we <= wr_req_d0;
wr_ack_int <= t1_wack;
when "01" =>
when "01" =>
-- Submap t2
t2_we <= wr_req_d0;
wr_ack_int <= t2_wack;
when "10" =>
when "10" =>
case wr_adr_d0(6 downto 2) is
when "00000" =>
when "00000" =>
case wr_adr_d0(1 downto 1) is
when "0" =>
when "0" =>
-- Reg rf_diag_control
rf_diag_control_wreq <= wr_req_d0;
wr_ack_int <= rf_diag_control_wack;
when "1" =>
when "1" =>
-- Reg rf_diag_generation
wr_ack_int <= wr_req_d0;
when others =>
wr_ack_int <= wr_req_d0;
end case;
when "00001" =>
when "00001" =>
case wr_adr_d0(1 downto 1) is
when "0" =>
when "0" =>
-- Reg rf_diag_freq
wr_ack_int <= wr_req_d0;
when "1" =>
when "1" =>
-- Reg rf_diag_freq
wr_ack_int <= wr_req_d0;
when others =>
wr_ack_int <= wr_req_d0;
end case;
when "00010" =>
when "00010" =>
case wr_adr_d0(1 downto 1) is
when "0" =>
when "0" =>
-- Reg rf_diag_counter
wr_ack_int <= wr_req_d0;
when "1" =>
when "1" =>
-- Reg rf_diag_counter
wr_ack_int <= wr_req_d0;
when others =>
......@@ -259,54 +259,54 @@ begin
t1_re <= '0';
t2_re <= '0';
case adr_int(8 downto 7) is
when "00" =>
when "00" =>
-- Submap t1
t1_re <= rd_req_int;
rd_dat_d0 <= t1_i.dat(15 downto 0);
rd_ack_d0 <= t1_rack;
when "01" =>
when "01" =>
-- Submap t2
t2_re <= rd_req_int;
rd_dat_d0 <= t2_i.dat(15 downto 0);
rd_ack_d0 <= t2_rack;
when "10" =>
when "10" =>
case adr_int(6 downto 2) is
when "00000" =>
when "00000" =>
case adr_int(1 downto 1) is
when "0" =>
when "0" =>
-- Reg rf_diag_control
rd_ack_d0 <= rd_req_int;
rd_dat_d0(2 downto 0) <= rf_diag_control_window_reg;
rd_dat_d0(3) <= '0';
rd_dat_d0(4) <= rf_diag_control_enable_reg;
rd_dat_d0(15 downto 5) <= (others => '0');
when "1" =>
when "1" =>
-- Reg rf_diag_generation
rd_ack_d0 <= rd_req_int;
rd_dat_d0 <= rf_diag_generation_i;
when others =>
rd_ack_d0 <= rd_req_int;
end case;
when "00001" =>
when "00001" =>
case adr_int(1 downto 1) is
when "0" =>
when "0" =>
-- Reg rf_diag_freq
rd_ack_d0 <= rd_req_int;
rd_dat_d0 <= rf_diag_freq_i(31 downto 16);
when "1" =>
when "1" =>
-- Reg rf_diag_freq
rd_ack_d0 <= rd_req_int;
rd_dat_d0 <= rf_diag_freq_i(15 downto 0);
when others =>
rd_ack_d0 <= rd_req_int;
end case;
when "00010" =>
when "00010" =>
case adr_int(1 downto 1) is
when "0" =>
when "0" =>
-- Reg rf_diag_counter
rd_ack_d0 <= rd_req_int;
rd_dat_d0 <= rf_diag_counter_i(31 downto 16);
when "1" =>
when "1" =>
-- Reg rf_diag_counter
rd_ack_d0 <= rd_req_int;
rd_dat_d0 <= rf_diag_counter_i(15 downto 0);
......
-- Do not edit. Generated on Fri May 22 12:11:59 2020 by tgingold
-- Do not edit. Generated on Mon Jun 29 17:15:39 2020 by tgingold
-- With Cheby 1.4.dev0 and these options:
-- -i wr2rf_vme_regs.cheby --gen-hdl wr2rf_vme_regs.vhd
......@@ -49,12 +49,12 @@ entity wr2rf_vme_regs is
-- timing io grouping of signals
-- terminations for UBT
init_tmg_io_term_o : out std_logic_vector(3 downto 0);
-- Output enable for general IO signals (not clocks)
init_tmg_io_oe_o : out std_logic_vector(3 downto 0);
-- terminations for UBT
init_tmg_clk_term_o : out std_logic_vector(1 downto 0);
-- independent bidirectional control for clock outputs
init_tmg_clk_oe_o : out std_logic_vector(1 downto 0);
-- bidirectional control for x4 general IO signals (not clocks)
init_tmg_io_dir_o : out std_logic;
-- timing io grouping of signals
-- 0: input, 1 : output
......@@ -124,9 +124,9 @@ architecture syn of wr2rf_vme_regs is
signal init_mmcm_shift_wreq : std_logic;
signal init_mmcm_shift_wack : std_logic;
signal init_tmg_io_term_reg : std_logic_vector(3 downto 0);
signal init_tmg_io_oe_reg : std_logic_vector(3 downto 0);
signal init_tmg_clk_term_reg : std_logic_vector(1 downto 0);
signal init_tmg_clk_oe_reg : std_logic_vector(1 downto 0);
signal init_tmg_io_dir_reg : std_logic;
signal init_tmg_wreq : std_logic;
signal init_tmg_wack : std_logic;
signal init_pin_ctrl_ext_ref_dir_reg : std_logic;
......@@ -340,23 +340,23 @@ begin
-- Register init_tmg
init_tmg_io_term_o <= init_tmg_io_term_reg;
init_tmg_io_oe_o <= init_tmg_io_oe_reg;
init_tmg_clk_term_o <= init_tmg_clk_term_reg;
init_tmg_clk_oe_o <= init_tmg_clk_oe_reg;
init_tmg_io_dir_o <= init_tmg_io_dir_reg;
process (clk_i) begin
if rising_edge(clk_i) then
if rst_n_i = '0' then
init_tmg_io_term_reg <= "0000";
init_tmg_io_oe_reg <= "0000";
init_tmg_clk_term_reg <= "00";
init_tmg_clk_oe_reg <= "00";
init_tmg_io_dir_reg <= '0';
init_tmg_wack <= '0';
else
if init_tmg_wreq = '1' then
init_tmg_io_term_reg <= wr_dat_d0(3 downto 0);
init_tmg_clk_term_reg <= wr_dat_d0(5 downto 4);
init_tmg_clk_oe_reg <= wr_dat_d0(9 downto 8);
init_tmg_io_dir_reg <= wr_dat_d0(10);
init_tmg_io_oe_reg <= wr_dat_d0(7 downto 4);
init_tmg_clk_term_reg <= wr_dat_d0(9 downto 8);
init_tmg_clk_oe_reg <= wr_dat_d0(11 downto 10);
end if;
init_tmg_wack <= init_tmg_wreq;
end if;
......@@ -505,23 +505,23 @@ begin
init_rf_we <= '0';
init_wrpc_we <= '0';
case wr_adr_d0(18 downto 17) is
when "00" =>
when "00" =>
case wr_adr_d0(16 downto 9) is
when "00000000" =>
when "00000000" =>
-- Submap ctrl_rf1_vtus
ctrl_rf1_vtus_we <= wr_req_d0;
wr_ack_int <= ctrl_rf1_vtus_wack;
when "00000001" =>
when "00000001" =>
-- Submap ctrl_rf2_vtus
ctrl_rf2_vtus_we <= wr_req_d0;
wr_ack_int <= ctrl_rf2_vtus_wack;
when "00000010" =>
when "00000010" =>
case wr_adr_d0(8 downto 1) is
when "00000000" =>
when "00000000" =>
-- Reg ctrl_reg1
ctrl_reg1_wreq <= wr_req_d0;
wr_ack_int <= ctrl_reg1_wack;
when "00000001" =>
when "00000001" =>
-- Reg ctrl_reg2
ctrl_reg2_wreq <= wr_req_d0;
wr_ack_int <= ctrl_reg2_wack;
......@@ -531,52 +531,52 @@ begin
when others =>
wr_ack_int <= wr_req_d0;
end case;
when "10" =>
when "10" =>
case wr_adr_d0(16 downto 5) is
when "000000000000" =>
when "000000000000" =>
case wr_adr_d0(4 downto 1) is
when "0000" =>
when "0000" =>
-- Reg init_clock_ctrl
init_clock_ctrl_wreq <= wr_req_d0;
wr_ack_int <= init_clock_ctrl_wack;
when "0001" =>
when "0001" =>
-- Reg init_mmcm_shift
init_mmcm_shift_wreq <= wr_req_d0;
wr_ack_int <= init_mmcm_shift_wack;
when "0010" =>
when "0010" =>
-- Reg init_clock_status
wr_ack_int <= wr_req_d0;
when "0011" =>
when "0011" =>
-- Reg init_tmg
init_tmg_wreq <= wr_req_d0;
wr_ack_int <= init_tmg_wack;
when "0100" =>
when "0100" =>
-- Reg init_pin_ctrl
init_pin_ctrl_wreq <= wr_req_d0;
wr_ack_int <= init_pin_ctrl_wack;
when others =>
wr_ack_int <= wr_req_d0;
end case;
when "000000000001" =>
when "000000000001" =>
-- Submap init_pll_spi
init_pll_spi_we <= wr_req_d0;
wr_ack_int <= init_pll_spi_wack;
when "000000000010" =>
when "000000000010" =>
-- Submap init_rf_spi
init_rf_spi_we <= wr_req_d0;
wr_ack_int <= init_rf_spi_wack;
when "000000000011" =>
when "000000000011" =>
-- Submap init_fw_update
init_fw_update_we <= wr_req_d0;
wr_ack_int <= init_fw_update_wack;
when "000000000100" =>
when "000000000100" =>
-- Submap init_rf
init_rf_we <= wr_req_d0;
wr_ack_int <= init_rf_wack;
when others =>
wr_ack_int <= wr_req_d0;
end case;
when "11" =>
when "11" =>
-- Submap init_wrpc
init_wrpc_we <= wr_req_d0;
wr_ack_int <= init_wrpc_wack;
......@@ -586,7 +586,7 @@ begin
end process;
-- Process for read requests.
process (adr_int, rd_req_int, ctrl_rf1_vtus_i.dat, ctrl_rf1_vtus_rack, ctrl_rf2_vtus_i.dat, ctrl_rf2_vtus_rack, ctrl_reg1_reg, ctrl_reg2_reg, init_clock_ctrl_clk_sel_reg, init_clock_ctrl_mmcm_reset_reg, init_clock_status_mmcm_locked_i, init_clock_status_shift_busy_i, init_tmg_io_term_reg, init_tmg_clk_term_reg, init_tmg_clk_oe_reg, init_tmg_io_dir_reg, init_pin_ctrl_ext_ref_dir_reg, init_pll_spi_i.dat, init_pll_spi_rack, init_rf_spi_i.dat, init_rf_spi_rack, init_fw_update_i.dat, init_fw_update_rack, init_rf_i.dat, init_rf_rack, init_wrpc_i.dat, init_wrpc_rack) begin
process (adr_int, rd_req_int, ctrl_rf1_vtus_i.dat, ctrl_rf1_vtus_rack, ctrl_rf2_vtus_i.dat, ctrl_rf2_vtus_rack, ctrl_reg1_reg, ctrl_reg2_reg, init_clock_ctrl_clk_sel_reg, init_clock_ctrl_mmcm_reset_reg, init_clock_status_mmcm_locked_i, init_clock_status_shift_busy_i, init_tmg_io_term_reg, init_tmg_io_oe_reg, init_tmg_clk_term_reg, init_tmg_clk_oe_reg, init_pin_ctrl_ext_ref_dir_reg, init_pll_spi_i.dat, init_pll_spi_rack, init_rf_spi_i.dat, init_rf_spi_rack, init_fw_update_i.dat, init_fw_update_rack, init_rf_i.dat, init_rf_rack, init_wrpc_i.dat, init_wrpc_rack) begin
-- By default ack read requests
rd_dat_d0 <= (others => 'X');
ctrl_rf1_vtus_re <= '0';
......@@ -597,25 +597,25 @@ begin
init_rf_re <= '0';
init_wrpc_re <= '0';
case adr_int(18 downto 17) is
when "00" =>
when "00" =>
case adr_int(16 downto 9) is
when "00000000" =>
when "00000000" =>
-- Submap ctrl_rf1_vtus
ctrl_rf1_vtus_re <= rd_req_int;
rd_dat_d0 <= ctrl_rf1_vtus_i.dat(15 downto 0);
rd_ack_d0 <= ctrl_rf1_vtus_rack;
when "00000001" =>
when "00000001" =>
-- Submap ctrl_rf2_vtus
ctrl_rf2_vtus_re <= rd_req_int;
rd_dat_d0 <= ctrl_rf2_vtus_i.dat(15 downto 0);
rd_ack_d0 <= ctrl_rf2_vtus_rack;
when "00000010" =>
when "00000010" =>
case adr_int(8 downto 1) is
when "00000000" =>
when "00000000" =>
-- Reg ctrl_reg1
rd_ack_d0 <= rd_req_int;
rd_dat_d0 <= ctrl_reg1_reg;
when "00000001" =>
when "00000001" =>
-- Reg ctrl_reg2
rd_ack_d0 <= rd_req_int;
rd_dat_d0 <= ctrl_reg2_reg;
......@@ -625,35 +625,34 @@ begin
when others =>
rd_ack_d0 <= rd_req_int;
end case;
when "10" =>
when "10" =>
case adr_int(16 downto 5) is
when "000000000000" =>
when "000000000000" =>
case adr_int(4 downto 1) is
when "0000" =>
when "0000" =>
-- Reg init_clock_ctrl
rd_ack_d0 <= rd_req_int;
rd_dat_d0(0) <= init_clock_ctrl_clk_sel_reg;
rd_dat_d0(1) <= init_clock_ctrl_mmcm_reset_reg;
rd_dat_d0(15 downto 2) <= (others => '0');
when "0001" =>
when "0001" =>
-- Reg init_mmcm_shift
rd_ack_d0 <= rd_req_int;
when "0010" =>
when "0010" =>
-- Reg init_clock_status
rd_ack_d0 <= rd_req_int;
rd_dat_d0(0) <= init_clock_status_mmcm_locked_i;
rd_dat_d0(1) <= init_clock_status_shift_busy_i;
rd_dat_d0(15 downto 2) <= (others => '0');
when "0011" =>
when "0011" =>
-- Reg init_tmg
rd_ack_d0 <= rd_req_int;
rd_dat_d0(3 downto 0) <= init_tmg_io_term_reg;
rd_dat_d0(5 downto 4) <= init_tmg_clk_term_reg;
rd_dat_d0(7 downto 6) <= (others => '0');
rd_dat_d0(9 downto 8) <= init_tmg_clk_oe_reg;
rd_dat_d0(10) <= init_tmg_io_dir_reg;
rd_dat_d0(15 downto 11) <= (others => '0');
when "0100" =>
rd_dat_d0(7 downto 4) <= init_tmg_io_oe_reg;
rd_dat_d0(9 downto 8) <= init_tmg_clk_term_reg;
rd_dat_d0(11 downto 10) <= init_tmg_clk_oe_reg;
rd_dat_d0(15 downto 12) <= (others => '0');
when "0100" =>
-- Reg init_pin_ctrl
rd_ack_d0 <= rd_req_int;
rd_dat_d0(0) <= init_pin_ctrl_ext_ref_dir_reg;
......@@ -661,22 +660,22 @@ begin
when others =>
rd_ack_d0 <= rd_req_int;
end case;
when "000000000001" =>
when "000000000001" =>
-- Submap init_pll_spi
init_pll_spi_re <= rd_req_int;
rd_dat_d0 <= init_pll_spi_i.dat(15 downto 0);
rd_ack_d0 <= init_pll_spi_rack;
when "000000000010" =>
when "000000000010" =>
-- Submap init_rf_spi
init_rf_spi_re <= rd_req_int;
rd_dat_d0 <= init_rf_spi_i.dat(15 downto 0);
rd_ack_d0 <= init_rf_spi_rack;
when "000000000011" =>
when "000000000011" =>
-- Submap init_fw_update
init_fw_update_re <= rd_req_int;
rd_dat_d0 <= init_fw_update_i.dat(15 downto 0);
rd_ack_d0 <= init_fw_update_rack;
when "000000000100" =>
when "000000000100" =>
-- Submap init_rf
init_rf_re <= rd_req_int;
rd_dat_d0 <= init_rf_i.dat(15 downto 0);
......@@ -684,7 +683,7 @@ begin
when others =>
rd_ack_d0 <= rd_req_int;
end case;
when "11" =>
when "11" =>
-- Submap init_wrpc
init_wrpc_re <= rd_req_int;
rd_dat_d0 <= init_wrpc_i.dat(15 downto 0);
......
......@@ -156,10 +156,11 @@ entity wr2rf_vme is
-- timing_io
tmg_clk_i : in std_logic_vector(2 downto 1);
tmg_clk_o : out std_logic_vector(2 downto 1);
tmg_clk_oen_o : out std_logic_vector(2 downto 1);
tmg_clk_oe_n_o : out std_logic_vector(2 downto 1);
tmg_clk_term_en_o : out std_logic_vector(2 downto 1);
tmg_io_b : inout std_logic_vector(4 downto 1);
tmg_io_dir_o : out std_logic;
tmg_io_i : in std_logic_vector(4 downto 1);
tmg_io_o : out std_logic_vector(4 downto 1);
tmg_io_oe_n_o : out std_logic_vector(4 downto 1);
tmg_io_term_en_o : out std_logic_vector(4 downto 1);
-- rf1 iqdac
......@@ -378,15 +379,12 @@ architecture rtl of wr2rf_vme is
signal rf2_vtus_wb_in : t_wishbone_master_in;
signal rf2_vtus_wb_out : t_wishbone_master_out;
-- timing_io
signal tmg_clk_out : std_logic_vector(2 downto 1) := (others => '0'); --FIXME
signal tmg_io_out : std_logic_vector(4 downto 1);
signal tmg_io_in : std_logic_vector(4 downto 1);
signal tmg_io_dir : std_logic;
signal mmcm_shift_incdec : std_logic;
signal mmcm_shift_en : std_logic;
signal mmcm_shift_busy : std_logic;
signal tmg_clk_oe_o : std_logic_vector(2 downto 1);
signal tmg_io_oe_o : std_logic_vector(4 downto 1);
begin
-- Poweron reset.
......@@ -819,7 +817,7 @@ begin
rf_t1_rst_p_o => rf1_t1_rst_p_o,
rf_t1_rst_n_o => rf1_t1_rst_n_o,
rf_t1_start_i => tmg_clk_i(1),
rf_t1_stop_i => tmg_io_in(1),
rf_t1_stop_i => tmg_io_i(1),
rf_t2_clk_p_i => rf1_t2_clk_p_i,
rf_t2_clk_n_i => rf1_t2_clk_n_i,
......@@ -828,7 +826,7 @@ begin
rf_t2_rst_p_o => rf1_t2_rst_p_o,
rf_t2_rst_n_o => rf1_t2_rst_n_o,
rf_t2_start_i => tmg_clk_i(1),
rf_t2_stop_i => tmg_io_in(1),
rf_t2_stop_i => tmg_io_i(1),
rf_clk_bufg_o => rf1_clk_bufg);
......@@ -851,7 +849,7 @@ begin
rf_t1_rst_p_o => rf2_t1_rst_p_o,
rf_t1_rst_n_o => rf2_t1_rst_n_o,
rf_t1_start_i => tmg_clk_i(2),
rf_t1_stop_i => tmg_io_in(2),
rf_t1_stop_i => tmg_io_i(2),
rf_t2_clk_p_i => rf2_t2_clk_p_i,
rf_t2_clk_n_i => rf2_t2_clk_n_i,
......@@ -860,7 +858,7 @@ begin
rf_t2_rst_p_o => rf2_t2_rst_p_o,
rf_t2_rst_n_o => rf2_t2_rst_n_o,
rf_t2_start_i => tmg_clk_i(2),
rf_t2_stop_i => tmg_io_in(2),
rf_t2_stop_i => tmg_io_i(2),
rf_clk_bufg_o => rf2_clk_bufg );
......@@ -907,8 +905,8 @@ begin
tmg_clk_term_en_o => tmg_clk_term_en_o,
tmg_io_term_en_o => tmg_io_term_en_o,
tmg_clk_oe_o => tmg_clk_oen_o,
tmg_io_dir_o => tmg_io_dir,
tmg_clk_oe_o => tmg_clk_oe_o,
tmg_io_oe_o => tmg_io_oe_o,
ext_ref_dir_o => ext_ref_dir_o,
dds_cs_n_o => dds_cs_n_o,
......@@ -949,10 +947,9 @@ begin
);
-- timing_io
tmg_clk_o <= tmg_clk_out;
tmg_io_dir_o <= tmg_io_dir;
tmg_io_out <= "0000";
tmg_io_b <= tmg_io_out when tmg_io_dir = '1' else "ZZZZ";
tmg_io_in <= tmg_io_b when tmg_io_dir = '0' else "0000";
tmg_clk_oe_n_o <= not tmg_clk_oe_o;
tmg_io_oe_n_o <= not tmg_io_oe_o;
tmg_clk_o <= "00";
tmg_io_o <= "0000";
end rtl;
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