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

Subversion Repositories wdsp

[/] [wdsp/] [trunk/] [rtl/] [vhdl/] [WISHBONE_IIR/] [WB_SOS.vhd] - Blame information for rev 11

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 5 parrado
library ieee;
2
--library work;
3
use ieee.std_logic_1164.all;
4
use ieee.numeric_std.all;
5
 
6
entity WB_SOS is
7
generic (Filter_Width:integer:=16;--Filter width signals of in/out
8
                        WB_Width:integer:=32;--WishBone width signal of in/out
9
                        Bit_Growth:integer:=8;
10
                        NSECT:integer:=6;--Cant of sections
11
                        M:integer:=16;--width word of coefs
12
                        Q:integer:=13;--Q--Quantifer
13
                        Adress_wordwidth:integer:=32 ;
14
                        Adr_bas:integer:=9;
15
                        Reg_control:integer:=0;
16
                        Reg_data:integer:=4;
17
                        Reg_status:integer:=8;
18
                        Reg_Nsec:integer:=12;
19
                        Reg_gain: integer:=16;
20
                        Reg_coef:integer:=20
21
 
22
                        --Reg_coef:integer:=20
23
                        --N_coef:integer:=42
24
 
25
                        );
26
 
27
port(
28
 
29
DAT_I: in std_logic_vector(WB_Width-1 downto 0);
30
DAT_O:out std_logic_vector(WB_Width-1 downto 0);
31
ADR_I :in std_logic_vector(Adress_wordwidth-1 downto 0);
32
STB_I,RST_I,CLK_I,WE_I: in std_logic;
33
ACK_O: out   std_logic;
34
clear:in std_logic
35
);
36
end entity;
37
 
38
architecture RTL of WB_SOS is
39
--Structure SOS
40
component SOS is
41
generic (WordWidth:integer;--width signal of in/out
42
                        Bit_growth:integer;
43
                        NSECT:integer;--Cant of sections
44
                        M:integer;--width word of coefs
45
                        Q:integer--Q--Quantifer
46
 
47
                        );
48
 
49
port(
50
 
51
signal_input :in std_logic_vector(WordWidth+Bit_growth-1 downto 0);
52
h0: in std_logic_vector((NSECT*M*6)-1 downto 0);
53
gain: in std_logic_vector(M-1 downto 0);
54
signal_output:out std_logic_vector(WordWidth+Bit_growth-1 downto 0);
55
en_out : in std_logic_vector(3 downto 0);
56
enable_out:out std_logic;
57
clk,reset,clear,enable:in std_logic
58
 
59
);  end component;
60
 
61
--
62
component interface_slave_iir is
63
generic(
64
 
65
Data_wordwidth: integer;
66
Adress_wordwidth: integer;
67
Adr_bas:integer;
68
Reg_control:integer;
69
Reg_data:integer;
70
Reg_status:integer;
71
Reg_coef:integer;
72
Reg_gain:integer;
73
Reg_Nsec:integer;
74
NSECT:integer;
75
--Offset_coef:integer;
76
M:integer
77
 
78
);
79
port(
80
 
81
 
82
 ACK_O: out   std_logic;--to MASTER
83
 ADR_I: in    std_logic_vector( Adress_wordwidth-1 downto 0 );
84
 DAT_I: in    std_logic_vector( Data_wordwidth-1 downto 0 );--from MASTER
85
 sDAT_I: in    std_logic_vector( Data_wordwidth-1 downto 0 );--from SLAVE
86
 DAT_O: out   std_logic_vector( Data_wordwidth-1 downto 0 );--to MASTER
87
 sDAT_O: out   std_logic_vector( Data_wordwidth-1 downto 0 );--to SLAVE
88
 en_out: out   std_logic_vector( 3 downto 0 );--to slave
89
 STB_I: in    std_logic;--from MASTER
90
 WE_I: in    std_logic;--from MASTER
91
 Start: out    std_logic;--to SLAVE     
92
 h0: out std_logic_vector( (NSECT*M*6)-1 downto 0 );--to SLAVE
93
 gain: out std_logic_vector(M-1 downto 0);
94
 enable_in: in std_logic;
95
 clear,reset,clk: in std_logic
96
 );
97
end component;
98
signal h0_aux:std_logic_vector((NSECT*M*6)-1 downto 0);
99
signal gain_aux:std_logic_vector(M-1 downto 0);
100
signal iir_data_in, iir_data_out:std_logic_vector(Filter_Width+Bit_Growth-1 downto 0);
101
signal en_out_aux:std_logic_vector(3 downto 0);
102
signal Start_aux, WE_O_aux,enable_aux:std_logic;
103 11 parrado
signal sext:std_logic_vector(WB_Width-Filter_Width-bit_growth-1 downto 0);
104 5 parrado
begin
105
sext<=(others=>iir_data_out(Filter_Width-1));
106
 
107
sos_1:SOS
108
generic map(WordWidth=>Filter_Width,--width signal of in/out
109
                        Bit_growth=>Bit_Growth,
110
                        NSECT=>NSECT,--Cant of sections
111
                        M=>M,--width word of coefs
112
                        Q=>Q--Quantifer
113
 
114
                        )
115
 
116
port map(
117
 
118
signal_input=>iir_data_in((Filter_Width+Bit_Growth)-1 downto 0),
119
--signal_input((WordWidth-(8*2))-1 downto 0)<=(others=>'0'),
120
h0=>h0_aux,
121
gain=>gain_aux,
122
signal_output=>iir_data_out,
123
en_out=>en_out_aux,
124
enable_out=>enable_aux,
125
clk=>CLK_I,
126
reset=>RST_I,
127
clear=>clear,
128
enable=>start_aux
129
 
130
);
131
 
132
inteface:interface_slave_iir
133
generic map(
134
 
135
Data_wordwidth=>WB_Width,
136
Adress_wordwidth=>Adress_wordwidth,
137
Adr_bas=>Adr_bas,
138
Reg_control=>Reg_control,
139
Reg_data=>Reg_data,
140
Reg_status=>Reg_status,
141
Reg_coef=>Reg_coef,
142
Reg_gain=>Reg_gain,
143
Reg_Nsec=>Reg_Nsec,
144
NSECT=>NSECT,
145
--Offset_coef=>Offset_coef,
146
M=>M
147
 
148
)
149
port map(
150
 
151
 
152
 ACK_O=>ACK_O,
153
 ADR_I=>ADR_I,
154
 DAT_I=>DAT_I,
155
 sDAT_I=>sext&iir_data_out,
156
 DAT_O=>DAT_O,
157
 sDAT_O((Filter_Width+Bit_Growth)-1 downto 0)=>iir_data_in,
158
 en_out=>en_out_aux,
159
 enable_in=>enable_aux,
160
 STB_I=>STB_I,
161
 WE_I=>WE_I,
162
 Start=>Start_aux,
163
 h0=>h0_aux,
164
 gain=>gain_aux,
165
 clear=>clear,
166
 reset=>RST_I,
167
 clk=>CLK_I
168
 );
169
 
170
 
171
end architecture;

powered by: WebSVN 2.1.0

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