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

Subversion Repositories ttl_library

[/] [ttl_library/] [trunk/] [Testbench/] [Testbench_51.vhd] - Blame information for rev 3

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 SN74LS51N: Dual 2-wide, 2/3-input AOI (Pinout B)    --
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_51 is     -- Top-level bench
17
generic(
18
    StimClk  : std_logic      := '1';
19
    CheckClk : std_logic      := '0';
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_51 is
27
    signal J, B : unsigned(9 downto 0);         -- Test stimuli
28
    signal D, E : std_logic_vector(1 downto 0); -- Expected & actual results
29
 
30
    begin
31
 
32
    -----------------------------------------------------------------------
33
    -- Standard testbench components
34
    -----------------------------------------------------------------------
35
    TB: TTLBench
36
    generic map(
37
        StimClk  => StimClk,
38
        CheckClk => CheckClk,
39
        Period   => Period,
40
        Finish   => Finish,
41
        SevLevel => SevLevel
42
    )
43
    port map(
44
        J   => J,
45
        B   => B,
46
        CLK => open,
47
        RS  => open,
48
        D   => D,
49
        E   => E
50
    );
51
 
52
    -----------------------------------------------------------------------
53
    -- Generate expected results (with zero delays)
54
    -----------------------------------------------------------------------
55
    D(0) <= not( (J(0) and J(1))          or (J(2) and J(3)) );
56
    D(1) <= not( (J(4) and J(5) and J(6)) or (J(7) and J(8) and J(9)) );
57
 
58
    -----------------------------------------------------------------------
59
    -- Device Under Test...                        
60
    -----------------------------------------------------------------------
61
    DUT: SN74LS51N
62
    port map(
63
    X_1  => J(9),  -- 2A1
64
    X_2  => J(0),  -- 1A1
65
    X_3  => J(1),  -- 1A2
66
    X_4  => J(2),  -- 1B1
67
    X_5  => J(3),  -- 1B2
68
    X_6  => E(0),  -- 1Y\
69
    X_7  => open,  -- GND
70
    X_8  => E(1),  -- 2Y\
71
    X_9  => J(4),  -- 2B3
72
    X_10 => J(5),  -- 2B2
73
    X_11 => J(6),  -- 2B1
74
    X_12 => J(7),  -- 2A3
75
    X_13 => J(8),  -- 2A2
76
    X_14 => open   -- Vcc
77
);
78
end architecture Test;

powered by: WebSVN 2.1.0

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