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

Subversion Repositories wdsp

[/] [wdsp/] [trunk/] [rtl/] [vhdl/] [WISHBONE_FFT/] [shiftregN.vhd] - Blame information for rev 5

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 5 parrado
-- hds  header_start 
2
-- age shift registe -n st                    r, data_width bits wide. 
3
 
4
LIBRARY    ieee   ;
5
USE ieee.std_logic_1164.ALL;
6
USE ieee.std_logic_arith.ALL;
7
 
8
 
9
ENTITY shiftregN IS
10
   GENERIC(
11
      data_width : integer := 25;
12
      n   : integer := 254
13
   );
14
   PORT(
15
      clock      : IN     std_logic;
16
                enable          : in std_logic;
17
      read_data  : OUT    std_logic_vector (data_width-1 DOWNTO 0);
18
      write_data : IN     std_logic_vector (data_width-1 DOWNTO 0);
19
      resetn     : IN     std_logic
20
   );
21
 
22
-- Declarations 
23
 
24
END shiftregN ;
25
 
26
-- hds interface_end 
27
ARCHITECTURE behavior OF shiftregN IS
28
 
29
type regArray is array (0 to n) of std_logic_vector(data_width-1 downto 0);
30
 
31
signal registerFile  : regArray;
32
 
33
component shiftreg1 IS
34
   GENERIC(
35
   data_width : integer := 25
36
   );
37
    PORT(
38
      clock      : IN     std_logic;
39
                enable          : in std_logic;
40
                clear       : in std_logic;
41
      read_data  : OUT    std_logic_vector (data_width-1 DOWNTO 0);
42
      write_data : IN     std_logic_vector (data_width-1 DOWNTO 0);
43
      resetn     : IN     std_logic
44
   );
45
 
46
-- Declarations 
47
 
48
END component;
49
BEGIN
50
 
51
registerFile(0)<=write_data;
52
read_data<=registerFile(n);
53
 
54
registers: for i in 0 to n-1 generate
55
 
56
regi: shiftreg1 generic map(
57
data_width=>data_width
58
 
59
)
60
port map(
61
clock=>clock,
62
                enable=>enable,
63
                clear=>'0',
64
      read_data=>registerFile(i+1),
65
      write_data=>registerFile(i),
66
      resetn=>resetn
67
 
68
);
69
 
70
end generate;
71
 
72
END behavior;

powered by: WebSVN 2.1.0

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