Library ieee; use ieee.std_logic_1164.all; -- use ieee.numeric_std.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all; use ieee.math_real.all; entity T_wbpwmaudio is end T_wbpwmaudio; architecture TEST of T_wbpwmaudio is ------------------------------------------------------------------------------- -- Component Declarations ------------------------------------------------------------------------------- component wbpwmaudio is generic( DEFAULT_RELOAD : std_logic_vector(15 downto 0) := X"0716"; -- 1814 NAUX : natural := 2; VARIABLE_RATE : natural := 0; TIMING_BITS : natural :=16); port( i_wb_cyc : in std_logic; -- an unused input i_wb_stb : in std_logic; i_wb_we : in std_logic; i_wb_addr : in std_logic; i_wb_data : in std_logic_vector(31 downto 0); i_clk : in std_logic; o_wb_ack : out std_logic; o_wb_stall : out std_logic; o_wb_data : out std_logic_vector(31 downto 0); o_pwm : out std_logic; o_aux : out std_logic_vector(NAUX-1 downto 0); o_int : out std_logic ); end component; ------------------------------------------------------------------------------- -- Type Declarations ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- -- Constant Declarations ------------------------------------------------------------------------------- constant PERIOD : time := 12.5 ns; -- 80 MHz constant NUM_AUX_BITS : natural := 2; ------------------------------------------------------------------------------- -- Signal Declarations ------------------------------------------------------------------------------- -- wbpwmaudio -- input signals signal t_i_wb_cyc : std_logic := '0'; signal t_i_wb_stb : std_logic := '0'; signal t_i_wb_we : std_logic := '0'; signal t_i_wb_addr : std_logic := '0'; signal t_i_wb_data : std_logic_vector(31 downto 0) := X"00000000"; signal t_i_clk : std_logic := '0'; -- inout signals -- output signals signal t_o_wb_ack : std_logic; signal t_o_wb_stall : std_logic; signal t_o_wb_data : std_logic_vector(31 downto 0); signal t_o_pwm : std_logic; signal t_o_aux : std_logic_vector(NUM_AUX_BITS-1 downto 0); signal t_o_int : std_logic; -- always have this signal SIM_END : boolean := false; ------------------------------------------------------------------------------- -- Procedure Declarations ------------------------------------------------------------------------------- begin ------------------------------------------------------------------------------- -- Component Instantiations ------------------------------------------------------------------------------- CONTROL1 : wbpwmaudio generic map( DEFAULT_RELOAD => X"0716", NAUX => NUM_AUX_BITS, VARIABLE_RATE => 0, TIMING_BITS => 16) port map( i_wb_cyc => t_i_wb_cyc, i_wb_stb => t_i_wb_stb, i_wb_we => t_i_wb_we, i_wb_addr => t_i_wb_addr, i_wb_data => t_i_wb_data, i_clk => t_i_clk, o_wb_ack => t_o_wb_ack, o_wb_stall => t_o_wb_stall, o_wb_data => t_o_wb_data, o_pwm => t_o_pwm, o_aux => t_o_aux, o_int => t_o_int ); ------------------------------------------------------------------------------- -- Concurrent Assignments ------------------------------------------------------------------------------- t_i_clk <= not t_i_clk after PERIOD/2 when SIM_END = false else '0'; ------------------------------------------------------------------------------- -- Process Declarations ------------------------------------------------------------------------------- STIMULUS : process begin wait for 100 ns; wait until rising_edge(t_i_clk); t_i_wb_data <= X"00008734"; t_i_wb_stb <= '1'; t_i_wb_we <= '1'; t_i_wb_addr <= '0'; wait until rising_edge(t_i_clk); t_i_wb_stb <= '0'; t_i_wb_we <= '0'; wait for 1 ms; SIM_END <= true; assert false report "Simulation complete" severity FAILURE; end process STIMULUS; ------------------------------------------------------------------------------- -- Other Output Assignments ------------------------------------------------------------------------------- end TEST; configuration CFG_T_wbpwmaudio of T_wbpwmaudio is for TEST end for; end CFG_T_wbpwmaudio;