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

Subversion Repositories ttl_library

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

powered by: WebSVN 2.1.0

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