]> rtime.felk.cvut.cz Git - fpga/lx-cpu1/lx-rocon.git/blob - hw/tb/irc_reader_tb.vhd
Improve tumbl, tweak xst settings for more optimal synthesis
[fpga/lx-cpu1/lx-rocon.git] / hw / tb / irc_reader_tb.vhd
1 LIBRARY ieee;
2 USE ieee.std_logic_1164.ALL;
3
4 ENTITY irc_reader_tb IS
5 END irc_reader_tb;
6
7 ARCHITECTURE behavior OF irc_reader_tb IS
8
9     -- Component Declaration for the Unit Under Test (UUT)
10
11     COMPONENT irc_reader
12     PORT(
13          clk : IN  std_logic;
14          reset : IN  std_logic;
15          a0 : IN  std_logic;
16          b0 : IN  std_logic;
17          index0 : IN  std_logic;
18          mark0 : IN  std_logic;
19          qcount : OUT  std_logic_vector(31 downto 0);
20          ab_event : OUT  std_logic;
21          ab_error : OUT  std_logic;
22          out_index : OUT  std_logic;
23          out_mark : OUT  std_logic
24         );
25     END COMPONENT;
26
27
28    --Inputs
29    signal clk : std_logic := '0';
30    signal reset : std_logic := '0';
31    signal a0 : std_logic := '0';
32    signal b0 : std_logic := '0';
33    signal index0 : std_logic := '0';
34    signal mark0 : std_logic := '0';
35
36         --Outputs
37    signal qcount : std_logic_vector(31 downto 0);
38    signal ab_event : std_logic;
39    signal ab_error : std_logic;
40    signal out_index : std_logic;
41    signal out_mark : std_logic;
42
43    -- Clock period definitions
44    constant clk_period : time := 20 ns;
45
46 BEGIN
47
48         -- Instantiate the Unit Under Test (UUT)
49    uut: irc_reader PORT MAP (
50           clk => clk,
51           reset => reset,
52           a0 => a0,
53           b0 => b0,
54           index0 => index0,
55           mark0 => mark0,
56           qcount => qcount,
57           ab_event => ab_event,
58           ab_error => ab_error,
59           out_index => out_index,
60           out_mark => out_mark
61         );
62
63    -- Clock process definitions
64    clk_process :process
65    begin
66                 clk <= '0';
67                 wait for clk_period/2;
68                 clk <= '1';
69                 wait for clk_period/2;
70    end process;
71
72
73    -- Stimulus process
74    stim_proc: process
75    begin
76       -- hold reset state for 100 ns.
77       reset <= '0';
78       wait for 100 ns;
79                         reset <= '1';
80
81       wait for clk_period*10;
82
83       -- insert stimulus here
84
85       wait;
86    end process;
87
88 END;