Download Magillem SOC Development - ESA Microelectronics Section

Transcript
System on Chip development based on Magillem 2.3SE
issue 1 revision 0 - 12-12-2005
page 20 of 20
APPENDIX D APB TO OCP STATUS/CONTROL BRIDGE
------------------------------------------------------------------------- APB to OCP control and status register wrapper
----- Mattias Carqlvist TEC-EDM ESTEC 2005-06-15
----- Support 2 register for control and data
--------------------------------------------------------------------LIBRARY ieee ;
use ieee.std_logic_1164.all ;
use ieee.std_logic_arith.all ;
use ieee.std_logic_unsigned.all ;
------------------------------------------------------------------------- Entity declaration
--------------------------------------------------------------------entity APB_to_OCP_control_wrapper is
port (
pclk : in std_logic;
presetn : in std_logic;
pselx : in std_logic;
penable : in std_logic;
pwrite : in std_logic;
paddr : in std_logic_vector(31 downto 0);
pwdata : in std_logic_vector(31 downto 0);
prdata : out std_logic_vector(31 downto 0);
OCP_status : in std_logic_vector(63 downto 0);
OCP_control : out std_logic_vector(63 downto 0);
OCP_controlWr: out std_logic
);
end APB_to_OCP_control_wrapper;
architecture rtl of APB_to_OCP_control_wrapper is
begin
comb: process(pselx, penable, pwrite, paddr)
begin
if ((pselx and penable and pwrite) = '1') then
if paddr(2) = '0' then
OCP_control(31 downto 0) <= pwdata;
else
OCP_control(63 downto 32) <= pwdata;
end if;
OCP_controlWr <= '1';
else
OCP_controlWr <= '0';
end if;
if ((pselx and penable) = '1' and pwrite = '0') then
if paddr(2) = '0' then
prdata <= OCP_status(31 downto 0);
else
prdata <= OCP_status(63 downto 32);
end if;
end if;
end process comb;
end rtl;