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

Subversion Repositories open8_urisc

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

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

Rev 224 Rev 244
Line 38... Line 38...
-- Revision History
-- Revision History
-- Author          Date     Change
-- Author          Date     Change
------------------ -------- ---------------------------------------------------
------------------ -------- ---------------------------------------------------
-- Seth Henry      12/20/19 Design Start
-- Seth Henry      12/20/19 Design Start
-- Seth Henry      04/16/20 Modified to use Open8  bus record
-- Seth Henry      04/16/20 Modified to use Open8  bus record
 
-- 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 54... Line 55...
generic(
generic(
  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;
  --
  --
  LED_Out                    : out std_logic
  LED_Out                    : out std_logic
);
);
end entity;
end entity;
Line 69... Line 71...
 
 
  constant User_Addr         : std_logic_vector(15 downto 0)
  constant User_Addr         : std_logic_vector(15 downto 0)
                               := Address(15 downto 0);
                               := Address(15 downto 0);
  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;
  signal Addr_Match          : std_logic;
  signal Wr_En               : std_logic;
 
  signal Wr_Data_q           : std_logic_vector(2 downto 0);
  signal Wr_En_d             : std_logic := '0';
 
  signal Wr_En_q             : std_logic := '0';
 
  alias  Wr_Data_d           is Open8_Bus.Wr_Data;
 
  signal Wr_Data_q           : DATA_TYPE := x"00";
 
  signal Rd_En_d             : std_logic := '0';
 
  signal Rd_En_q             : std_logic := '0';
 
 
  signal LED_Mode            : std_logic_vector(2 downto 0);
  signal LED_Mode            : std_logic_vector(2 downto 0);
  signal Rd_En               : std_logic;
 
 
 
  signal Dim50Pct_Out        : std_logic;
  signal Dim50Pct_Out        : std_logic;
 
 
  signal Half_Hz_Timer       : std_logic_vector(15 downto 0);
  signal Half_Hz_Timer       : std_logic_vector(15 downto 0);
  constant HALF_HZ_PRD       : std_logic_vector(15 downto 0) :=
  constant HALF_HZ_PRD       : std_logic_vector(15 downto 0) :=
Line 90... Line 97...
  signal Fade_Out            : std_logic;
  signal Fade_Out            : std_logic;
 
 
begin
begin
 
 
  Addr_Match                 <= '1' when Comp_Addr = User_Addr else '0';
  Addr_Match                 <= '1' when Comp_Addr = User_Addr else '0';
 
  Wr_En_d                    <= Addr_Match and Open8_Bus.Wr_En;
 
  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
      Wr_En                  <= '0';
      Wr_En_q                <= '0';
      Wr_Data_q              <= (others => '0');
      Wr_Data_q              <= x"00";
      LED_Mode               <= (others => '0');
      Rd_En_q                <= '0';
      Rd_En                  <= '0';
 
      Rd_Data                <= OPEN8_NULLBUS;
      Rd_Data                <= OPEN8_NULLBUS;
 
      LED_Mode               <= (others => '0');
    elsif( rising_edge( Clock ) )then
    elsif( rising_edge( Clock ) )then
      Wr_En                  <= Addr_Match and Open8_Bus.Wr_En;
      Wr_En_q                <= Wr_En_d;
      Wr_Data_q              <= Open8_Bus.Wr_Data(2 downto 0);
      Wr_Data_q              <= Wr_Data_d;
      if( Wr_En = '1' )then
      if( Wr_En_q = '1' and Write_Qual = '1' )then
        LED_Mode             <= Wr_Data_q;
        LED_Mode             <= Wr_Data_q(2 downto 0);
      end if;
      end if;
 
 
 
      Rd_En_q                <= Rd_En_d;
      Rd_Data                <= OPEN8_NULLBUS;
      Rd_Data                <= OPEN8_NULLBUS;
      Rd_En                  <= Addr_Match and Open8_Bus.Rd_En;
      if( Rd_En_q = '1' )then
      if( Rd_En = '1' )then
 
        Rd_Data              <= "00000" & LED_Mode;
        Rd_Data              <= "00000" & LED_Mode;
      end if;
      end if;
 
 
    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.