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

Subversion Repositories t51

[/] [t51/] [trunk/] [bench/] [vhdl/] [TestBench32.vhd] - Blame information for rev 16

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

Line No. Rev Author Line
1 16 jesus
library IEEE;
2
use IEEE.std_logic_1164.all;
3
use work.StimLog.all;
4
 
5
entity TestBench32 is
6
end TestBench32;
7
 
8
architecture behaviour of TestBench32 is
9
 
10
        signal CLK_I            : std_logic := '0';
11
        signal RST_I            : std_logic := '1';
12
        signal ACK_I            : std_logic;
13
        signal TAG0_O           : std_logic;
14
        signal CYC_O            : std_logic;
15
        signal STB_O            : std_logic;
16
        signal WE_O                     : std_logic;
17
        signal ADR_O            : std_logic_vector(15 downto 0);
18
        signal ADR_O_r          : std_logic_vector(15 downto 0);
19
        signal DAT_I            : std_logic_vector(7 downto 0);
20
        signal DAT_O            : std_logic_vector(7 downto 0);
21
        signal ROM_D            : std_logic_vector(7 downto 0);
22
        signal RAM_D            : std_logic_vector(7 downto 0);
23
        signal CS_n                     : std_logic;
24
        signal WE_n                     : std_logic;
25
        signal RXD                      : std_logic;
26
        signal RXD_IsOut        : std_logic;
27
        signal RXD_Out          : std_logic;
28
        signal TXD                      : std_logic;
29
        signal INT0                     : std_logic := '0';
30
        signal P0                       : std_logic_vector(7 downto 0);
31
        signal P1                       : std_logic_vector(7 downto 0);
32
        signal P2                       : std_logic_vector(7 downto 0);
33
        signal P3                       : std_logic_vector(7 downto 0);
34
 
35
begin
36
 
37
        u0 : entity work.T8032
38
                port map(
39
                        CLK_I => CLK_I,
40
                        RST_I => RST_I,
41
                        ACK_I => ACK_I,
42
                        TAG0_O => TAG0_O,
43
                        CYC_O => CYC_O,
44
                        STB_O => STB_O,
45
                        WE_O => WE_O,
46
                        ADR_O => ADR_O,
47
                        DAT_I => DAT_I,
48
                        DAT_O => DAT_O,
49
                        P0 => P0,
50
                        P1 => P1,
51
                        P2 => P2,
52
                        P3 => P3,
53
                        INT0 => INT0,
54
                        INT1 => '1',
55
                        T0 => '1',
56
                        T1 => '1',
57
                        T2 => '1',
58
                        T2EX => '1',
59
                        RXD => RXD,
60
                        RXD_IsO => RXD_IsOut,
61
                        RXD_O => RXD_Out,
62
                        TXD => TXD);
63
 
64
        rom : entity work.ROM52
65
                port map(
66
                        Clk     => CLK_I,
67
                        A => ADR_O(12 downto 0),
68
                        D => ROM_D);
69
 
70
        WE_n <= WE_O nand ACK_I;
71
        CS_n <= '0' when ADR_O(15 downto 11) = "00000" and TAG0_O = '1' else '1';
72
 
73
        ram : entity work.SSRAM
74
                generic map(
75
                        AddrWidth => 11)
76
                port map(
77
                        Clk => CLK_I,
78
                        CE_n => '0',
79
                        WE_n => WE_n,
80
                        A => ADR_O(10 downto 0),
81
                        DIn => DAT_O,
82
                        DOut => RAM_D);
83
 
84
        DAT_I <= ROM_D when TAG0_O = '0' else RAM_D when ADR_O(15 downto 11) = "00000" else "11111111";
85
        ACK_I <= '1' when ADR_O_r = ADR_O else '0';
86
 
87
        P3(0) <= RXD;
88
 
89
        process (CLK_I)
90
        begin
91
                if CLK_I'event and CLK_I = '1' then
92
                        ADR_O_r <= ADR_O;
93
                end if;
94
        end process;
95
 
96
        as : AsyncStim
97
                generic map(FileName => "BASIC.txt", InterCharDelay => 5000 us, Baud => 115200, Bits => 8)
98
                port map(RXD);
99
 
100
        al : AsyncLog
101
                generic map(FileName => "RX_Log.txt", Baud => 115200, Bits => 8)
102
                port map(TXD);
103
 
104
        CLK_I <= not CLK_I after 45 ns;
105
        RST_I <= '0' after 200 ns;
106
 
107
        INT0 <= not INT0 after 100 us;
108
 
109
end;

powered by: WebSVN 2.1.0

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