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

Subversion Repositories ttl_library

[/] [ttl_library/] [trunk/] [Testbench/] [Testbench_174.vhd] - Blame information for rev 4

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 SN74LS174N: Hex 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_174 is     -- Top-level bench
17
generic(
18
    StimClk  : std_logic      := '1';
19
    CheckClk : std_logic      := '1';
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_174 is
27
    signal RS         : std_logic;
28
    signal CLK        : std_logic;
29
    signal JC, BC     : unsigned(5 downto 0);           -- Test stimuli
30
    signal D,  E      : std_logic_vector(5 downto 0);   -- Expected & actual results
31
    signal R          : std_logic_vector(5 downto 0);   -- Input
32
 
33
    begin
34
    R <= std_logic_vector(JC);
35
 
36
    -----------------------------------------------------------------------
37
    -- Standard testbench components
38
    -----------------------------------------------------------------------
39
    TB: TTLBench
40
    generic map(
41
        StimClk  => StimClk,
42
        CheckClk => CheckClk,
43
        Period   => Period,
44
        Finish   => Finish,
45
        SevLevel => SevLevel
46
    )
47
    port map(
48
        J    => JC,
49
        B    => BC,
50
        CLK  => CLK,
51
        RS   => RS,
52
        D    => D,
53
        E    => E
54
    );
55
 
56
    -----------------------------------------------------------------------
57
    -- Generate expected results (with zero delays)
58
    -----------------------------------------------------------------------
59
    process(CLK, RS) is
60
    begin
61
        if RS = '0' then
62
            D <= (others => '0');
63
        elsif rising_edge(CLK) then
64
            D <= R;
65
        end if;
66
    end process;
67
 
68
    -----------------------------------------------------------------------
69
    -- Device Under Test...                        
70
    -----------------------------------------------------------------------
71
    DUT: SN74LS174N
72
    port map(
73
        X_1  => RS,   -- MR\
74
        X_2  => E(0), -- Q0
75
        X_3  => R(0), -- D0
76
        X_4  => R(1), -- D1
77
        X_5  => E(1), -- Q1
78
        X_6  => R(2), -- D2
79
        X_7  => E(2), -- Q2
80
        X_8  => open, -- GND
81
        X_9  => CLK,  -- CP
82
        X_10 => E(3), -- Q3
83
        X_11 => R(3), -- D3
84
        X_12 => E(4), -- Q4
85
        X_13 => R(4), -- D4
86
        X_14 => R(5), -- D5
87
        X_15 => E(5), -- Q5
88
        X_16 => open  -- Vcc
89
    );
90
end architecture Test;

powered by: WebSVN 2.1.0

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