VHDL mode

x
 
1
LIBRARY ieee;
2
USE ieee.std_logic_1164.ALL;
3
USE ieee.numeric_std.ALL;
4
5
ENTITY tb IS
6
END tb;
7
8
ARCHITECTURE behavior OF tb IS
9
   --Inputs
10
   signal a : unsigned(2 downto 0) := (others => '0');
11
   signal b : unsigned(2 downto 0) := (others => '0');
12
    --Outputs
13
   signal a_eq_b : std_logic;
14
   signal a_le_b : std_logic;
15
   signal a_gt_b : std_logic;
16
17
    signal i,j : integer;
18
19
BEGIN
20
21
    -- Instantiate the Unit Under Test (UUT)
22
   uut: entity work.comparator PORT MAP (
23
          a => a,
24
          b => b,
25
          a_eq_b => a_eq_b,
26
          a_le_b => a_le_b,
27
          a_gt_b => a_gt_b
28
        );
29
30
   -- Stimulus process
31
   stim_proc: process
32
   begin
33
        for i in 0 to 8 loop
34
            for j in 0 to 8 loop
35
                a <= to_unsigned(i,3); --integer to unsigned type conversion
36
                b <= to_unsigned(j,3);
37
                wait for 10 ns;
38
            end loop;
39
        end loop;
40
   end process;
41
42
END;
43

Syntax highlighting and indentation for the VHDL language.

Configuration options:

MIME types defined: text/x-vhdl.