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

Subversion Repositories graphicallcd

[/] [graphicallcd/] [trunk/] [test_lcd_tb.vhd] - Blame information for rev 4

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 maihde
-------------------------------------------------------------------------------
2
 
3
LIBRARY ieee;
4
USE ieee.std_logic_1164.ALL;
5
USE ieee.numeric_std.ALL;
6
 
7
-------------------------------------------------------------------------------
8
 
9
entity test_lcd_tb is
10
end test_lcd_tb;
11
 
12
-------------------------------------------------------------------------------
13
 
14
architecture behavioral of test_lcd_tb is
15
  component test_lcd
16
    port (
17
      DONE : out   std_logic;
18
      E    : out   std_logic;
19
      R_W  : out   std_logic;
20
      CS1  : out   std_logic;
21
      CS2  : out   std_logic;
22
      D_I  : out   std_logic;
23
      DB   : inout std_logic_vector(7 downto 0);
24
      CLK  : in    std_logic;
25
      RST  : in    std_logic;
26
         RAM_DIS : out std_logic);
27
  end component;
28
 
29
  signal DONE_i : std_logic;
30
  signal E_i    : std_logic;
31
  signal R_W_i  : std_logic;
32
  signal CS1_i  : std_logic;
33
  signal CS2_i  : std_logic;
34
  signal D_I_i  : std_logic;
35
  signal DB_i   : std_logic_vector(7 downto 0);
36
  signal CLK_i  : std_logic;
37
  signal RST_i  : std_logic;
38
  signal RAM_DIS_i : std_logic;
39
 
40
  constant clock_period : delay_length := 20 ns;
41
 
42
begin  -- testbench
43
  UUT: test_lcd
44
    port map (
45
        DONE => DONE_i,
46
        E    => E_i,
47
        R_W  => R_W_i,
48
        CS1  => CS1_i,
49
        CS2  => CS2_i,
50
        D_I  => D_I_i,
51
        DB   => DB_i,
52
        CLK  => CLK_i,
53
        RST  => RST_i,
54
           RAM_DIS => RAM_DIS_i);
55
 
56
  -- Simulate the LCD
57
  DB_i <= "ZZZZZZZZ" when (R_W_i = '0') else "00000000";
58
 
59
  -- Generate the testbench clock
60
  clk_gen: process
61
  begin  -- process clk_gen
62
    CLK_i <= '0';
63
    wait for clock_period/2;
64
    loop
65
      CLK_i <= '1';
66
      wait for clock_period/2;
67
      CLK_i <= '0';
68
      wait for clock_period/2;
69
    end loop;  -- clock_period/2;
70
  end process clk_gen;
71
 
72
  -- Reset driver
73
  RST_i <= '1', '0' after 2.5 * clock_period;
74
 
75
end behavioral;
76
 

powered by: WebSVN 2.1.0

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