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

Subversion Repositories wdsp

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 5 parrado
library ieee;
2
library work;
3
 
4
use ieee.std_logic_1164.all;
5
use ieee.numeric_std.all;
6
use ieee.math_real.all;
7
 
8
 
9
entity FFT_WB is
10
generic (WB_Width:integer:=32;--Filter width signals of in/out
11
                        Adress_wordwidth:integer:=32 ;
12
                        N:integer:=1024;--width word of coefs
13
                        reg_control:integer:=0;
14
                        reg_data:integer:=4;
15
                        reg_status:integer:=8;
16
                        reg_memory:integer:=12
17
 
18
                        );
19
 
20
port(
21
DAT_I: in std_logic_vector(WB_Width-1 downto 0);
22
DAT_O:out std_logic_vector(WB_Width-1 downto 0);
23
ADR_I :in std_logic_vector(Adress_wordwidth-1 downto 0);
24
STB_I,RST_I,CLK_I,WE_I: in std_logic;
25
ACK_O: out   std_logic
26
);
27
end entity;
28
 
29
 
30
architecture RTL of FFT_WB is
31
 
32
 
33
component fft_core_pipeline1 is
34
  generic (
35
        input_width : integer :=16;
36
   twiddle_width : integer :=16;
37
   N : integer :=1024;
38
   add_g : integer:=0;--1;  --Either 0 or 1 only. 
39
   mult_g : integer:=0--9  --Can be any number from 0 to twiddle_width+1 
40
   );
41
  port (  clock : in std_logic;
42
   resetn : in std_logic;
43
   enable : in std_logic;
44
        clear : in std_logic;
45
        enable_out: out std_logic;
46
        frame_ready: out std_logic;
47
        index : out std_logic_vector(integer(ceil(log2(real((N)))))-1 downto 0);
48
      xin_r : in std_logic_vector(input_width-1 downto 0);
49
      xin_i : in std_logic_vector(input_width-1 downto 0);
50
      Xout_r : out std_logic_vector (input_width+((integer(ceil(log2(real((N)))))-1)/2)*mult_g+integer(ceil(log2(real((N)))))*add_g-1 downto 0);
51
      Xout_i : out std_logic_vector (input_width+((integer(ceil(log2(real((N)))))-1)/2)*mult_g+integer(ceil(log2(real((N)))))*add_g-1 downto 0)
52
   );
53
end component;
54
 
55
component interface_slave_fft is
56
generic(
57
N: integer;
58
data_wordwidth: integer;
59
adress_wordwidth: integer;
60
reg_control:integer;
61
reg_data:integer;
62
reg_status:integer;
63
reg_memory:integer
64
 
65
 
66
);
67
port(
68
 
69
 
70
 ACK_O: out   std_logic;--to MASTER
71
 ADR_I: in    std_logic_vector( adress_wordwidth-1 downto 0 );
72
 ADR_FFT: in    std_logic_vector( integer(ceil(log2(real(N))))-1 downto 0 );
73
 DAT_I: in    std_logic_vector( data_wordwidth-1 downto 0 );--from MASTER
74
 sDAT_I: in    std_logic_vector( data_wordwidth-1 downto 0 );--from SLAVE
75
 DAT_O: out   std_logic_vector( data_wordwidth-1 downto 0 );--to MASTER
76
 sDAT_O: out   std_logic_vector( data_wordwidth-1 downto 0 );--to SLAVE
77
 STB_I: in    std_logic;--from MASTER
78
 WE_I: in    std_logic;--from MASTER
79
 FFT_finish_in: in    std_logic;--from SLAVE    
80
 FFT_enable: out    std_logic;--to SLAVE        
81
 enable_in: in    std_logic;--from SLAVE        
82
 clear_out: out    std_logic;--to SLAVE
83
 clk: in std_logic
84
 );
85
end component;
86
 
87
signal index_aux: std_logic_vector(integer(ceil(log2(real(N))))-1 downto 0);
88
signal frame_ready_aux,enable_out_aux,FFT_enable_aux,clear_aux:std_logic;
89
signal Data1_aux,Data2_aux: std_logic_vector(WB_Width-1 downto 0);
90
begin
91
 
92
--Instancia del FFT-Core
93
FFT: fft_core_pipeline1
94
  generic map(
95
        input_width=>WB_Width/2,
96
   twiddle_width=>WB_Width/2,
97
   N=>N,
98
   add_g=>0,
99
   mult_g=>0
100
   )
101
  port map(
102
   clock=>CLK_I,
103
   resetn=>RST_I,
104
   enable=>FFT_enable_aux,
105
        clear=>clear_aux,
106
        enable_out=>enable_out_aux,
107
        frame_ready=>frame_ready_aux,
108
        index=>index_aux,
109
   xin_r=>Data1_aux(WB_Width-1 downto WB_Width/2),
110
   xin_i=>Data1_aux((WB_Width/2)-1 downto 0),
111
   Xout_r=>Data2_aux(WB_Width-1 downto WB_Width/2),
112
   Xout_i=>Data2_aux((WB_Width/2)-1 downto 0)
113
   );
114
 
115
        --Instancia de interfaz con arbitro Wishbone 
116
        Interface: interface_slave_fft
117
generic map(
118
N=>N,
119
data_wordwidth=>WB_Width,
120
adress_wordwidth=>Adress_wordwidth,
121
reg_control=>reg_control,
122
reg_data=>reg_data,
123
reg_status=>reg_status,
124
reg_memory=>reg_memory
125
)
126
port map(
127
 ACK_O=>ACK_O,
128
 ADR_I=>ADR_I,
129
 ADR_FFT=>index_aux,
130
 DAT_I=>DAT_I,
131
 sDAT_I=>Data2_aux,
132
 DAT_O=>DAT_O,
133
 sDAT_O=>Data1_aux,
134
 STB_I=>STB_I,
135
 WE_I=>WE_I,
136
 FFT_finish_in=>frame_ready_aux,
137
 FFT_enable=>FFT_enable_aux,
138
 enable_in=>enable_out_aux,
139
 clear_out=>clear_aux,
140
 clk=>CLK_I
141
 );
142
 
143
 end architecture;

powered by: WebSVN 2.1.0

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