ELGIP-122 Changes so that POF_TX_0 uses auto-generated registers

This commit is contained in:
Christos Spirotis 2020-12-17 14:31:48 +00:00
commit 18539bb5ba
2 changed files with 34 additions and 35 deletions

View file

@ -38,6 +38,8 @@ vcom -2008 -work $WORKLIB $COMMON_PATH/sync_wire.vhd
vcom -2008 -work $WORKLIB $COMMON_PATH/sync_wire_redge.vhd
#vcom -2008 -work $WORKLIB ../src/altera/fifo_16x8.vhd
vcom -2008 -work $WORKLIB $COMMON_PATH/altera/sync_fifo.vhd
vcom -2008 -work $WORKLIB ../src/pof_tx_0_pkg_auto.vhd
vcom -2008 -work $WORKLIB ../src/pof_tx_0_csr_regs_auto.vhd
vcom -2008 -work $WORKLIB ../src/uart_tx_0.vhd
vcom -2008 -work $WORKLIB ../src/pof_uart_rx_0.vhd
vcom -2008 -work $WORKLIB ../src/pof_tx_0.vhd

View file

@ -225,47 +225,44 @@ gray <= bin2gray(latched_pos) when (pd_event_d = '1' or pd_event_dd = '1') else
-- C&S registers
-----------------------------------------------------------------------------
pof_tx_0_csr_regs_inst : entity work.pof_tx_0_csr_regs
generic map (
ADDR_DECODE_WIDTH => 3
)
port map (
-- Clock and reset
clk => clk,
rst_n => reset_n,
-- auto-generated
-- Internal signal ports
csr_enable => enable,
csr_bit_div => bit_div,
timing_keepalive_period => keepalive_period,
timing_init_blocked_period => init_blocked_period,
csr_clr_fifo_level_max => clr_fifo_lmax,
error_inject => inject_error_req,
csr_ovfl_err => ovfl_err,
fifo_level_fifo_level => fifo_level,
fifo_level_max_fifo_level => fifo_level_max,
-- end auto-generated
-- Slave bus port
avs_address => avs_address(2 downto 0),
avs_write => avs_write,
avs_writedata => avs_writedata,
avs_read => avs_read,
avs_readdata => avs_readdata
);
pCTRL_STATUS : process(reset_n, clk)
begin
if(reset_n = '0') then
avs_readdatavalid <= '0';
enable <= '0';
clr_fifo_lmax <= '0';
bit_div <= "0010";
keepalive_period <= std_logic_vector(to_unsigned(KEEPALIVE_PERIOD_DEF, 10));
init_blocked_period <= std_logic_vector(to_unsigned(INIT_BLOCKED_PERIOD_DEF, 10));
elsif(clk = '1' and clk'event) then
inject_error_req <= '0';
clr_fifo_lmax <= '0';
-- CTRL registers
if(avs_write = '1') then
case avs_address is
when CSR =>
enable <= avs_writedata(0);
clr_fifo_lmax <= avs_writedata(2);
bit_div <= avs_writedata(7 downto 4);
when ERROR_INJ_REG =>
inject_error_req <= avs_writedata(0);
when TIMING_REG =>
keepalive_period <= avs_writedata( 9 downto 0);
init_blocked_period <= avs_writedata(25 downto 16);
when others => null;
end case;
end if;
-- Read Ctrl & Status registers
avs_readdatavalid <= avs_read;
if(avs_read = '1') then
case avs_address is
when CSR =>
avs_readdata <= X"000000" & bit_div & b"0" & clr_fifo_lmax & ovfl_err & enable;
when TIMING_REG =>
avs_readdata <= 6x"0" & init_blocked_period & 6x"0" & keepalive_period;
when FIFO_LEVEL_REG =>
avs_readdata <= 6x"0" & fifo_level_max & 6x"0" & fifo_level;
when others =>
avs_readdata <= X"BAD1BAD0";
end case;
end if;
end if;
end process pCTRL_STATUS;