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

Subversion Repositories gpib_controller

[/] [gpib_controller/] [trunk/] [vhdl/] [test/] [MemoryBlock_Test.vhd] - Blame information for rev 3

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 3 Andrewski
 
2
--------------------------------------------------------------------------------
3
-- Company: 
4
-- Engineer:
5
--
6
-- Create Date:   23:50:53 11/16/2011
7
-- Design Name:   MemoryBlock
8
-- Module Name:   J:/projekty/elektronika/USB_to_HPIB/usbToHpib/src/test/MemoryBlock_Test.vhd
9
-- Project Name:  usbToGpib
10
-- Target Device:  
11
-- Tool versions:  
12
-- Description:   
13
-- 
14
-- VHDL Test Bench Created by ISE for module: MemoryBlock
15
--
16
-- Dependencies:
17
-- 
18
-- Revision:
19
-- Revision 0.01 - File Created
20
-- Additional Comments:
21
--
22
-- Notes: 
23
-- This testbench has been automatically generated using types std_logic and
24
-- std_logic_vector for the ports of the unit under test.  Xilinx recommends 
25
-- that these types always be used for the top-level I/O of a design in order 
26
-- to guarantee that the testbench will bind correctly to the post-implementation 
27
-- simulation model.
28
--------------------------------------------------------------------------------
29
LIBRARY ieee;
30
USE ieee.std_logic_1164.ALL;
31
USE ieee.std_logic_unsigned.all;
32
USE ieee.numeric_std.ALL;
33
 
34
use work.helperComponents.all;
35
 
36
ENTITY MemoryBlock_Test_vhd IS
37
END MemoryBlock_Test_vhd;
38
 
39
ARCHITECTURE behavior OF MemoryBlock_Test_vhd IS
40
 
41
        constant clk_period : time := 1us;
42
 
43
 
44
        SIGNAL reset :  std_logic := '0';
45
        SIGNAL clk :  std_logic := '0';
46
        -------------------------------------------------
47
        SIGNAL p1_addr : std_logic_vector(10 downto 0) := (others => '0');
48
        SIGNAL p1_data_in : std_logic_vector(7 downto 0) := (others => '0');
49
        SIGNAL p1_data_out : std_logic_vector(7 downto 0);
50
        SIGNAL p1_strobe : std_logic := '0';
51
        -------------------------------------------------
52
        SIGNAL p2_addr : std_logic_vector(10 downto 0) := (others => '0');
53
        SIGNAL p2_data_in : std_logic_vector(7 downto 0) := (others => '0');
54
        SIGNAL p2_data_out : std_logic_vector(7 downto 0);
55
        SIGNAL p2_strobe : std_logic := '0';
56
 
57
BEGIN
58
 
59
        -- Instantiate the Unit Under Test (UUT)
60
        uut: MemoryBlock port map (
61
                reset => reset,
62
                clk => clk,
63
                -------------------------------------------------
64
                p1_addr => p1_addr,
65
                p1_data_in => p1_data_in,
66
                p1_strobe => p1_strobe,
67
                p1_data_out => p1_data_out,
68
                -------------------------------------------------
69
                p2_addr => p2_addr,
70
                p2_data_in => p2_data_in,
71
                p2_strobe => p2_strobe,
72
                p2_data_out => p2_data_out
73
        );
74
 
75
        -- Clock process definitions
76
        clk_process :process
77
        begin
78
                clk <= '0';
79
                wait for clk_period/2;
80
                clk <= '1';
81
                wait for clk_period/2;
82
        end process;
83
 
84
        stim_proc: PROCESS
85
        BEGIN
86
 
87
                reset <= '1';
88
                wait for clk_period*4;
89
                reset <= '0';
90
                wait for clk_period*20;
91
 
92
                p1_addr <= "00000000000";
93
                p2_addr <= "00000000000";
94
                p1_data_in <= "10101010";
95
 
96
                wait for clk_period/2;
97
 
98
                p1_strobe <= '1';
99
                wait for clk_period;
100
                p1_strobe <= '0';
101
 
102
                wait for clk_period*4;
103
 
104
                p2_addr <= "00000000101";
105
                p2_data_in <= "11010101";
106
 
107
                wait for clk_period;
108
 
109
                p2_strobe <= '1';
110
                wait for clk_period;
111
                p2_strobe <= '0';
112
 
113
                wait for clk_period*4;
114
 
115
                p1_addr <= "00000000101";
116
 
117
                wait; -- will wait forever
118
        END PROCESS;
119
 
120
END;

powered by: WebSVN 2.1.0

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