OpenCores
URL https://opencores.org/ocsvn/395_vgs/395_vgs/trunk

Subversion Repositories 395_vgs

[/] [395_vgs/] [trunk/] [hdl/] [fill-unit.vhd] - Blame information for rev 16

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

Line No. Rev Author Line
1 15 cavanaug
--------------------------------------------------------------------------------
2
-- Company: 
3
-- Engineer:
4
--
5
-- Create Date:    20:57:23 09/12/05
6
-- Design Name:    
7
-- Module Name:    fill-unit - Behavioral
8
-- Project Name:   
9
-- Target Device:  
10
-- Tool versions:  
11
-- Description:
12
--
13
-- Dependencies:
14
-- 
15
-- Revision:
16
-- Revision 0.01 - File Created
17
-- Additional Comments:
18
-- 
19
--------------------------------------------------------------------------------
20
 
21
library IEEE, UNISIM;
22
use IEEE.std_logic_1164.all;
23
use IEEE.numeric_std.all;
24
use UNISIM.VComponents.all;
25
use WORK.common.all;
26
use WORK.sdram.all;
27
 
28
use IEEE.STD_LOGIC_ARITH.ALL;
29
use IEEE.STD_LOGIC_UNSIGNED.ALL;
30
 
31
 
32
package fillunit_pckg is
33
        component fillunit
34
                generic(
35
            FREQ                 :     natural := 50_000;  -- operating frequency in KHz
36
            DATA_WIDTH           :     natural := 16;  -- host & SDRAM data width
37
            HADDR_WIDTH          :     natural := 23  -- host-side address width
38
            );
39
          port(
40
            clk                  : in  std_logic;  -- master clock
41
                 reset                                   :      in  std_logic;  -- reset for this entity
42
                 rd1                  : out  std_logic;  -- initiate read operation
43
            wr1                  : out  std_logic;  -- initiate write operation
44
            opBegun              : in std_logic;  -- read/write/self-refresh op begun (clocked)
45
            done1                : in std_logic;  -- read or write operation is done
46
            hAddr1               : out  std_logic_vector(HADDR_WIDTH-1 downto 0);  -- address to SDRAM
47
            hDIn1                : out  std_logic_vector(DATA_WIDTH-1 downto 0);  -- data to dualport to SDRAM
48
            hDOut1               : in std_logic_vector(DATA_WIDTH-1 downto 0)  -- data from dualport to SDRAM
49
                 );
50
        end component fillunit;
51
end package fillunit_pckg;
52
 
53
library IEEE, UNISIM;
54
use IEEE.std_logic_1164.all;
55
use IEEE.numeric_std.all;
56
use UNISIM.VComponents.all;
57
use WORK.common.all;
58
use WORK.sdram.all;
59
 
60
use IEEE.STD_LOGIC_ARITH.ALL;
61
use IEEE.STD_LOGIC_UNSIGNED.ALL;
62
 
63
entity fillunit is
64
        generic(
65
    FREQ                 :     natural := 50_000;  -- operating frequency in KHz
66
    DATA_WIDTH           :     natural := 16;  -- host & SDRAM data width
67
    HADDR_WIDTH          :     natural := 23  -- host-side address width
68
    );
69
  port(
70
    -- host side
71
    clk                  : in  std_logic;  -- master clock
72
         reset                                   :      in  std_logic;  -- reset for this entity
73
         rd1                  : out  std_logic;  -- initiate read operation
74
    wr1                  : out  std_logic;  -- initiate write operation
75
    opBegun              : in std_logic;  -- read/write/self-refresh op begun (clocked)
76
    done1                : in std_logic;  -- read or write operation is done
77
    hAddr1               : out  std_logic_vector(HADDR_WIDTH-1 downto 0);  -- address to SDRAM
78
    hDIn1                : out  std_logic_vector(DATA_WIDTH-1 downto 0);  -- data to dualport to SDRAM
79
    hDOut1               : in std_logic_vector(DATA_WIDTH-1 downto 0)  -- data from dualport to SDRAM
80
    );
81
end entity fillunit;
82
 
83
architecture arch of fillunit is
84
 
85
type cntrl_state is (idle, write_state, wait_state);
86
 
87
signal pixeldata, output         : std_logic_vector(15 downto 0); -- broken down to 2 8 bit pixels
88
signal currentbuffer, write, start : std_logic;
89
signal address                           : std_logic_vector(22 downto 0);
90 16 cavanaug
signal counter                           : std_logic_vector(11 downto 0);
91 15 cavanaug
begin
92
        hDIn1 <= output;
93
        hAddr1 <= address;
94
        wr1 <= '1';
95
        start <= '1';
96 16 cavanaug
        output <= pixeldata;
97 15 cavanaug
 
98 16 cavanaug
 
99
        process (clk, reset)
100
        begin
101 15 cavanaug
           if rising_edge(clk) then
102
                        if address = "0000001001011000000000" then
103
                                        address <= "00000000000000000000000";
104 16 cavanaug
                                        counter <= counter + 1;
105 15 cavanaug
                        elsif done1 = '1' then
106
                                        address <= address + 1;
107
 
108
                        end if;
109
                end if;
110 16 cavanaug
        end process;
111
 
112
screendivide: process (counter)
113
        begin
114
                if (counter = "100000000000") then
115
                        pixeldata <= pixeldata + "0000010000000100";
116
                else
117
                        pixeldata <= pixeldata;
118
                end if;
119
        end process;
120 15 cavanaug
 
121
end arch;

powered by: WebSVN 2.1.0

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