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

Subversion Repositories ttl_library

[/] [ttl_library/] [trunk/] [Testbench/] [Testbench_379.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
-- December, 2016.  Perth, Australia                                 --
5
-- Compliance: VHDL 2008                                             --
6
-- Testbench for SN74LS379N: 4-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_379 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_379 is
27
    signal J, B : unsigned(3 downto 0);         -- Test stimuli
28
    signal D, E : std_logic_vector(7 downto 0); -- Expected & actual results
29
    signal R, N : std_logic_vector(3 downto 0); -- Register
30
    signal CLK  : std_logic;
31
 
32
    alias EN 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
            if EN = '0' then
62
                R <= std_logic_vector(B);
63
            end if;
64
        end if;
65
    end process;
66
 
67
    N <= not R;
68
    D <= N & R;
69
 
70
    -----------------------------------------------------------------------
71
    -- Device Under Test...                        
72
    -----------------------------------------------------------------------
73
    DUT: SN74LS379N
74
    port map(
75
        X_1  => EN,  -- E\
76
        X_2  => E(0),  -- Q0
77
        X_3  => E(4),  -- Q0\
78
        X_4  => B(0),  -- D0
79
        X_5  => B(1),  -- D1
80
        X_6  => E(5),  -- Q1\
81
        X_7  => E(1),  -- Q1
82
        X_8  => open, -- GND
83
        X_9  => CLK,  -- CP
84
        X_10 => E(2),  -- Q2
85
        X_11 => E(6),  -- Q2\
86
        X_12 => B(2),  -- D2
87
        X_13 => B(3),  -- D3
88
        X_14 => E(7),  -- Q3\
89
        X_15 => E(3),  -- Q3
90
        X_16 => open  -- Vcc
91
    );
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.