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

Subversion Repositories ofdm

[/] [ofdm/] [branches/] [avendor/] [vhdl/] [outconvert.vhd] - Blame information for rev 13

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 tmsiqueira
--      Package File Template
2
--
3
--      Purpose: This package defines supplemental types, subtypes, 
4
--               constants, and functions 
5
 
6
 
7
library IEEE;
8
use IEEE.STD_LOGIC_1164.all;
9
use IEEE.STD_LOGIC_ARITH.all;
10
use IEEE.std_logic_unsigned.all;
11
 
12
package outconverter is
13
 
14
   constant stage : natural := 3;
15
 
16
   constant FFTDELAY:integer:=13+2*STAGE;
17
   constant FACTORDELAY:integer:=6;
18
   constant OUTDELAY:integer:=9;
19
 
20
   function counter2addr(
21
                counter : std_logic_vector;
22
                mask1:std_logic_vector;
23
                mask2:std_logic_vector
24
        ) return std_logic_vector;
25
 
26
        function outcounter2addr(counter : std_logic_vector) return std_logic_vector;
27
end outconverter;
28
 
29
 
30
package body outconverter is
31
 
32
        function counter2addr(
33
                counter : std_logic_vector;
34
                mask1:std_logic_vector;
35
                mask2:std_logic_vector
36
        ) return std_logic_vector is
37
        variable result :std_logic_vector(counter'range);
38
        begin
39
                for n in mask1'range loop
40
                        if mask1(n)='1' then
41
                                result( 2*n+1 downto 2*n ):=counter( 1 downto 0 );
42
                        elsif mask2(n)='1' and n/=STAGE-1 then
43
                                result( 2*n+1 downto 2*n ):=counter( 2*n+3 downto 2*n+2 );
44
                        else
45
                                result( 2*n+1 downto 2*n ):=counter( 2*n+1 downto 2*n );
46
                        end if;
47
                end loop;
48
                return result;
49
        end counter2addr;
50
        function outcounter2addr(counter : std_logic_vector) return std_logic_vector is
51
           variable result      :std_logic_vector(counter'range);
52
        begin
53
                for n in 0 to STAGE-1 loop
54
                        result( 2*n+1 downto 2*n ):=counter( counter'high-2*n downto counter'high-2*n-1 );
55
                end loop;
56
                return result;
57
        end outcounter2addr;
58
 
59
end outconverter;

powered by: WebSVN 2.1.0

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