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

Subversion Repositories the_wizardry_project

[/] [the_wizardry_project/] [trunk/] [Wizardry/] [VHDL/] [Wizardry Top Level/] [Address Generation/] [RDIC/] [burst_read_data_fetcher.vhd] - Blame information for rev 21

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 21 mcwaccent
----------------------------------------------------------------------------------
2
--
3
--  This file is a part of Technica Corporation Wizardry Project
4
--
5
--  Copyright (C) 2004-2009, Technica Corporation  
6
--
7
--  This program is free software: you can redistribute it and/or modify
8
--  it under the terms of the GNU General Public License as published by
9
--  the Free Software Foundation, either version 3 of the License, or
10
--  (at your option) any later version.
11
--
12
--  This program is distributed in the hope that it will be useful,
13
--  but WITHOUT ANY WARRANTY; without even the implied warranty of
14
--  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
--  GNU General Public License for more details.
16
--
17
--  You should have received a copy of the GNU General Public License
18
--  along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
--
20
----------------------------------------------------------------------------------
21
----------------------------------------------------------------------------------
22
-- Module Name: burst_read_data_fetcher - Behavioral 
23
-- Project Name: Wizardry
24
-- Target Devices: Virtex 4 ML401
25
-- Description: Behavioral description for burst read data fetcher.
26
-- Revision: 1.0
27
-- Additional Comments: 
28
--
29
----------------------------------------------------------------------------------
30
library IEEE;
31
use IEEE.STD_LOGIC_1164.ALL;
32
use IEEE.STD_LOGIC_ARITH.ALL;
33
use IEEE.STD_LOGIC_UNSIGNED.ALL;
34
use work.MAC_Constants.all;
35
 
36
---- Uncomment the following library declaration if instantiating
37
---- any Xilinx primitives in this code.
38
--library UNISIM;
39
--use UNISIM.VComponents.all;
40
 
41
entity burst_read_data_fetcher is
42
    Port ( clock : in  STD_LOGIC;
43
           reset : in  STD_LOGIC;
44
           acknowledge_read_data_in : in  STD_LOGIC;
45
           data_in : in  std_logic_vector(data_width -1 downto 0);
46
                          data_out : out std_logic_vector(data_width -1 downto 0);
47
           pop_index : out  STD_LOGIC;
48
                          store_data : out  STD_LOGIC
49
                          );
50
end burst_read_data_fetcher;
51
 
52
architecture Behavioral of burst_read_data_fetcher is
53
type StateType is (idle, store_read_data
54
 
55
                );
56
 
57
signal CurrentState,NextState: StateType;
58
signal count_s : integer range 0 to 4;
59
--signal count_s : integer range 0 to burst_length;
60
signal data_s : std_logic_vector(data_width -1 downto 0);
61
begin
62
read_counter : process(clock,reset,acknowledge_read_data_in,data_s,count_s)
63
begin
64
if(clock = '1' and clock'event) then
65
        if(reset = '1') then
66
                count_s <= 0;
67
                data_s <= (others => '0');
68
        elsif(count_s = 2 or count_s = 4) then
69
--      elsif(count_s = burst_length) then
70
                count_s <= 0;
71
                data_s <= data_s;
72
        elsif(acknowledge_read_data_in = '1') then
73
                count_s <= count_s + 1;
74
                data_s <= data_in;
75
        else
76
                count_s <= count_s;
77
                data_s <= data_s;
78
        end if;
79
end if;
80
data_out <= data_s;
81
end process read_counter;
82
 
83
pop_index <= '1' when (count_s = 2 OR count_s = 4) else '0';
84
 
85
--pop_index <= '1' when (count_s = burst_length) else '0';
86
 
87
read_data_storage: process(CurrentState,acknowledge_read_data_in)--,Memory_access_in)
88
 
89
   begin
90
                case (CurrentState) is
91
                        when idle =>
92
                                        if(acknowledge_read_data_in = '1') then
93
                                                NextState <= store_read_data;
94
                                        else
95
                                                NextState <= idle;
96
                                        end if;
97
                                store_data <= '0';
98
 
99
                        when store_read_data =>
100
                                                NextState <= idle;
101
                                store_data <= '1';
102
 
103
                        when others =>
104
                                                NextState <= idle;
105
                                store_data <= '0';
106
                        end case;
107
end process read_data_storage;
108
 
109
        nextstatelogic: process
110
        begin
111
                        wait until clock'EVENT and clock = '1'; --WAIT FOR RISING EDGE
112
                        -- INITIALIZATION
113
                        if (Reset = '1') then
114
                                CurrentState <= idle;
115
                        else
116
                                CurrentState <= NextState;
117
                        end if;
118
end process nextstatelogic;
119
 
120
 
121
 
122
end Behavioral;
123
 

powered by: WebSVN 2.1.0

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