Advertisement
Guest User

testbench

a guest
Apr 24th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.72 KB | None | 0 0
  1. ----------------------------------------------------------------------------------
  2. -- Company:
  3. -- Engineer:
  4. --
  5. -- Create Date: 04/24/2019 03:09:56 PM
  6. -- Design Name:
  7. -- Module Name: TB_tanh - Behavioral
  8. -- Project Name:
  9. -- Target Devices:
  10. -- Tool Versions:
  11. -- Description:
  12. --
  13. -- Dependencies:
  14. --
  15. -- Revision:
  16. -- Revision 0.01 - File Created
  17. -- Additional Comments:
  18. --
  19. ----------------------------------------------------------------------------------
  20.  
  21.  
  22. library IEEE;
  23. use IEEE.STD_LOGIC_1164.ALL;
  24.  
  25. -- Uncomment the following library declaration if using
  26. -- arithmetic functions with Signed or Unsigned values
  27. --use IEEE.NUMERIC_STD.ALL;
  28.  
  29. -- Uncomment the following library declaration if instantiating
  30. -- any Xilinx leaf cells in this code.
  31. --library UNISIM;
  32. --use UNISIM.VComponents.all;
  33.  
  34. entity TB_tanh is
  35. -- Port ( );
  36. end TB_tanh;
  37.  
  38. architecture Behavioral of TB_tanh is
  39. COMPONENT tanh
  40. PORT (
  41. aclock : IN STD_LOGIC;
  42. in_valid : IN STD_LOGIC;
  43. in_data : IN STD_LOGIC_VECTOR(15 DOWNTO 0);
  44. out_valid : OUT STD_LOGIC;
  45. out_data : OUT STD_LOGIC_VECTOR(15 DOWNTO 0)
  46. );
  47. END COMPONENT;
  48.  
  49. signal clock : STD_LOGIC:='0' ;
  50. signal invalid : STD_LOGIC := '0' ;
  51. signal input : STD_LOGIC_VECTOR (15 downto 0 ) :="0010000000000000" ;
  52. signal output : STD_LOGIC_VECTOR (15 downto 0 ) ;
  53. signal outvalid : STD_LOGIC ;
  54.  
  55. begin
  56. unit_under_test :tanh
  57. PORT MAP (
  58. aclock => clock ,
  59. in_valid => invalid ,
  60. in_data => input,
  61. out_valid => outvalid,
  62. out_data => output
  63. );
  64.  
  65. WAIT_PROC: process
  66. begin
  67.  
  68. input <= "0000000000000000" ;
  69. clock <= not clock after 5ns ;
  70.  
  71. invalid <= '1' ;
  72. wait for 1000ns ;
  73. invalid <= '0' ;
  74.  
  75. -- -1.5?
  76. end process WAIT_PROC ;
  77.  
  78. end behavioral;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement