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

Subversion Repositories adaptive_lms_equalizer

[/] [adaptive_lms_equalizer/] [tags/] [V10/] [code/] [filt_test_system.vhd] - Blame information for rev 5

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

Line No. Rev Author Line
1 2 digish
--  Copyright (C) 2004-2005 Digish Pandya <digish.pandya@gmail.com>
2
 
3
--  This program is free software; you can redistribute it and/or modify
4
--  it under the terms of the GNU General Public License as published by
5
--  the Free Software Foundation; either version 2 of the License, or
6
--  (at your option) any later version.
7
--
8
--  This program is distributed in the hope that it will be useful,
9
--  but WITHOUT ANY WARRANTY; without even the implied warranty of
10
--  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
--  GNU General Public License for more details.
12
--
13
--  You should have received a copy of the GNU General Public License
14
--  along with this program; if not, write to the Free Software
15
--  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
16
 
17
-- This File is Testing System For Equalizer
18
-- It Includes DATA generator Equalizer core and Error Display unit
19
 
20
-- File:        Filt_test_system.vhd  
21
-- Developer: Digish K. Pandya
22
-- Test bench file test_filt_test_sys.vhd
23
 
24
-- Main Testing system for LMS adaptive filter
25
-- Synthesised and tested on SPARTAN II xc2s100-6qt144
26
 
27
--Libraries from vendor
28
library IEEE;
29
use IEEE.STD_LOGIC_1164.ALL;
30
use IEEE.STD_LOGIC_ARITH.ALL;
31
use IEEE.STD_LOGIC_SIGNED.ALL;
32
 
33
-- Pin Definations
34
entity filt_test_system is
35
    Port ( clock : in std_logic;
36
           error_led_out : out std_logic_vector(7 downto 0);
37
                 seg_select:out std_logic_vector(3 downto 0);
38
           error_freq_out : out std_logic;
39
           filt_data_out : out std_logic_vector(7 downto 0);
40
           reset : in std_logic;
41
           reset_clk : in std_logic;
42
           adaption_enable : in std_logic);
43
end filt_test_system;
44
 
45
-- Architecture body
46
 
47
architecture test_chip of filt_test_system is
48
 
49
    -- Component Declarations
50
 
51
    -- 1 LMS filter Transpose form Architecture                         
52
    component tf_lms
53
            Port (
54
                         xin : in std_logic_vector(7 downto 0);    -- data input
55
                         dxin : in std_logic_vector(7 downto 0);  -- desired response input
56
                   clock : in std_logic;                                  -- clock
57
                         adapt_en: in std_logic;                                  -- enable adaption
58
 
59
                         err:out std_logic_vector(7 downto 0);     -- error output
60
                   yout : out std_logic_vector(7 downto 0)  -- output data               
61
                     );
62
    end component ;
63
 
64
    -- 2 Data generator system 
65
    component data_gen
66
             Port (
67
                         clock : in std_logic;
68
                   reset : in std_logic;
69
 
70
                   xout : out std_logic_vector(7 downto 0);
71
                   dxout : out std_logic_vector(7 downto 0)
72
                        );
73
        end component ;
74
 
75
        -- 3 Clock devider 
76
        -- Provides two clocks for different purpose
77
        component clock_div
78
                    Port ( reset: in std_logic;
79
                                 in_clk : in std_logic;
80
 
81
                           out1 : out std_logic;  -- fast
82
                           out2 : out std_logic); -- slow
83
        end component;
84
 
85
        -- 4 Displays MSE on seven segment diplay
86
        component Display_MSE
87
                    Port ( reset: in std_logic;
88
                                 error_in : in std_logic_vector(7 downto 0);
89
                           clock : in std_logic;
90
 
91
                                 an_out: out std_logic;
92
                           seg_select_out : out std_logic_vector(3 downto 0);
93
                           seg_dis_out : out std_logic_vector(7 downto 0));
94
        end component;
95
 
96
     -- global clock buffer primary (for input pin)
97
        -- [Not able to display linkage but available in RTL]
98
        component BUFGP
99
         port (I: in std_logic; O: out std_logic);
100
     end component;
101
        -- clock buffer Secondary (for internal logic)
102
        -- [Not able to display linkage but available in RTL]
103
        component BUFGS
104
                port (I: in STD_LOGIC;O: out STD_LOGIC);
105
        end component;
106
 
107
 
108
        -- Local Interconnects 
109
        signal xout_tmp: std_logic_vector( 7 downto 0);
110
        signal dxout_tmp: std_logic_vector( 7 downto 0);
111
        signal clock_fast,clock_slow: std_logic;
112
        signal error_dis_in : std_logic_vector(7 downto 0);
113
        signal CLK_SIG,clock_f,clock_s:  std_logic;
114
 
115
begin
116
        -- Clock Input through buffer
117
        U1:  BUFGP port map (I => clock, O => CLK_SIG);
118
 
119
        -- Test DATA generator
120
        data_gen1: data_gen
121
                port map(
122
 
123
                                clock => clock_slow,
124
                          reset => reset,
125
                          xout => xout_tmp,
126
                          dxout => dxout_tmp
127
                            );
128
 
129
        -- LMS core UNDER test
130
    lms:        tf_lms
131
            Port map(
132
                                 xin => xout_tmp,
133
                                 dxin => dxout_tmp,
134
                           clock => clock_slow,
135
                                 err => error_dis_in,
136
                           yout => filt_data_out,
137
                                 adapt_en => adaption_enable
138
                          );
139
 
140
 
141
     -- Fast clock used to avoide flicker
142
        err_display:display_mse
143
                port map(
144
                                 reset => reset,
145
                                 error_in => error_dis_in,
146
                           clock => clock_fast,
147
 
148
                                 an_out => error_freq_out,
149
                           seg_select_out => seg_select,
150
                           seg_dis_out => error_led_out
151
 
152
                                );
153
 
154
 
155
        -- Clock Devider
156
        cd: clock_div
157
                port map(
158
                                reset => reset_clk,
159
                                in_clk => clk_sig,
160
                                out1 => clock_f,
161
                                out2 => clock_s
162
                                );
163
 
164
        -- Fast clock for Seven Segment Display refresh
165
        U2:  BUFGS port map (I => clock_f, O => clock_fast);
166
 
167
        -- Slow clock for Filtering (SO we can see changes in on Sevensegment)
168
        -- In actual application we have to keep maximum possible clock here
169
        U3:  BUFGS port map (I => clock_s, O => clock_slow);
170
 
171
 
172
end test_chip;
173
-- The End --

powered by: WebSVN 2.1.0

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