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

Subversion Repositories ddr2_sdram

[/] [ddr2_sdram/] [trunk/] [Testbench_DDR2/] [Write/] [Testbench_Write.vhd] - Blame information for rev 4

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 4 john_fpga
--------------------------------------------------------------------------------
2
-- Company: 
3
-- Engineer:
4
--
5
-- Create Date:   16:23:22 06/03/2012
6
-- Design Name:   
7
-- Module Name:   F:/Data_Temp_Ordner/Xilinx/Projekte/Test_Prj22/test_prj22/Testbench_Write.vhd
8
-- Project Name:  test_prj22
9
-- Target Device:  
10
-- Tool versions:  
11
-- Description:   
12
-- 
13
-- VHDL Test Bench Created by ISE for module: DDR2_Write_VHDL
14
-- 
15
-- Dependencies:
16
-- 
17
-- Revision:
18
-- Revision 0.01 - File Created
19
-- Additional Comments:
20
--
21
-- Notes: 
22
-- This testbench has been automatically generated using types std_logic and
23
-- std_logic_vector for the ports of the unit under test.  Xilinx recommends
24
-- that these types always be used for the top-level I/O of a design in order
25
-- to guarantee that the testbench will bind correctly to the post-implementation 
26
-- simulation model.
27
--------------------------------------------------------------------------------
28
LIBRARY ieee;
29
USE ieee.std_logic_1164.ALL;
30
 
31
-- Uncomment the following library declaration if using
32
-- arithmetic functions with Signed or Unsigned values
33
--USE ieee.numeric_std.ALL;
34
 
35
ENTITY Testbench_Write IS
36
END Testbench_Write;
37
 
38
ARCHITECTURE behavior OF Testbench_Write IS
39
 
40
    -- Component Declaration for the Unit Under Test (UUT)
41
 
42
    COMPONENT DDR2_Write_VHDL
43
    PORT(
44
         reset_in : IN  std_logic;
45
         clk_in : IN  std_logic;
46
         clk90_in : IN  std_logic;
47
         w_command_register : OUT  std_logic_vector(2 downto 0);
48
         w_cmd_ack : IN  std_logic;
49
         w_burst_done : OUT  std_logic;
50
         write_en : IN  std_logic;
51
         write_busy : OUT  std_logic;
52
         input_data : OUT  std_logic_vector(31 downto 0);
53
         write_data : IN  std_logic_vector(63 downto 0)
54
        );
55
    END COMPONENT;
56
 
57
 
58
   --Inputs
59
   signal reset_in : std_logic := '0';
60
   signal clk_in : std_logic := '0';
61
   signal clk90_in : std_logic := '0';
62
   signal w_cmd_ack : std_logic := '0';
63
   signal write_en : std_logic := '0';
64
   signal write_data : std_logic_vector(63 downto 0) := (others => '0');
65
 
66
        --Outputs
67
   signal w_command_register : std_logic_vector(2 downto 0);
68
   signal w_burst_done : std_logic;
69
   signal write_busy : std_logic;
70
   signal input_data : std_logic_vector(31 downto 0);
71
 
72
   -- Clock period definitions
73
   constant clk_in_period : time := 7.5 ns;    -- 133.33 MHz
74
   constant clk90_in_period : time := 7.5 ns;    -- 133.33 MHz
75
 
76
BEGIN
77
 
78
        -- Instantiate the Unit Under Test (UUT)
79
   uut: DDR2_Write_VHDL PORT MAP (
80
          reset_in => reset_in,
81
          clk_in => clk_in,
82
          clk90_in => clk90_in,
83
          w_command_register => w_command_register,
84
          w_cmd_ack => w_cmd_ack,
85
          w_burst_done => w_burst_done,
86
          write_en => write_en,
87
          write_busy => write_busy,
88
          input_data => input_data,
89
          write_data => write_data
90
        );
91
 
92
   -- Clock process definitions
93
   clk_in_process :process
94
   begin
95
                clk_in <= '0';
96
                wait for clk_in_period/2;
97
                clk_in <= '1';
98
                wait for clk_in_period/2;
99
   end process;
100
 
101
        -- Clk 90Phase shift
102
   clk90_in_process :process
103
   begin
104
                clk90_in <= '1';
105
                wait for clk90_in_period/4;
106
                clk90_in <= '0';
107
                wait for clk90_in_period/2;
108
                clk90_in <= '1';
109
                wait for clk90_in_period/4;
110
   end process;
111
 
112
 
113
   -- Stimulus process
114
   stim_proc: process
115
   begin
116
      -- hold reset state for 50 ns.
117
      wait for 50 ns;
118
 
119
      -- insert stimulus here
120
                reset_in <= '1' , '0' after 10 ns; -- kurzer Reset Impuls
121
 
122
                --write enable (from Control-Unit)
123
                write_en <= '0' , '1' after 50 ns, '0' after 60 ns;
124
 
125
                --Data to Write (from Control-Unit)
126
                write_data <= x"0000000000000000", x"8C7318E7639CC639" after 50 ns;
127
 
128
      wait;
129
   end process;
130
 
131
        ack_proc : process
132
        begin
133
 
134
                --wait until READ-Command
135
                wait until w_command_register="100";
136
 
137
                --falling edge (clk)
138
                wait for clk90_in_period;
139
 
140
                --user_cmd_ack (from RAM)
141
                w_cmd_ack <= '1';
142
 
143
                --write latency = 23            
144
                wait for clk90_in_period*23;
145
 
146
                --user_cmd_ack (from RAM)
147
                w_cmd_ack <= '0';
148
 
149
 
150
                wait;
151
        end process;
152
 
153
END;

powered by: WebSVN 2.1.0

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