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

Subversion Repositories open8_urisc

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

Show entire file | Details | Blame | View Log

Rev 224 Rev 244
Line 66... Line 66...
  alias uSec_Tick            is Open8_Bus.uSec_Tick;
  alias uSec_Tick            is Open8_Bus.uSec_Tick;
 
 
  constant User_Addr         : std_logic_vector(15 downto 0) := Address;
  constant User_Addr         : std_logic_vector(15 downto 0) := Address;
  alias  Comp_Addr           is Open8_Bus.Address(15 downto 0);
  alias  Comp_Addr           is Open8_Bus.Address(15 downto 0);
  signal Addr_Match          : std_logic  := '0';
  signal Addr_Match          : std_logic  := '0';
  signal Rd_En               : std_logic  := '0';
 
 
  signal Rd_En_d             : std_logic := '0';
 
  signal Rd_En_q             : std_logic := '0';
 
 
  constant MSEC_DELAY        : std_logic_vector(9 downto 0) :=
  constant MSEC_DELAY        : std_logic_vector(9 downto 0) :=
                                conv_std_logic_vector(1000,10);
                                conv_std_logic_vector(1000,10);
 
 
  signal mSec_Timer          : std_logic_vector(9 downto 0) := (others => '0');
  signal mSec_Timer          : std_logic_vector(9 downto 0) := (others => '0');
Line 79... Line 81...
  signal Button_Pressed      : DATA_TYPE := x"00";
  signal Button_Pressed      : DATA_TYPE := x"00";
  signal Button_CoS          : DATA_TYPE := x"00";
  signal Button_CoS          : DATA_TYPE := x"00";
 
 
begin
begin
 
 
  Addr_Match                 <= Open8_Bus.Rd_En when Comp_Addr = User_Addr else
  Addr_Match                 <= '1' when Comp_Addr = User_Addr else '0';
                                '0';
  Rd_En_d                    <= Addr_Match and Open8_Bus.Rd_En;
 
 
  io_reg: process( Clock, Reset )
  io_reg: process( Clock, Reset )
  begin
  begin
    if( Reset = Reset_Level )then
    if( Reset = Reset_Level )then
      Rd_En                  <= '0';
      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
      Rd_En                  <= Addr_Match;
      Rd_En_q                <= Rd_En_d;
      Rd_Data                <= OPEN8_NULLBUS;
      Rd_Data                <= OPEN8_NULLBUS;
      if( Rd_En = '1' )then
      if( Rd_En_q = '1' )then
        Rd_Data              <= Button_Pressed;
        Rd_Data              <= Button_Pressed;
      end if;
      end if;
      Interrupt              <= or_reduce(Button_CoS);
      Interrupt              <= or_reduce(Button_CoS);
    end if;
    end if;
  end process;
  end process;

powered by: WebSVN 2.1.0

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