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

Subversion Repositories open8_urisc

[/] [open8_urisc/] [trunk/] [VHDL/] [o8_sdlc_if.vhd] - Diff between revs 224 and 244

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

Rev 224 Rev 244
Line 62... Line 62...
--
--
-- Revision History
-- Revision History
-- Author          Date     Change
-- Author          Date     Change
------------------ -------- ---------------------------------------------------
------------------ -------- ---------------------------------------------------
-- Seth Henry      04/16/20 Revision block added
-- Seth Henry      04/16/20 Revision block added
 
-- Seth Henry      05/18/20 Added write qualification input
 
 
library ieee;
library ieee;
  use ieee.std_logic_1164.all;
  use ieee.std_logic_1164.all;
  use ieee.std_logic_unsigned.all;
  use ieee.std_logic_unsigned.all;
  use ieee.std_logic_arith.all;
  use ieee.std_logic_arith.all;
Line 87... Line 88...
  Clock_Frequency            : real := 100000000.0;
  Clock_Frequency            : real := 100000000.0;
  Address                    : ADDRESS_TYPE
  Address                    : ADDRESS_TYPE
);
);
port(
port(
  Open8_Bus                  : in  OPEN8_BUS_TYPE;
  Open8_Bus                  : in  OPEN8_BUS_TYPE;
 
  Write_Qual                 : in  std_logic := '1';
  Rd_Data                    : out DATA_TYPE;
  Rd_Data                    : out DATA_TYPE;
  Interrupt                  : out std_logic;
  Interrupt                  : out std_logic;
  -- Serial IO
  -- Serial IO
  SDLC_In                    : in  std_logic;
  SDLC_In                    : in  std_logic;
  SDLC_SClk                  : in  std_logic;
  SDLC_SClk                  : in  std_logic;
Line 111... Line 113...
  signal Base_Addr_Match     : std_logic := '0';
  signal Base_Addr_Match     : std_logic := '0';
 
 
  alias DP_A_Addr            is Open8_Bus.Address(8 downto 0);
  alias DP_A_Addr            is Open8_Bus.Address(8 downto 0);
  signal DP_A_Wr_En          : std_logic := '0';
  signal DP_A_Wr_En          : std_logic := '0';
  alias  DP_A_Wr_Data        is Open8_Bus.Wr_Data;
  alias  DP_A_Wr_Data        is Open8_Bus.Wr_Data;
  signal DP_A_Rd_En          : std_logic := '0';
  signal DP_A_Rd_En_d        : std_logic := '0';
 
  signal DP_A_Rd_En_q        : std_logic := '0';
  signal DP_A_Rd_Data        : DATA_TYPE := OPEN8_NULLBUS;
  signal DP_A_Rd_Data        : DATA_TYPE := OPEN8_NULLBUS;
 
 
  constant Reg_Sub_Addr      : std_logic_vector(8 downto 1) := x"7F";
  constant Reg_Sub_Addr      : std_logic_vector(8 downto 1) := x"7F";
  alias Reg_Upper_Addr       is Open8_Bus.Address(8 downto 1);
  alias Reg_Upper_Addr       is Open8_Bus.Address(8 downto 1);
  alias Reg_Lower_Addr       is Open8_Bus.Address(0);
  alias Reg_Lower_Addr       is Open8_Bus.Address(0);
 
 
  signal Reg_Addr            : std_logic_vector(8 downto 1) := (others => '0');
  signal Reg_Addr            : std_logic_vector(8 downto 1) := (others => '0');
  signal Reg_Sel             : std_logic     := '0';
  signal Reg_Sel             : std_logic     := '0';
  signal Reg_Wr_En           : std_logic     := '0';
  signal Reg_Wr_En_d         : std_logic     := '0';
 
  signal Reg_Wr_En_q         : std_logic     := '0';
  signal Reg_Clk_Sel         : std_logic     := '0';
  signal Reg_Clk_Sel         : std_logic     := '0';
  signal Reg_TxS_Sel         : std_logic     := '0';
  signal Reg_TxS_Sel         : std_logic     := '0';
 
 
  signal DP_B_Addr           : std_logic_vector(8 downto 0) := (others => '0');
  signal DP_B_Addr           : std_logic_vector(8 downto 0) := (others => '0');
  signal DP_B_Wr_Data        : DATA_IN_TYPE  := x"00";
  signal DP_B_Wr_Data        : DATA_IN_TYPE  := x"00";
Line 183... Line 187...
-- ***************************************************************************
-- ***************************************************************************
 
 
  -- This decode needs to happen immediately, to give the RAM a chance to
  -- This decode needs to happen immediately, to give the RAM a chance to
  --  do the lookup before we have to set Rd_Data
  --  do the lookup before we have to set Rd_Data
  Base_Addr_Match            <= '1' when Base_Addr = CPU_Upper_Addr else '0';
  Base_Addr_Match            <= '1' when Base_Addr = CPU_Upper_Addr else '0';
  DP_A_Wr_En                 <= Base_Addr_Match and Open8_Bus.Wr_En;
  Reg_Wr_En_d                <= Base_Addr_Match and
 
                                Open8_Bus.Wr_En and
 
                                Write_Qual;
 
 
 
  DP_A_Wr_En                 <= Base_Addr_Match and
 
                                Open8_Bus.Wr_En and
 
                                Write_Qual;
 
 
 
  DP_A_Rd_En_d               <= Base_Addr_Match and Open8_Bus.Rd_En;
 
 
  CPU_IF_proc: process( Reset, Clock )
  CPU_IF_proc: process( Reset, Clock )
  begin
  begin
    if( Reset = Reset_Level )then
    if( Reset = Reset_Level )then
      Reg_Addr               <= (others => '0');
      Reg_Addr               <= (others => '0');
      Reg_Wr_En              <= '0';
      Reg_Wr_En_q            <= '0';
      Reg_Clk_Sel            <= '0';
      Reg_Clk_Sel            <= '0';
      Reg_TxS_Sel            <= '0';
      Reg_TxS_Sel            <= '0';
      DP_A_Rd_En             <= '0';
      DP_A_Rd_En_q           <= '0';
      Rd_Data                <= OPEN8_NULLBUS;
      Rd_Data                <= OPEN8_NULLBUS;
      Interrupt              <= '0';
      Interrupt              <= '0';
    elsif( rising_edge(Clock) )then
    elsif( rising_edge(Clock) )then
      Reg_Addr               <= Reg_Upper_Addr;
      Reg_Addr               <= Reg_Upper_Addr;
      Reg_Sel                <= Reg_Lower_Addr;
      Reg_Sel                <= Reg_Lower_Addr;
      Reg_Wr_En              <= Base_Addr_Match and Open8_Bus.Wr_En;
      Reg_Wr_En_q            <= Reg_Wr_En_d;
 
 
      Reg_Clk_Sel            <= '0';
      Reg_Clk_Sel            <= '0';
      Reg_TxS_Sel            <= '0';
      Reg_TxS_Sel            <= '0';
      if( Reg_Addr = Reg_Sub_Addr )then
      if( Reg_Addr = Reg_Sub_Addr )then
        Reg_Clk_Sel          <= Reg_Wr_En and not Reg_Sel;
        Reg_Clk_Sel          <= Reg_Wr_En_q and not Reg_Sel;
        Reg_TxS_Sel          <= Reg_Wr_En and Reg_Sel;
        Reg_TxS_Sel          <= Reg_Wr_En_q and Reg_Sel;
      end if;
      end if;
 
 
      DP_A_Rd_En             <= Base_Addr_Match and Open8_Bus.Rd_En;
      DP_A_Rd_En_q           <= DP_A_Rd_En_d;
      Rd_Data                <= OPEN8_NULLBUS;
      Rd_Data                <= OPEN8_NULLBUS;
      if( DP_A_Rd_En = '1' )then
      if( DP_A_Rd_En_q = '1' )then
        Rd_Data              <= DP_A_Rd_Data;
        Rd_Data              <= DP_A_Rd_Data;
      end if;
      end if;
 
 
      Interrupt              <= RX_Interrupt or TX_Interrupt;
      Interrupt              <= RX_Interrupt or TX_Interrupt;
    end if;
    end if;

powered by: WebSVN 2.1.0

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