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

Subversion Repositories mdct

[/] [mdct/] [trunk/] [source/] [testbench/] [MDCT_TB.VHD] - Blame information for rev 27

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

Line No. Rev Author Line
1 2 mikel262
--------------------------------------------------------------------------------
2
--                                                                            --
3
--                          V H D L    F I L E                                --
4
--                          COPYRIGHT (C) 2006                                --
5
--                                                                            --
6
--------------------------------------------------------------------------------
7
--
8
-- Title       : MDCT_TB
9
-- Design      : MDCT Core
10
-- Author      : Michal Krepa
11
--
12
--------------------------------------------------------------------------------
13
--
14
-- File        : MDCT_TB.VHD
15
-- Created     : Sat Mar 5 2006
16
--
17
--------------------------------------------------------------------------------
18
--
19
--  Description : Testbench top-level
20
--
21
--------------------------------------------------------------------------------
22
 
23
library IEEE;
24
  use IEEE.STD_LOGIC_1164.all;
25
library WORK;
26
  use WORK.MDCT_PKG.all;
27
 
28
entity TB_MDCT is
29
end TB_MDCT;
30
 
31
--**************************************************************************--
32
 
33
architecture TB of TB_MDCT is
34
 
35
------------------------------
36
-- MDCT
37
------------------------------
38
component MDCT
39
        port(
40
                clk          : in STD_LOGIC;
41
                rst          : in std_logic;
42
    dcti         : in std_logic_vector(IP_W-1 downto 0);
43
    idv          : in STD_LOGIC;
44
 
45
    odv          : out STD_LOGIC;
46
                dcto         : out std_logic_vector(COE_W-1 downto 0);
47
      -- debug
48
    odv1         : out STD_LOGIC;
49
    dcto1        : out std_logic_vector(OP_W-1 downto 0)
50
                );
51
end component;
52
 
53
------------------------------
54
-- Clock generator
55
------------------------------
56
component CLKGEN
57
  port (
58
        clk               : out STD_LOGIC
59
       );
60
end component;
61
 
62
------------------------------
63
-- Input image generator
64
------------------------------
65 18 mikel262
component INPIMAGE
66 2 mikel262
  port (
67
        clk               : in STD_LOGIC;
68
        odv1              : in STD_LOGIC;
69
        dcto1             : in STD_LOGIC_VECTOR(OP_W-1 downto 0);
70
        odv               : in STD_LOGIC;
71
        dcto              : in STD_LOGIC_VECTOR(COE_W-1 downto 0);
72
 
73
        rst               : out STD_LOGIC;
74
        imageo            : out STD_LOGIC_VECTOR(IP_W-1 downto 0);
75
        dv                : out STD_LOGIC;
76
        testend           : out BOOLEAN
77
       );
78
end component;
79
 
80
signal clk_s               : STD_LOGIC;
81
signal clk_gen_s           : STD_LOGIC;
82
signal gate_clk_s          : STD_LOGIC;
83
signal rst_s               : STD_LOGIC;
84
signal dcti_s              : STD_LOGIC_VECTOR(IP_W-1 downto 0);
85
signal idv_s               : STD_LOGIC;
86
 
87
signal odv_s               : STD_LOGIC;
88
signal dcto_s              : STD_LOGIC_VECTOR(COE_W-1 downto 0);
89
signal odv1_s              : STD_LOGIC;
90
signal dcto1_s             : STD_LOGIC_VECTOR(OP_W-1 downto 0);
91
signal testend_s           : BOOLEAN;
92
 
93
------------------------------
94
-- architecture begin
95
------------------------------
96
begin
97
------------------------------
98
-- MDCT port map
99
------------------------------
100
U_MDCT : MDCT
101
  port map(
102
                  clk          => clk_s,
103
                  rst          => rst_s,
104
      dcti         => dcti_s,
105
      idv          => idv_s,
106 16 mikel262
 
107 2 mikel262
      odv          => odv_s,
108
      dcto         => dcto_s,
109
      odv1         => odv1_s,
110
      dcto1        => dcto1_s
111
                );
112
 
113
 
114
------------------------------
115
-- CLKGEN map
116
------------------------------
117
U_CLKGEN : CLKGEN
118
  port map (
119
        clk        => clk_gen_s
120
       );
121
 
122
 
123
 
124
------------------------------
125
-- Input image generator
126
------------------------------
127
U_INPIMAGE : INPIMAGE
128
  port map (
129
        clk       => clk_s,
130
        odv1      => odv1_s,
131
        dcto1     => dcto1_s,
132
        odv       => odv_s,
133
        dcto      => dcto_s,
134
 
135
        rst       => rst_s,
136
        imageo    => dcti_s,
137
        dv        => idv_s,
138
        testend   => testend_s
139
       );
140
 
141
gate_clk_s <= '0' when testend_s = false else '1';
142
 
143
clk_s <= clk_gen_s and (not gate_clk_s);
144
 
145
end TB;
146
-----------------------------------
147
 
148
------------------------------
149
-- configuration begin
150
------------------------------
151
configuration CONF_MDCT of TB_MDCT is
152
  for TB
153
 
154
    for U_MDCT : MDCT
155
      use entity WORK.MDCT(RTL);
156
    end for;
157
 
158
    for U_INPIMAGE : INPIMAGE
159
      use entity WORK.INPIMAGE(SIM);
160
    end for;
161
 
162
    for U_CLKGEN : CLKGEN
163
      use entity WORK.CLKGEN(SIM);
164
    end for;
165
 
166
  end for;
167
end CONF_MDCT;
168
 
169
configuration CONF_MDCT_TIMING of TB_MDCT is
170
  for TB
171
 
172
    for U_MDCT : MDCT
173
      use entity WORK.MDCT(STRUCTURE);
174
    end for;
175
 
176
    for U_INPIMAGE : INPIMAGE
177
      use entity WORK.INPIMAGE(SIM);
178
    end for;
179
 
180
    for U_CLKGEN : CLKGEN
181
      use entity WORK.CLKGEN(SIM);
182
    end for;
183
 
184
  end for;
185
end CONF_MDCT_TIMING;
186
--**************************************************************************--

powered by: WebSVN 2.1.0

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