OpenCores
URL https://opencores.org/ocsvn/spi_slave/spi_slave/trunk

Subversion Repositories spi_slave

[/] [spi_slave/] [trunk/] [pcore/] [opb_spi_slave_v1_00_a/] [hdl/] [vhdl/] [opb_m_if.vhd] - Diff between revs 13 and 22

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 13 Rev 22
Line 74... Line 74...
    -- base adress for transfer
    -- base adress for transfer
    opb_rx_dma_addr : in  std_logic_vector(C_OPB_DWIDTH-1 downto 0);
    opb_rx_dma_addr : in  std_logic_vector(C_OPB_DWIDTH-1 downto 0);
    opb_rx_dma_num  : in  std_logic_vector(C_WIDTH_DMA_NUM-1 downto 0);
    opb_rx_dma_num  : in  std_logic_vector(C_WIDTH_DMA_NUM-1 downto 0);
    opb_rx_dma_done : out std_logic;
    opb_rx_dma_done : out std_logic;
    ---------------------------------------------------------------------------
    ---------------------------------------------------------------------------
    opb_abort_flg   : out std_logic);
    opb_abort_flg     : out std_logic;
 
    opb_m_last_block : out std_logic);
end opb_m_if;
end opb_m_if;
 
 
architecture behavior of opb_m_if is
architecture behavior of opb_m_if is
 
 
  type state_t is (idle,
  type state_t is (idle,
Line 108... Line 109...
  signal opb_rx_dma_addr_int : std_logic_vector(C_OPB_DWIDTH-1 downto 0);
  signal opb_rx_dma_addr_int : std_logic_vector(C_OPB_DWIDTH-1 downto 0);
  signal opb_rx_dma_num_int  : std_logic_vector(C_WIDTH_DMA_NUM-1 downto 0);
  signal opb_rx_dma_num_int  : std_logic_vector(C_WIDTH_DMA_NUM-1 downto 0);
  signal opb_rx_dma_done_int : std_logic;
  signal opb_rx_dma_done_int : std_logic;
 
 
 
 
 
 
begin  -- behavior
begin  -- behavior
 
 
  --* convert M_DBus_big_end to little endian
  --* convert M_DBus_big_end to little endian
  process(M_DBus_big_end)
  process(M_DBus_big_end)
  begin
  begin
Line 175... Line 175...
      M_select_int        <= '0';
      M_select_int        <= '0';
      M_seqAddr           <= '0';
      M_seqAddr           <= '0';
      opb_tx_dma_done_int <= '0';
      opb_tx_dma_done_int <= '0';
      opb_rx_dma_done_int <= '0';
      opb_rx_dma_done_int <= '0';
      opb_abort_flg       <= '0';
      opb_abort_flg       <= '0';
 
      opb_m_last_block   <= '0';
 
      opb_tx_dma_num_int <= (others => '0');
 
      opb_rx_dma_num_int <= (others => '0');
    elsif rising_edge(OPB_Clk) then
    elsif rising_edge(OPB_Clk) then
      case state is
      case state is
        when idle =>
        when idle =>
          opb_abort_flg <= '0';
          opb_abort_flg <= '0';
          opb_tx_dma_en <= opb_tx_dma_ctl(0);
          opb_tx_dma_en <= opb_tx_dma_ctl(0);
Line 219... Line 222...
            M_seqAddr    <= '1';
            M_seqAddr    <= '1';
            M_BE         <= "1111";
            M_BE         <= "1111";
            if (read_transfer) then
            if (read_transfer) then
              -- read
              -- read
              M_RNW <= '1';
              M_RNW <= '1';
 
              if (conv_integer(opb_tx_dma_num_int) = 0) then
 
                opb_m_last_block <= '1';
 
              end if;
              state <= transfer_read;
              state <= transfer_read;
            else
            else
              -- write
              -- write
              M_RNW <= '0';
              M_RNW <= '0';
 
              if (conv_integer(opb_rx_dma_num_int) = 0) then
 
                opb_m_last_block <= '1';
 
              end if;
              state <= transfer_write;
              state <= transfer_write;
            end if;
            end if;
          else
          else
            state <= wait_grant;
            state <= wait_grant;
          end if;
          end if;
Line 244... Line 253...
              M_RNW        <= '0';
              M_RNW        <= '0';
              M_select_int <= '0';
              M_select_int <= '0';
              M_BE         <= (others => '0');
              M_BE         <= (others => '0');
              if (conv_integer(opb_tx_dma_num_int) = 0) then
              if (conv_integer(opb_tx_dma_num_int) = 0) then
                opb_tx_dma_done_int <= '1';
                opb_tx_dma_done_int <= '1';
 
                opb_m_last_block   <= '0';
              else
              else
                opb_tx_dma_num_int <= opb_tx_dma_num_int-1;
                opb_tx_dma_num_int <= opb_tx_dma_num_int-1;
              end if;
              end if;
              state <= done;
              state <= done;
            end if;
            end if;
Line 277... Line 287...
              M_RNW        <= '0';
              M_RNW        <= '0';
              M_select_int <= '0';
              M_select_int <= '0';
              M_BE         <= (others => '0');
              M_BE         <= (others => '0');
              if (conv_integer(opb_rx_dma_num_int) = 0) then
              if (conv_integer(opb_rx_dma_num_int) = 0) then
                opb_rx_dma_done_int <= '1';
                opb_rx_dma_done_int <= '1';
 
                opb_m_last_block   <= '0';
              else
              else
                opb_rx_dma_num_int <= opb_rx_dma_num_int-1;
                opb_rx_dma_num_int <= opb_rx_dma_num_int-1;
              end if;
              end if;
              state <= done;
              state <= done;
            end if;
            end if;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.