Line 35... |
Line 35... |
------------------ -------- ---------------------------------------------------
|
------------------ -------- ---------------------------------------------------
|
-- Seth Henry 12/20/13 Design Start
|
-- Seth Henry 12/20/13 Design Start
|
-- Seth Henry 04/10/20 Code cleanup and register documentation
|
-- Seth Henry 04/10/20 Code cleanup and register documentation
|
-- Also removed "input only" generic, as there is a
|
-- Also removed "input only" generic, as there is a
|
-- separate module for that
|
-- separate module for that
|
|
-- Seth Henry 04/16/20 Modified to make use of Open8 bus record
|
|
|
library ieee;
|
library ieee;
|
use ieee.std_logic_1164.all;
|
use ieee.std_logic_1164.all;
|
|
|
library work;
|
library work;
|
Line 46... |
Line 47... |
|
|
entity o8_gpio is
|
entity o8_gpio is
|
generic(
|
generic(
|
Default_Out : DATA_TYPE := x"00";
|
Default_Out : DATA_TYPE := x"00";
|
Default_En : DATA_TYPE := x"00";
|
Default_En : DATA_TYPE := x"00";
|
Reset_Level : std_logic := '1';
|
|
Address : ADDRESS_TYPE
|
Address : ADDRESS_TYPE
|
);
|
);
|
port(
|
port(
|
Clock : in std_logic;
|
|
Reset : in std_logic;
|
|
--
|
|
Open8_Bus : in OPEN8_BUS_TYPE;
|
Open8_Bus : in OPEN8_BUS_TYPE;
|
Rd_Data : out DATA_TYPE;
|
Rd_Data : out DATA_TYPE;
|
--
|
--
|
GPIO : inout DATA_TYPE
|
GPIO : inout DATA_TYPE
|
);
|
);
|
end entity;
|
end entity;
|
|
|
architecture behave of o8_gpio is
|
architecture behave of o8_gpio is
|
|
|
|
alias Clock is Open8_Bus.Clock;
|
|
alias Reset is Open8_Bus.Reset;
|
|
|
constant User_Addr : std_logic_vector(15 downto 2)
|
constant User_Addr : std_logic_vector(15 downto 2)
|
:= Address(15 downto 2);
|
:= Address(15 downto 2);
|
alias Comp_Addr is Open8_Bus.Address(15 downto 2);
|
alias Comp_Addr is Open8_Bus.Address(15 downto 2);
|
alias Reg_Addr is Open8_Bus.Address(1 downto 0);
|
alias Reg_Addr is Open8_Bus.Address(1 downto 0);
|
signal Reg_Sel : std_logic_vector(1 downto 0) := "00";
|
signal Reg_Sel : std_logic_vector(1 downto 0) := "00";
|