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

Subversion Repositories ttl_library

[/] [ttl_library/] [trunk/] [Testbench/] [Testbench_77.vhd] - Blame information for rev 6

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 SN74LS77N: Quad D-type latch                        --
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_77 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_77 is
27
    signal J, B : unsigned(5 downto 0);         -- Test stimuli
28
    signal D, E : std_logic_vector(3 downto 0); -- Expected & actual results
29
    signal S    : std_logic_vector(3 downto 0);
30
 
31
    begin
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
    S <= (J(5), J(5), J(4), J(4));
56
 
57
    G1: for i in 3 downto 0 generate
58
    begin
59
        process(S, J) is
60
        begin
61
            if S(i) = '1' then
62
                D(i)   <= J(i);
63
            end if;
64
        end process;
65
    end generate;
66
 
67
    -----------------------------------------------------------------------
68
    -- Device Under Test...                        
69
    -----------------------------------------------------------------------
70
    DUT: SN74LS77N
71
    port map(
72
    X_1  => J(0),  -- D1
73
    X_2  => J(1),  -- D2
74
    X_3  => J(5),  -- E34
75
    X_4  => open,  -- Vcc
76
    X_5  => J(2),  -- D3
77
    X_6  => J(3),  -- D4
78
                   -- 
79
    X_8  => E(3),  -- Q4
80
    X_9  => E(2),  -- Q3
81
                   -- 
82
    X_11 => open,  -- GND
83
    X_12 => J(4),  -- E12
84
    X_13 => E(1),  -- Q2
85
    X_14 => E(0)   -- Q1
86
);
87
end architecture Test;

powered by: WebSVN 2.1.0

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