14 use IEEE.STD_LOGIC_1164.
all;
16 use ipbus_lib.ipbus.
all;
23 generic (FPGA_FLAVOUR : integer := 0;
24 reg48 : bit_vector(15 downto 0) := x"0000";
25 reg49 : bit_vector(15 downto 0) := x"0000");
36 status : in std_logic_vector(31 downto 0);
38 control_reg : out std_logic_vector(31 downto 0);
63 VAUXP, VAUXN : in std_logic;
72 signal ipbw : ipb_wbus_array(N_SLAVES-1 downto 0);
73 signal ipbr, ipbr_d : ipb_rbus_array(N_SLAVES-1 downto 0);
74 signal ctrl_pulse_reg : std_logic_vector(63 downto 0);
75 signal nc_0, nc_1, nc_2 : std_logic_vector(63 downto 0);
78 signal flash_spi_in : spi_mi;
79 signal flash_spi_out : spi_mo;
81 signal tob_delay_default, tob_bc_default : std_logic_vector(31 downto 0);
94 tob_delay_default <= x"01131412" when FPGA_FLAVOUR = 1 else x"01120f10";
95 tob_bc_default <= x"07131412" when FPGA_FLAVOUR = 1 else x"071f101f";
97 fabric :
entity ipbus_lib.ipbus_fabric_sel
98 generic map(NSLV => N_SLAVES,
99 SEL_WIDTH => ipbus_sel_width
)
103 sel => ipbus_sel_efex_infrastructure
(ipb_in.ipb_addr
),
104 ipb_to_slaves => ipbw,
105 ipb_from_slaves => ipbr
109 module_control :
entity ipbus_lib.ipbus_ctrlreg_v
116 ipbus_in => ipbw
(N_SLV_MODULE_REG
),
117 ipbus_out => ipbr
(N_SLV_MODULE_REG
),
119 q
(0) =>
(control_reg
),
124 tob_synch :
entity ipbus_lib.ipbus_ctrlreg_v
131 ipbus_in => ipbw
(N_SLV_TOB_SYNCH
),
132 ipbus_out => ipbr
(N_SLV_TOB_SYNCH
),
133 d =>
(others =>
(others => '0'
)),
140 xadc :
entity work.
ipbus_xadc_drp -- accessing
and monitoring XADC
148 VAUXP => "
00000" & VAUXP ,
149 VAUXN => "
00000" & VAUXN ,
152 ipbus_in => ipbw
(N_SLV_XADC
),
153 ipbus_out => ipbr
(N_SLV_XADC
)
157 reconfig :
entity ipbus_lib.ipbus_ctrlreg_v
164 ipbus_in => ipbw
(N_SLV_RECONFIGURE
),
165 ipbus_out => ipbr
(N_SLV_RECONFIGURE
),
166 d =>
(others =>
(others => '0'
)),
167 ctrl_default
(0) => x"00020000",
172 ttc_orbit_length :
entity ipbus_lib.ipbus_ctrlreg_v
179 ipbus_in => ipbw
(N_SLV_TTC_ORBIT_LENGTH
),
180 ipbus_out => ipbr
(N_SLV_TTC_ORBIT_LENGTH
),
181 d =>
(others =>
(others => '0'
)),
188 bcmuxvalue_sync :
entity ipbus_lib.ipbus_ctrlreg_v
195 ipbus_in => ipbw
(N_SLV_BCMUXVALUE_SYNC
),
196 ipbus_out => ipbr
(N_SLV_BCMUXVALUE_SYNC
),
197 d =>
(others =>
(others => '0'
)),
202 tob_bus_delay :
entity ipbus_lib.ipbus_ctrlreg_v
209 ipbus_in => ipbw
(N_SLV_TOB_DELAY
),
210 ipbus_out => ipbr
(N_SLV_TOB_DELAY
),
213 ctrl_default
(0) => tob_delay_default,
217 tob_bc_delay :
entity ipbus_lib.ipbus_ctrlreg_v
224 ipbus_in => ipbw
(N_SLV_TOB_BC_DELAY
),
225 ipbus_out => ipbr
(N_SLV_TOB_BC_DELAY
),
228 ctrl_default
(0) => tob_bc_default,
232 spi_flash :
entity work.
ipbus_spi32 -- spi controller
240 ipb_in => ipbw
(N_SLV_FLASH_SPI_RAM
),
241 ipb_out => ipbr
(N_SLV_FLASH_SPI_RAM
),
248 RAM :
entity ipbus_lib.ipbus_ram -- internal ram
for testing the iPbus transactions.
255 ipbus_in => ipbw
(N_SLV_RAM
),
256 ipbus_out => ipbr
(N_SLV_RAM
)
in spi_in spi_mi
spi input signals
out selreg std_logic_vector( 1 downto 0)
select output
out ipb_out ipb_rbus
IPBus output bus going from slaves to master.
out spi_out spi_mo
spi output signals
in ipb_in ipb_wbus
IPBus input bus going from master to slaves.
in ipbus_clk std_logic
ipbus clk of 31.25MHz
process fpga common slaves
process fpga common slaves
out tob_delay_reg std_logic_vector( 31 downto 0)
TOB delay register.
in ipb_rst std_logic
IPBus Reset input.
out flash_le std_logic
chip select
in tob_delay_status std_logic_vector( 31 downto 0) :=( others => '0')
TOB delay status register.
in flash_miso std_logic
serial input of the spi flash
in status std_logic_vector( 31 downto 0)
ststus register
in tob_bc_status std_logic_vector( 31 downto 0) :=( others => '0')
TOB BC delay stataus register.
out ttc_orbit_length_reg std_logic_vector( 31 downto 0)
ttc orbit length
in ipb_clk std_logic
IPBus clock.
out flash_clko std_logic
flash clock
out ipb_out ipb_rbus
IPBus output bus going from slaves to master.
out flash_mosi std_logic
serial out of the spi flash
in ipb_in ipb_wbus
IPBus input bus going from master to slaves.
out tob_bc_reg std_logic_vector( 31 downto 0)
TOB BC delay register.
out reconfig_reg std_logic_vector( 31 downto 0)
reconfigure address register
out TOB_BCN_sych_reg std_logic_vector( 31 downto 0)
TOB_BCN_sych regsiter.
out bcmuxvalue_sych_reg std_logic_vector( 31 downto 0)
bc mux value sync