OpenCores
URL https://opencores.org/ocsvn/potato/potato/trunk

Subversion Repositories potato

[/] [potato/] [trunk/] [example/] [tb_toplevel.vhd] - Blame information for rev 36

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 12 skordal
-- Practical Test Application for the Potato Processor
2
-- (c) Kristian Klomsten Skordal 2015 <kristian.skordal@wafflemail.net>
3
-- Report bugs and issues on <http://opencores.org/project,potato,bugtracker>
4
 
5
library ieee;
6
use ieee.std_logic_1164.all;
7
 
8
entity tb_toplevel is
9
end entity tb_toplevel;
10
 
11
architecture testbench of tb_toplevel is
12
 
13
        signal clk : std_logic;
14
        constant clk_period : time := 10 ns;
15
 
16
        signal reset_n            : std_logic := '0';
17
        signal external_interrupt : std_logic := '0';
18
 
19
        signal switches : std_logic_vector(15 downto 0);
20
        signal leds : std_logic_vector(15 downto 0);
21
 
22
        signal uart_rxd : std_logic := '1';
23
        signal uart_txd : std_logic;
24
 
25
begin
26
 
27
        switches <= x"a0a0";
28
 
29
        uut: entity work.toplevel
30
                port map(
31
                        clk => clk,
32
                        reset_n => reset_n,
33
                        external_interrupt => external_interrupt,
34
                        switches => switches,
35
                        leds => leds,
36
                        uart_rxd => uart_rxd,
37
                        uart_txd => uart_txd
38
                );
39
 
40
        clock: process
41
        begin
42
                clk <= '0';
43
                wait for clk_period / 2;
44
                clk <= '1';
45
                wait for clk_period / 2;
46
        end process clock;
47
 
48
        stimulus: process
49
        begin
50
                wait for clk_period * 125;
51
                reset_n <= '0';
52
                wait for clk_period * 3;
53
                reset_n <= '1';
54
 
55
                wait;
56
        end process stimulus;
57
 
58
end architecture testbench;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.