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

Subversion Repositories ttl_library

[/] [ttl_library/] [trunk/] [Testbench/] [Testbench_241.vhd] - Blame information for rev 6

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 SN74LS241N: Octal buffer/line driver (3-state ops)  --
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_241 is     -- Top-level bench
17
generic(
18
    StimClk  : std_logic      := '1';
19
    CheckClk : std_logic      := '1';
20
    Period   : time           := 50 ns;
21
    Finish   : time           := 20 us;
22
    SevLevel : severity_level := failure
23
);
24
end entity;
25
 
26
architecture Test of Testbench_241 is
27
    signal RS       : std_logic;
28
    signal CLK      : std_logic;
29
    signal JC, BC   : unsigned(9 downto 0);       -- Test stimuli
30
    signal D,  E    : std_logic_vector(7 downto 0);   -- Expected & actual results
31
    signal OEA, OEB : std_logic;
32
    signal IA,  IB  : std_logic_vector(3 downto 0);
33
begin
34
    OEA <= JC(9);
35
    OEB <= JC(8);
36
    IA  <= std_logic_vector(BC(4 downto 1));
37
    IB  <= std_logic_vector(BC(3 downto 0));
38
 
39
    -----------------------------------------------------------------------
40
    -- Standard testbench components
41
    -----------------------------------------------------------------------
42
    TB: TTLBench
43
    generic map(
44
        StimClk  => StimClk,
45
        CheckClk => CheckClk,
46
        Period   => Period,
47
        Finish   => Finish,
48
        SevLevel => SevLevel
49
    )
50
    port map(
51
        J    => JC,
52
        B    => BC,
53
        CLK  => CLK,
54
        RS   => RS,
55
        D    => D,
56
        E    => E
57
    );
58
 
59
    -----------------------------------------------------------------------
60
    -- Generate expected results (with zero delays)
61
    -----------------------------------------------------------------------
62
 
63
    GG: for j in IA'range generate
64
    begin
65
        D(j)   <= IA(j) when OEA = '0' else 'Z';
66
        D(j+4) <= IB(j) when OEB = '1' else 'Z';
67
    end generate;
68
 
69
    -----------------------------------------------------------------------
70
    -- Device Under Test...                        
71
    -----------------------------------------------------------------------
72
    DUT: SN74LS241N
73
    port map(
74
        X_1  => OEA,   -- OEA\
75
        X_2  => IA(0), -- IA0
76
        X_3  => E(4),  -- YB0
77
        X_4  => IA(1), -- IA1
78
        X_5  => E(5),  -- YB1
79
        X_6  => IA(2), -- IA2
80
        X_7  => E(6),  -- YB2
81
        X_8  => IA(3), -- IA3
82
        X_9  => E(7),  -- YB3
83
        X_10 => open,  -- GND
84
        X_11 => IB(3), -- IB3
85
        X_12 => E(3),  -- YA3
86
        X_13 => IB(2), -- IB2
87
        X_14 => E(2),  -- YA2
88
        X_15 => IB(1), -- IB1
89
        X_16 => E(1),  -- YA1
90
        X_17 => IB(0), -- IB0
91
        X_18 => E(0),  -- YA0
92
        X_19 => OEB,   -- OEB
93
        X_20 => open   -- Vcc
94
    );
95
end architecture Test;

powered by: WebSVN 2.1.0

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