library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
-- Uncomment the following library declaration if using
-- arithmetic functions with Signed or Unsigned values
--use IEEE.NUMERIC_STD.ALL;
-- Uncomment the following library declaration if instantiating
-- any Xilinx primitives in this code.
--library UNISIM;
--use UNISIM.VComponents.all;
entity head_tb is
end head_tb;
architecture Behavioral of head_tb is
COMPONENT head
Port (
CLK: in std_logic;
PWM_h : out std_logic;
debug_led: out std_logic;
MISO : in STD_LOGIC;
MOSI : out STD_LOGIC;
CS : out STD_LOGIC;
SCLK : out STD_LOGIC;
tx_pwm: out std_logic_vector( 1 downto 0);
rx_pwm: in std_logic_vector ( 1 downto 0)
);
END Component;
signal CLK: std_logic := '0';
signal PWM_h: std_logic := '0';
signal debug_led: std_logic := '0';
signal MISO: std_logic := '0';
signal MOSI: std_logic := '0';
signal CS: std_logic_vector(5 downto 0) := "000000";
signal SCLK: std_logic := '0';
signal tx_pwm: std_logic_vector(1 downto 0) := "00";
signal rx_pwm: std_logic_vector(1 downto 0) := "00";
constant period :time := 10ns;
begin
UUT: SPI port map(
CLK => CLK,
SCLK => SCLK,
CS => CS,
MISO => MISO,
tx_pwm => tx_pwm,
MOSI => MOSI
);
UUT: pwm01 port map(
CLK => CLK,
pwm => pwm_h,
debug_led => debug_led,
rx_pwm => rx_pwm
);
CLK <= not clk after period;
ADC: process
begin
MISO <= '1';
wait for 50 ms;
MISO <= '0';
wait for 50 ms;
end process;
end Behavioral;