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

Subversion Repositories ttl_library

[/] [ttl_library/] [trunk/] [Testbench/] [Testbench_352.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 SN74LS352N: Dual 4-input mux. (common selects)      --
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_352 is     -- Top-level bench
17
generic(
18
    StimClk  : std_logic      := '1';
19
    CheckClk : std_logic      := '1';
20
    Period   : time           :=  50 ns;
21
    Finish   : time           := 200 us;
22
    SevLevel : severity_level := failure
23
);
24
end entity;
25
 
26
architecture Test of Testbench_352 is
27
    signal J, B : unsigned(7 downto 0);         -- Test stimuli
28
    signal D, E : std_logic_vector(1 downto 0); -- Expected & actual results
29
    signal A    : unsigned(1 downto 0);
30
    signal chn  : natural range 3 downto 0;
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   => J,
47
        B   => B,
48
        CLK => open,
49
        RS  => open,
50
        D   => D,
51
        E   => E
52
    );
53
 
54
    -----------------------------------------------------------------------
55
    -- Generate expected results (with zero delays)
56
    -----------------------------------------------------------------------
57
    A    <= B(3 downto 2);
58
    chn  <= TTL_to_integer(A);
59
 
60
    D(0) <= not((not B(0)) and B(7-chn));
61
    D(1) <= not((not B(1)) and B(chn+4));
62
 
63
    -----------------------------------------------------------------------
64
    -- Device Under Test...                        
65
    -----------------------------------------------------------------------
66
    DUT: SN74LS352N
67
    port map(
68
    X_1  => B(0),  -- EA\
69
    X_2  => B(3),  -- S1
70
    X_3  => B(4),  -- I3A
71
    X_4  => B(5),  -- I2A
72
    X_5  => B(6),  -- I1A
73
    X_6  => B(7),  -- I0A
74
    X_7  => E(0),  -- ZA\
75
    X_8  => open,  -- GND
76
    X_9  => E(1),  -- ZB\
77
    X_10 => B(4),  -- I0B
78
    X_11 => B(5),  -- I1B
79
    X_12 => B(6),  -- I2B
80
    X_13 => B(7),  -- I3B
81
    X_14 => B(2),  -- S0
82
    X_15 => B(1),  -- EB\
83
    X_16 => open   -- Vcc
84
);
85
end architecture Test;

powered by: WebSVN 2.1.0

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