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

Subversion Repositories ttl_library

[/] [ttl_library/] [trunk/] [Testbench/] [Testbench_135.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 SN74S135N: Quad XOR/NOR gate                        --
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_135 is     -- Top-level bench
17
generic(
18
    StimClk  : std_logic      := '1';
19
    CheckClk : std_logic      := '0';
20
    Period   : time           := 100 ns;
21
    Finish   : time           :=  20 us;
22
    SevLevel : severity_level := failure
23
);
24
end entity;
25
 
26
architecture Test of Testbench_135 is
27
    signal J, B : unsigned(9 downto 0);         -- Test stimuli
28
    signal D, E : std_logic_vector(3 downto 0); -- Expected & actual results
29
 
30
    begin
31
    -----------------------------------------------------------------------
32
    -- Standard testbench components
33
    -----------------------------------------------------------------------
34
    TB: TTLBench
35
    generic map(
36
        StimClk  => StimClk,
37
        CheckClk => CheckClk,
38
        Period   => Period,
39
        Finish   => Finish,
40
        SevLevel => SevLevel
41
    )
42
    port map(
43
        J    => J,
44
        B    => B,
45
        CLK  => open,
46
        RS   => open,
47
        D    => D,
48
        E    => E
49
    );
50
 
51
    -----------------------------------------------------------------------
52
    -- Generate expected results (with zero delays)
53
    -----------------------------------------------------------------------
54
    D(0) <= J(0) xor J(1) xor J(8);
55
    D(1) <= J(2) xor J(3) xor J(8);
56
    D(2) <= J(4) xor J(5) xor J(9);
57
    D(3) <= J(6) xor J(7) xor J(9);
58
 
59
    -----------------------------------------------------------------------
60
    -- Device Under Test...                        
61
    -----------------------------------------------------------------------
62
    DUT: SN74S135N
63
    port map(
64
    X_1  => J(0),  -- A1
65
    X_2  => J(1),  -- B1
66
    X_3  => E(0),  -- Y1
67
    X_4  => J(8),  -- C12
68
    X_5  => J(2),  -- A2
69
    X_6  => J(3),  -- B2
70
    X_7  => E(1),  -- Y2
71
    X_8  => open,  -- GND
72
    X_9  => E(2),  -- Y3
73
    X_10 => J(4),  -- B3
74
    X_11 => J(5),  -- A3
75
    X_12 => J(9),  -- C34
76
    X_13 => E(3),  -- Y4
77
    X_14 => J(6),  -- B4
78
    X_15 => J(7),  -- A4
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.