Advertisement
Guest User

OddNumTestBench

a guest
Oct 24th, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 2.34 KB | None | 0 0
  1. --------------------------------------------------------------------------------
  2. -- Company:
  3. -- Engineer:
  4. --
  5. -- Create Date:   12:40:07 10/24/2016
  6. -- Design Name:  
  7. -- Module Name:   F:/rennnnnnn/lab1/lab1testbench.vhd
  8. -- Project Name:  lab1
  9. -- Target Device:  
  10. -- Tool versions:  
  11. -- Description:  
  12. --
  13. -- VHDL Test Bench Created by ISE for module: OddNum
  14. --
  15. -- Dependencies:
  16. --
  17. -- Revision:
  18. -- Revision 0.01 - File Created
  19. -- Additional Comments:
  20. --
  21. -- Notes:
  22. -- This testbench has been automatically generated using types std_logic and
  23. -- std_logic_vector for the ports of the unit under test.  Xilinx recommends
  24. -- that these types always be used for the top-level I/O of a design in order
  25. -- to guarantee that the testbench will bind correctly to the post-implementation
  26. -- simulation model.
  27. --------------------------------------------------------------------------------
  28. LIBRARY ieee;
  29. USE ieee.std_logic_1164.ALL;
  30.  
  31. -- Uncomment the following library declaration if using
  32. -- arithmetic functions with Signed or Unsigned values
  33. --USE ieee.numeric_std.ALL;
  34.  
  35. ENTITY lab1testbench IS
  36. END lab1testbench;
  37.  
  38. ARCHITECTURE behavior OF lab1testbench IS
  39.  
  40.     -- Component Declaration for the Unit Under Test (UUT)
  41.  
  42.     COMPONENT OddNum
  43.     PORT(
  44.          a : IN  std_logic;
  45.          b : IN  std_logic;
  46.          c : IN  std_logic;
  47.          y : OUT  std_logic
  48.         );
  49.     END COMPONENT;
  50.    
  51.  
  52.    --Inputs
  53.    signal a : std_logic := '0';
  54.    signal b : std_logic := '0';
  55.    signal c : std_logic := '0';
  56.  
  57.     --Outputs
  58.    signal y : std_logic;
  59.    -- No clocks detected in port list. Replace clock below with
  60.    -- appropriate port name
  61.  
  62. begin
  63.    uut: OddNum PORT MAP (
  64.           a => a,
  65.           b => b,
  66.           c => c,
  67.           y => y
  68.         );
  69.     tb : process
  70.     begin
  71.         --0
  72.         wait for 100ns;
  73.         a <= '0';
  74.         b <= '0';
  75.         c <= '0';
  76.         --1
  77.         wait for 100ns;
  78.         a <= '0';
  79.         b <= '0';
  80.         c <= '1';
  81.         --2
  82.         wait for 100ns;
  83.         a <= '0';
  84.         b <= '1';
  85.         c <= '0';
  86.         --3
  87.         wait for 100ns;
  88.         a <= '0';
  89.         b <= '1';
  90.         c <= '1';
  91.         --4
  92.         wait for 100ns;
  93.         a <= '1';
  94.         b <= '0';
  95.         c <= '0';
  96.         --5
  97.         wait for 100ns;
  98.         a <= '1';
  99.         b <= '0';
  100.         c <= '1';
  101.         --6
  102.         wait for 100ns;
  103.         a <= '1';
  104.         b <= '1';
  105.         c <= '0';
  106.         --7
  107.         wait for 100ns;
  108.         a <= '1';
  109.         b <= '1';
  110.         c <= '1';
  111.         wait;
  112.     end process;
  113. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement