AMBPEX5_v20_SX50T_CORE
|
00001 library ieee; 00002 use ieee.STD_LOGIC_UNSIGNED.all; 00003 use ieee.std_logic_1164.all; 00004 use ieee.std_logic_arith.all; 00005 00006 -- Add your library and packages declaration here ... 00007 00008 entity core64_interrupt_tb is 00009 end core64_interrupt_tb; 00010 00011 architecture TB_ARCHITECTURE of core64_interrupt_tb is 00012 -- Component declaration of the tested unit 00013 component core64_interrupt 00014 port( 00015 rstp : in STD_LOGIC; 00016 clk : in STD_LOGIC; 00017 irq : in STD_LOGIC; 00018 cfg_command10 : in STD_LOGIC; 00019 cfg_interrupt : out STD_LOGIC; 00020 cfg_interrupt_assert : out STD_LOGIC; 00021 cfg_interrupt_rdy : in STD_LOGIC ); 00022 end component; 00023 00024 -- Stimulus signals - signals mapped to the input and inout ports of tested entity 00025 signal rstp : STD_LOGIC; 00026 signal clk : STD_LOGIC:='0'; 00027 signal irq : STD_LOGIC; 00028 signal cfg_command10 : STD_LOGIC; 00029 signal cfg_interrupt_rdy : STD_LOGIC; 00030 -- Observed signals - signals mapped to the output ports of tested entity 00031 signal cfg_interrupt : STD_LOGIC; 00032 signal cfg_interrupt_assert : STD_LOGIC; 00033 00034 -- Add your code here ... 00035 00036 begin 00037 00038 clk <= not clk after 2 ns; 00039 rstp <= '1', '0' after 100 ns; 00040 00041 -- Unit Under Test port map 00042 UUT : core64_interrupt 00043 port map ( 00044 rstp => rstp, 00045 clk => clk, 00046 irq => irq, 00047 cfg_command10 => cfg_command10, 00048 cfg_interrupt => cfg_interrupt, 00049 cfg_interrupt_assert => cfg_interrupt_assert, 00050 cfg_interrupt_rdy => cfg_interrupt_rdy 00051 ); 00052 00053 irq <= '0', '1' after 200 ns, '0' after 400 ns, '1' after 500 ns, '0' after 600 ns; 00054 00055 cfg_command10 <= '0'; 00056 pr_interrupt_rdy: process begin 00057 00058 cfg_interrupt_rdy <= '1'; 00059 wait until rising_edge( clk ) and cfg_interrupt='0'; 00060 00061 wait until rising_edge( clk ); 00062 wait until rising_edge( clk ); 00063 wait until rising_edge( clk ); 00064 wait until rising_edge( clk ); 00065 wait until rising_edge( clk ); 00066 00067 cfg_interrupt_rdy <= '0' after 1 ns; 00068 00069 wait until rising_edge( clk ); 00070 00071 cfg_interrupt_rdy <= '1' after 1 ns; 00072 00073 wait until rising_edge( clk ); 00074 wait until rising_edge( clk ); 00075 00076 end process; 00077 00078 end TB_ARCHITECTURE; 00079 00080