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

Subversion Repositories ttl_library

[/] [ttl_library/] [trunk/] [Testbench/] [Testbench_365.vhd] - Blame information for rev 5

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
-- December, 2016.  Perth, Australia                                 --
5
-- Compliance: VHDL 2008                                             --
6
-- Testbench for SN74LS365N: Hex 3-state buffer                      --
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_365 is     -- Top-level bench
17
generic(
18
    StimClk  : std_logic      := '1';
19
    CheckClk : std_logic      := '1';
20
    Period   : time           :=  50 ns;
21
    Finish   : time           := 200 us;
22
    SevLevel : severity_level := failure
23
);
24
end entity;
25
 
26
architecture Test of Testbench_365 is
27
    signal J, B : unsigned(5 downto 0);         -- Test stimuli
28
    signal D, E : std_logic_vector(5 downto 0); -- Expected & actual results
29
    signal EN   : std_logic;
30
 
31
    begin
32
        EN <= not(J(1) or J(0));
33
 
34
    -----------------------------------------------------------------------
35
    -- Standard testbench components
36
    -----------------------------------------------------------------------
37
    TB: TTLBench
38
    generic map(
39
        StimClk  => StimClk,
40
        CheckClk => CheckClk,
41
        Period   => Period,
42
        Finish   => Finish,
43
        SevLevel => SevLevel
44
    )
45
    port map(
46
        J   => J,
47
        B   => B,
48
        CLK => open,
49
        RS  => open,
50
        D   => D,
51
        E   => E
52
    );
53
 
54
    -----------------------------------------------------------------------
55
    -- Generate expected results (with zero delays)
56
    -----------------------------------------------------------------------
57
    D <= std_logic_vector(B) when EN = '1' else (others => 'Z');
58
 
59
    -----------------------------------------------------------------------
60
    -- Device Under Test...                        
61
    -----------------------------------------------------------------------
62
    DUT: SN74LS365AN
63
    port map(
64
        X_1  => J(0),  -- E1\
65
        X_2  => B(0),  -- A1
66
        X_3  => E(0),  -- Y1
67
        X_4  => B(1),  -- A2
68
        X_5  => E(1),  -- Y2
69
        X_6  => B(2),  -- A3
70
        X_7  => E(2),  -- Y3
71
        X_8  => open,  -- GND
72
        X_9  => E(3),  -- Y4
73
        X_10 => B(3),  -- A4
74
        X_11 => E(4),  -- Y5
75
        X_12 => B(4),  -- A5
76
        X_13 => E(5),  -- Y6
77
        X_14 => B(5),  -- A6
78
        X_15 => J(1),  -- E2\
79
        X_16 => open   -- Vcc
80
);
81
end architecture Test;

powered by: WebSVN 2.1.0

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