1 |
2 |
madsilicon |
-----------------------------------------------------------------
|
2 |
|
|
-- --
|
3 |
|
|
-----------------------------------------------------------------
|
4 |
|
|
-- --
|
5 |
|
|
-- Copyright (C) 2013 Stefano Tonello --
|
6 |
|
|
-- --
|
7 |
|
|
-- This source file may be used and distributed without --
|
8 |
|
|
-- restriction provided that this copyright statement is not --
|
9 |
|
|
-- removed from the file and that any derivative work contains --
|
10 |
|
|
-- the original copyright notice and the associated disclaimer.--
|
11 |
|
|
-- --
|
12 |
|
|
-- THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY --
|
13 |
|
|
-- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED --
|
14 |
|
|
-- TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS --
|
15 |
|
|
-- FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL THE AUTHOR --
|
16 |
|
|
-- OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, --
|
17 |
|
|
-- INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES --
|
18 |
|
|
-- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE --
|
19 |
|
|
-- GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR --
|
20 |
|
|
-- BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
|
21 |
|
|
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
|
22 |
|
|
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT --
|
23 |
|
|
-- OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE --
|
24 |
|
|
-- POSSIBILITY OF SUCH DAMAGE. --
|
25 |
|
|
-- --
|
26 |
|
|
-----------------------------------------------------------------
|
27 |
|
|
|
28 |
|
|
---------------------------------------------------------------
|
29 |
|
|
-- G.729a Codec self-test module test-bench
|
30 |
|
|
---------------------------------------------------------------
|
31 |
|
|
|
32 |
|
|
---------------------------------------------------------------
|
33 |
|
|
-- Notes:
|
34 |
|
|
---------------------------------------------------------------
|
35 |
|
|
|
36 |
|
|
library IEEE;
|
37 |
|
|
use IEEE.std_logic_1164.all;
|
38 |
|
|
use IEEE.numeric_std.all;
|
39 |
|
|
use STD.textio.all;
|
40 |
|
|
|
41 |
|
|
library work;
|
42 |
|
|
--use work.G729A_ASIP_PKG.all;
|
43 |
|
|
--use WORK.G729A_ASIP_BASIC_PKG.all;
|
44 |
|
|
--use WORK.G729A_ASIP_ARITH_PKG.all;
|
45 |
|
|
--use WORK.G729A_ASIP_OP_PKG.all;
|
46 |
|
|
--use work.G729A_ASIP_CFG_PKG.all;
|
47 |
|
|
--use work.G729A_STRING_PKG.all;
|
48 |
|
|
--use work.G729A_CODEC_INTF_PKG.all;
|
49 |
|
|
--use work.G729A_CODEC_TEST_PKG.all;
|
50 |
|
|
--use work.G729A_SITE_PKG.all;
|
51 |
|
|
|
52 |
|
|
entity G729A_CODEC_SELFTEST_TB is
|
53 |
|
|
end G729A_CODEC_SELFTEST_TB;
|
54 |
|
|
|
55 |
|
|
architecture ARC of G729A_CODEC_SELFTEST_TB is
|
56 |
|
|
|
57 |
|
|
component G729A_CODEC_SELFTEST is
|
58 |
|
|
port(
|
59 |
|
|
CLK_i : in std_logic; -- clock
|
60 |
|
|
RST_i : in std_logic; -- reset
|
61 |
|
|
|
62 |
|
|
DONE_o : out std_logic; -- test complete
|
63 |
|
|
PASS_o : out std_logic -- test pass
|
64 |
|
|
);
|
65 |
|
|
end component;
|
66 |
|
|
|
67 |
|
|
signal CLK : std_logic := '0';
|
68 |
|
|
signal RST : std_logic := '1';
|
69 |
|
|
|
70 |
|
|
signal DONE : std_logic;
|
71 |
|
|
signal PASS : std_logic;
|
72 |
|
|
|
73 |
|
|
begin
|
74 |
|
|
|
75 |
|
|
---------------------------------------------------
|
76 |
|
|
-- Clock & Reset signals
|
77 |
|
|
---------------------------------------------------
|
78 |
|
|
|
79 |
|
|
CLK <= not(CLK) after 10 ns;
|
80 |
|
|
|
81 |
|
|
RST <= '0' after 20 ns;
|
82 |
|
|
|
83 |
|
|
---------------------------------------------------
|
84 |
|
|
-- Self-test module instance
|
85 |
|
|
---------------------------------------------------
|
86 |
|
|
|
87 |
|
|
U_DUT : G729A_CODEC_SELFTEST
|
88 |
|
|
port map(
|
89 |
|
|
CLK_i => CLK,
|
90 |
|
|
RST_i => RST,
|
91 |
|
|
|
92 |
|
|
DONE_o => DONE,
|
93 |
|
|
PASS_o => PASS
|
94 |
|
|
);
|
95 |
|
|
|
96 |
|
|
end ARC;
|