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

Subversion Repositories ttl_library

[/] [ttl_library/] [trunk/] [Testbench/] [Testbench_564.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 SN74LS564N: 8-bit D flipflop                        --
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_564 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_564 is
27
    signal J, B : unsigned(7 downto 0);         -- Test stimuli
28
    signal D, E : std_logic_vector(7 downto 0); -- Expected & actual results
29
    signal R    : std_logic_vector(7 downto 0); -- Latch
30
    signal CLK  : std_logic;
31
 
32
    alias OE is J(0);
33
 
34
    begin
35
    -----------------------------------------------------------------------
36
    -- Standard testbench components
37
    -----------------------------------------------------------------------
38
    TB: TTLBench
39
    generic map(
40
        StimClk  => StimClk,
41
        CheckClk => CheckClk,
42
        Period   => Period,
43
        Finish   => Finish,
44
        SevLevel => SevLevel
45
    )
46
    port map(
47
        J    => J,
48
        B    => B,
49
        CLK  => CLK,
50
        RS   => open,
51
        D    => D,
52
        E    => E
53
    );
54
 
55
    -----------------------------------------------------------------------
56
    -- Generate expected results (with zero delays)
57
    -----------------------------------------------------------------------
58
    process(CLK) is
59
    begin
60
        if rising_edge(CLK) then
61
            R <= std_logic_vector(B);
62
        end if;
63
    end process;
64
 
65
    D <= not R when OE = '0' else (others => 'Z');
66
 
67
    -----------------------------------------------------------------------
68
    -- Device Under Test...                        
69
    -----------------------------------------------------------------------
70
    DUT: SN74LS564N
71
    port map(
72
        X_1  => OE,  -- OE\
73
        X_2  => B(0),  -- D0
74
        X_3  => B(1),  -- D1
75
        X_4  => B(2),  -- D2
76
        X_5  => B(3),  -- D3
77
        X_6  => B(4),  -- D4
78
        X_7  => B(5),  -- D5
79
        X_8  => B(6),  -- D6
80
        X_9  => B(7),  -- D7
81
        X_10 => open,  -- GND
82
        X_11 => CLK,  -- CP
83
        X_12 => E(7),  -- O7
84
        X_13 => E(6),  -- O6
85
        X_14 => E(5),  -- O5
86
        X_15 => E(4),  -- O4
87
        X_16 => E(3),  -- O3
88
        X_17 => E(2),  -- O2
89
        X_18 => E(1),  -- O1
90
        X_19 => E(0),  -- O0
91
        X_20 => open   -- Vcc
92
    );
93
end architecture Test;

powered by: WebSVN 2.1.0

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