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

Subversion Repositories t51

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

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 31 andreas
        signal p3_out   : std_logic_vector(7 downto 0);
35 16 jesus
 
36
begin
37
 
38
        u0 : entity work.T8032
39
                port map(
40
                        CLK_I => CLK_I,
41
                        RST_I => RST_I,
42
                        ACK_I => ACK_I,
43
                        TAG0_O => TAG0_O,
44
                        CYC_O => CYC_O,
45
                        STB_O => STB_O,
46
                        WE_O => WE_O,
47
                        ADR_O => ADR_O,
48
                        DAT_I => DAT_I,
49
                        DAT_O => DAT_O,
50 31 andreas
                        P0_in => P0,
51
                        P1_in => P1,
52
                        P2_in => P2,
53
                        P3_in => P3,
54
                        P0_out => P0,
55
      P1_out => P1,
56
      P2_out => P2,
57
      P3_out => P3_out,
58 16 jesus
                        INT0 => INT0,
59
                        INT1 => '1',
60
                        T0 => '1',
61
                        T1 => '1',
62
                        T2 => '1',
63
                        T2EX => '1',
64
                        RXD => RXD,
65
                        RXD_IsO => RXD_IsOut,
66
                        RXD_O => RXD_Out,
67
                        TXD => TXD);
68
 
69
        rom : entity work.ROM52
70
                port map(
71
                        Clk     => CLK_I,
72
                        A => ADR_O(12 downto 0),
73
                        D => ROM_D);
74
 
75
        WE_n <= WE_O nand ACK_I;
76
        CS_n <= '0' when ADR_O(15 downto 11) = "00000" and TAG0_O = '1' else '1';
77
 
78
        ram : entity work.SSRAM
79
                generic map(
80
                        AddrWidth => 11)
81
                port map(
82
                        Clk => CLK_I,
83
                        CE_n => '0',
84
                        WE_n => WE_n,
85
                        A => ADR_O(10 downto 0),
86
                        DIn => DAT_O,
87
                        DOut => RAM_D);
88
 
89
        DAT_I <= ROM_D when TAG0_O = '0' else RAM_D when ADR_O(15 downto 11) = "00000" else "11111111";
90
        ACK_I <= '1' when ADR_O_r = ADR_O else '0';
91
 
92
        P3(0) <= RXD;
93 31 andreas
  P3(7 downto 1) <= P3_out(7 downto 1);
94
 
95 16 jesus
        process (CLK_I)
96
        begin
97
                if CLK_I'event and CLK_I = '1' then
98
                        ADR_O_r <= ADR_O;
99
                end if;
100
        end process;
101
 
102
        as : AsyncStim
103 31 andreas
                generic map(FileName => "BASIC.txt", InterCharDelay => 5000 us, Baud => 57600, Bits => 8)
104 16 jesus
                port map(RXD);
105
 
106 31 andreas
 
107 16 jesus
        al : AsyncLog
108 31 andreas
                generic map(FileName => "RX_Log.txt", Baud => 57600, Bits => 8)
109 16 jesus
                port map(TXD);
110
 
111
        CLK_I <= not CLK_I after 45 ns;
112
        RST_I <= '0' after 200 ns;
113
 
114
        INT0 <= not INT0 after 100 us;
115
 
116
end;

powered by: WebSVN 2.1.0

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