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

Subversion Repositories ttl_library

[/] [ttl_library/] [trunk/] [Testbench/] [Testbench_243.vhd] - Blame information for rev 4

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

Line No. Rev Author Line
1 3 david237
-----------------------------------------------------------------------
2
-- Bipolar TTL models (VHDL)                                         --
3
-- David R Brooks                                                    --
4
-- June, 2016.  Perth, Australia                                     --
5
-- Compliance: VHDL 2008                                             --
6
-- Testbench for SN74LS243N: Quad bus transceiver (3-state outputs)  --
7
-----------------------------------------------------------------------
8
 
9
library ieee;
10
    use ieee.std_logic_1164.all;
11
    use ieee.std_logic_misc.all;
12
    use ieee.numeric_std.all;
13
    use work.LSTTL.all;
14
    use work.TTLPrivate.all;
15
 
16
entity Testbench_243 is     -- Top-level bench
17
generic(
18
    StimClk  : std_logic      := '1';
19
    CheckClk : std_logic      := '1';
20
    Period   : time           := 50 ns;
21
    Finish   : time           := 20 us;
22
    SevLevel : severity_level := failure
23
);
24
end entity;
25
 
26
architecture Test of Testbench_243 is
27
    signal RS       : std_logic;
28
    signal CLK      : std_logic;
29
    signal JC,  BC  : unsigned(7 downto 0);         -- Test stimuli
30
    signal D,   E   : std_logic_vector(8 downto 1); -- Expected & actual results
31
    signal A2B, B2A : std_logic;
32
    signal IA       : std_logic_vector(4 downto 1);
33
 
34
begin
35
    IA  <= std_logic_vector(JC(3 downto 0));
36
 
37
    A2B <= BC(0);
38
    B2A <= BC(0);
39
 
40
    -----------------------------------------------------------------------
41
    -- Standard testbench components
42
    -----------------------------------------------------------------------
43
    TB: TTLBench
44
    generic map(
45
        StimClk  => StimClk,
46
        CheckClk => CheckClk,
47
        Period   => Period,
48
        Finish   => Finish,
49
        SevLevel => SevLevel
50
    )
51
    port map(
52
        J    => JC,
53
        B    => BC,
54
        CLK  => CLK,
55
        RS   => RS,
56
        D    => D,
57
        E    => E
58
    );
59
 
60
    -----------------------------------------------------------------------
61
    -- Generate expected results (with zero delays)
62
    -- Special version for bidirectional circuits
63
    -----------------------------------------------------------------------
64
    GG: process(all) is
65
    begin
66
        for j in IA'range loop
67
            D(j)   <= IA(j);
68
            D(j+4) <= IA(j);
69
 
70
            E(j)   <= IA(j) when A2B = '0' else 'Z';
71
            E(j+4) <= IA(j) when B2A = '1' else 'Z';
72
        end loop;
73
    end process;
74
 
75
    -----------------------------------------------------------------------
76
    -- Device Under Test...                        
77
    -----------------------------------------------------------------------
78
    DUT: SN74LS243N
79
    port map(
80
        X_1  => A2B,  --  A2B\
81
                      --
82
        X_3  => E(1), --  A1
83
        X_4  => E(2), --  A2
84
        X_5  => E(3), --  A3
85
        X_6  => E(4), --  A4
86
        X_7  => open, --  GND
87
        X_8  => E(8), --  B4\
88
        X_9  => E(7), --  B3\
89
        X_10 => E(6), --  B2\
90
        X_11 => E(5), --  B1\
91
                      --
92
        X_13 => B2A,  --  B2A
93
        X_14 => open  --  Vcc
94
    );
95
end architecture Test;

powered by: WebSVN 2.1.0

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