1 | -- vlib work
|
2 | -- vcom endian.vhd
|
3 | -- vsim -gui endian_tb
|
4 | -- add wave *
|
5 | -- run -all
|
6 |
|
7 | library ieee;
|
8 | use ieee.std_logic_1164.all;
|
9 | use ieee.numeric_std.all;
|
10 |
|
11 | entity endian_tb is
|
12 | end entity endian_tb;
|
13 |
|
14 | architecture testbench of endian_tb is
|
15 |
|
16 | signal tb_data_i : std_logic_vector(0 to 7);
|
17 | signal tb_data_o : std_logic_vector(7 downto 0);
|
18 |
|
19 | begin
|
20 |
|
21 | stimuli: process
|
22 | begin
|
23 | for index in 0 to 255 loop
|
24 | tb_data_i <= std_logic_vector( to_unsigned( index, tb_data_i'length));
|
25 | wait for 10 ns;
|
26 | end loop;
|
27 | wait; -- forever
|
28 | end process;
|
29 |
|
30 | dut: entity work.endian
|
31 | port map
|
32 | (
|
33 | data_i => tb_data_i, -- : in std_logic_vector(0 to 7);
|
34 | data_o => tb_data_o -- : out std_logic_vector(7 downto 0)
|
35 | );
|
36 |
|
37 | end architecture testbench;
|
38 |
|
39 |
|
40 |
|
41 | library ieee;
|
42 | use ieee.std_logic_1164.all;
|
43 |
|
44 | entity endian is
|
45 | port
|
46 | (
|
47 | data_i : in std_logic_vector(0 to 7);
|
48 | data_o : out std_logic_vector(7 downto 0)
|
49 | );
|
50 | end entity endian;
|
51 |
|
52 | architecture struct of endian is
|
53 | begin
|
54 |
|
55 | data_o <= data_i;
|
56 |
|
57 | end architecture struct;
|