----------------------------------------------------------------------
-- Created by Actel SmartDesign Thu Jul 28 18:21:25 2011
-- Testbench Template
-- This is a basic testbench that instantiates your design with basic 
-- clock and reset pins connected.  If your design has special
-- clock/reset or testbench driver requirements then you should 
-- copy this file and modify it. 
----------------------------------------------------------------------

library ieee;
use ieee.std_logic_1164.all;

entity testbench is
end testbench;

architecture behavioral of testbench is

    constant SYSCLK_PERIOD : time := 100 ns;

    signal SYSCLK : std_logic := '0';
    signal NSYSRESET : std_logic := '0';

    component MSS_FLAC_PLAYER
        -- ports
        port( 
            -- Inputs
            MAINXIN : in std_logic;
            MSSPREADY : in std_logic;
            MSSPSLVERR : in std_logic;
            FABPSEL : in std_logic;
            FABPENABLE : in std_logic;
            FABPWRITE : in std_logic;
            F2M_GPI_5 : in std_logic;
            F2M_GPI_2 : in std_logic;
            F2M_GPI_0 : in std_logic;
            MSSPRDATA : in std_logic_vector(31 downto 0);
            FABPADDR : in std_logic_vector(31 downto 0);
            FABPWDATA : in std_logic_vector(31 downto 0);
            UART_0_RXD : in std_logic;
            SPI_1_DI : in std_logic;
            VAREF0 : in std_logic;
            MSS_RESET_N : in std_logic;

            -- Outputs
            FAB_CLK : out std_logic;
            MSSPSEL : out std_logic;
            MSSPENABLE : out std_logic;
            MSSPWRITE : out std_logic;
            FABPREADY : out std_logic;
            FABPSLVERR : out std_logic;
            M2F_RESET_N : out std_logic;
            M2F_GPO_4 : out std_logic;
            M2F_GPO_3 : out std_logic;
            M2F_GPO_1 : out std_logic;
            MSSPADDR : out std_logic_vector(19 downto 0);
            MSSPWDATA : out std_logic_vector(31 downto 0);
            FABPRDATA : out std_logic_vector(31 downto 0);
            UART_0_TXD : out std_logic;
            SPI_1_DO : out std_logic;
            EMC_AB : out std_logic_vector(25 downto 0);
            EMC_BYTEN : out std_logic_vector(1 downto 0);
            EMC_CS0_N : out std_logic;
            EMC_CS1_N : out std_logic;
            EMC_OEN0_N : out std_logic;
            EMC_OEN1_N : out std_logic;
            EMC_CLK : out std_logic;
            EMC_RW_N : out std_logic;
            SDD_0 : out std_logic;

            -- Inouts
            SPI_1_CLK : inout std_logic;
            SPI_1_SS : inout std_logic;
            EMC_DB : inout std_logic_vector(15 downto 0)

        );
    end component;

begin

    process
        variable vhdl_initial : BOOLEAN := TRUE;

    begin
        if ( vhdl_initial ) then
            -- Assert Reset
            NSYSRESET <= '0';
            wait for ( SYSCLK_PERIOD * 10 );
            
            NSYSRESET <= '1';
            wait;
        end if;
    end process;

    -- 10MHz Clock Driver
    SYSCLK <= not SYSCLK after (SYSCLK_PERIOD / 2.0 );

    -- Instantiate Unit Under Test:  MSS_FLAC_PLAYER
    MSS_FLAC_PLAYER_0 : MSS_FLAC_PLAYER
        -- port map
        port map( 
            -- Inputs
            MAINXIN => '0',
            MSSPREADY => '0',
            MSSPSLVERR => '0',
            FABPSEL => '0',
            FABPENABLE => '0',
            FABPWRITE => '0',
            F2M_GPI_5 => '0',
            F2M_GPI_2 => '0',
            F2M_GPI_0 => '0',
            MSSPRDATA => (others=> '0'),
            FABPADDR => (others=> '0'),
            FABPWDATA => (others=> '0'),
            UART_0_RXD => '0',
            SPI_1_DI => '0',
            VAREF0 => '0',
            MSS_RESET_N => NSYSRESET,

            -- Outputs
            FAB_CLK =>  open,
            MSSPSEL =>  open,
            MSSPENABLE =>  open,
            MSSPWRITE =>  open,
            FABPREADY =>  open,
            FABPSLVERR =>  open,
            M2F_RESET_N =>  open,
            M2F_GPO_4 =>  open,
            M2F_GPO_3 =>  open,
            M2F_GPO_1 =>  open,
            MSSPADDR => open,
            MSSPWDATA => open,
            FABPRDATA => open,
            UART_0_TXD =>  open,
            SPI_1_DO =>  open,
            EMC_AB => open,
            EMC_BYTEN => open,
            EMC_CS0_N =>  open,
            EMC_CS1_N =>  open,
            EMC_OEN0_N =>  open,
            EMC_OEN1_N =>  open,
            EMC_CLK =>  open,
            EMC_RW_N =>  open,
            SDD_0 =>  open,

            -- Inouts
            SPI_1_CLK =>  open,
            SPI_1_SS =>  open,
            EMC_DB => open

        );

end behavioral;

