Advertisement
Guest User

Untitled

a guest
Jun 28th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.62 KB | None | 0 0
  1. -- Vhdl test bench created from schematic Z:\Lab2\Lab2Schematic.sch - Mon Jun 27 13:56:23 2016
  2. --
  3. -- Notes:
  4. -- 1) This testbench template has been automatically generated using types
  5. -- std_logic and std_logic_vector for the ports of the unit under test.
  6. -- Xilinx recommends that these types always be used for the top-level
  7. -- I/O of a design in order to guarantee that the testbench will bind
  8. -- correctly to the timing (post-route) simulation model.
  9. -- 2) To use this template as your testbench, change the filename to any
  10. -- name of your choice with the extension .vhd, and use the "Source->Add"
  11. -- menu in Project Navigator to import the testbench. Then
  12. -- edit the user defined section below, adding code to generate the
  13. -- stimulus for your design.
  14. --
  15. LIBRARY ieee;
  16. USE ieee.std_logic_1164.ALL;
  17. USE ieee.numeric_std.ALL;
  18. LIBRARY UNISIM;
  19. USE UNISIM.Vcomponents.ALL;
  20. ENTITY Lab2Schematic_Lab2Schematic_sch_tb IS
  21. END Lab2Schematic_Lab2Schematic_sch_tb;
  22. ARCHITECTURE behavioral OF Lab2Schematic_Lab2Schematic_sch_tb IS
  23.  
  24. COMPONENT Lab2Schematic
  25. PORT( E : IN STD_LOGIC;
  26. A : IN STD_LOGIC;
  27. B : IN STD_LOGIC;
  28. C : IN STD_LOGIC;
  29. d0 : OUT STD_LOGIC;
  30. d1 : OUT STD_LOGIC;
  31. d2 : OUT STD_LOGIC;
  32. d3 : OUT STD_LOGIC;
  33. d4 : OUT STD_LOGIC;
  34. d5 : OUT STD_LOGIC;
  35. d6 : OUT STD_LOGIC;
  36. d7 : OUT STD_LOGIC);
  37. END COMPONENT;
  38.  
  39. SIGNAL E : STD_LOGIC;
  40. SIGNAL A : STD_LOGIC;
  41. SIGNAL B : STD_LOGIC;
  42. SIGNAL C : STD_LOGIC;
  43. SIGNAL d0 : STD_LOGIC;
  44. SIGNAL d1 : STD_LOGIC;
  45. SIGNAL d2 : STD_LOGIC;
  46. SIGNAL d3 : STD_LOGIC;
  47. SIGNAL d4 : STD_LOGIC;
  48. SIGNAL d5 : STD_LOGIC;
  49. SIGNAL d6 : STD_LOGIC;
  50. SIGNAL d7 : STD_LOGIC;
  51.  
  52. constant mclk_period : time := 10 ns;
  53.  
  54. BEGIN
  55.  
  56. UUT: Lab2Schematic PORT MAP(
  57. E => E,
  58. A => A,
  59. B => B,
  60. C => C,
  61. d0 => d0,
  62. d1 => d1,
  63. d2 => d2,
  64. d3 => d3,
  65. d4 => d4,
  66. d5 => d5,
  67. d6 => d6,
  68. d7 => d7
  69. );
  70.  
  71.  
  72. A_process : process
  73. begin
  74. A <= '0';
  75. wait for 2*mclk_period/2;
  76. A <= '1';
  77. wait for 2*mclk_period/2;
  78. end process;
  79.  
  80. B_process : process
  81. begin
  82. B <= '0';
  83. wait for 4*mclk_period/2;
  84. B <= '1';
  85. wait for 4*mclk_period/2;
  86. end process;
  87.  
  88. C_process : process
  89. begin
  90. C <= '0';
  91. wait for 8*mclk_period/2;
  92. C <= '1';
  93. wait for 8*mclk_period/2;
  94. end process;
  95. -- *** Test Bench - User Defined Section ***
  96. tb : PROCESS
  97. BEGIN
  98. E <= '0';
  99. Wait for 400 ns;
  100. E <= '1';
  101. WAIT; -- will wait forever
  102. END PROCESS;
  103. -- *** End Test Bench - User Defined Section ***
  104.  
  105. END;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement