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

Subversion Repositories cfft

[/] [cfft/] [trunk/] [src/] [sc_corproc.vhd] - Blame information for rev 14

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 sradio
--
2
-- This file is come from www.opencores.org
3
--                                                                                 
4
-- It has been modified by ZHAO Ming for 20 bit complex rotation
5
--
6
 
7
---------------------------------------------------------------------------------------------------
8
--
9
-- Title       : sc_corproc
10
-- Design      : cfft
11
-- Author      : ZHAO Ming
12
-- email           : sradio@opencores.org
13
--
14
---------------------------------------------------------------------------------------------------
15
--
16
-- File        : sc_corproc.vhd
17
-- Generated   : Tue Jul 16 10:39:17 2002
18
--
19
---------------------------------------------------------------------------------------------------
20
--
21
-- Description : complex rotation
22
--
23
---------------------------------------------------------------------------------------------------
24
--
25
-- Revisions       :    0
26
-- Revision Number :    1
27
-- Version         :    1.1.0
28
-- Date            :    Oct 17 2002
29
-- Modifier        :    ZHAO Ming 
30
-- Desccription    :    Data width configurable 
31
--
32
---------------------------------------------------------------------------------------------------
33
--
34
-- Revisions       :    0
35
-- Revision Number :    2
36
-- Version         :    1.2.0
37
-- Date            :    Oct 18 2002
38
-- Modifier        :    ZHAO Ming 
39
-- Desccription    :    Data width configurable 
40
--
41
---------------------------------------------------------------------------------------------------
42
 
43
 
44
library ieee;
45
use ieee.std_logic_1164.all;
46
use ieee.std_logic_arith.all;
47
use ieee.std_logic_signed.all;
48
 
49
entity sc_corproc is
50
        generic (
51
                WIDTH : Natural;
52
                STAGE : Natural
53
        );
54
        port(
55
                clk     : in std_logic;
56
                ena     : in std_logic;
57
                Xin     : in signed(WIDTH+1 downto 0);
58
                Yin     : in signed(WIDTH+1 downto 0);
59
                Ain : in signed(2*STAGE-3 downto 0 );
60
 
61
                sin     : out signed(WIDTH+3 downto 0);
62
                cos     : out signed(WIDTH+3 downto 0)
63
        );
64
end entity sc_corproc;
65
 
66
architecture dataflow of sc_corproc is
67
        constant PipeLength : natural := 2*STAGE+2;
68
 
69
        component p2r_cordic is
70
        generic(
71
                PIPELINE : integer := 15;
72
                WIDTH    : integer := 16);
73
        port(
74
                clk : in std_logic;
75
                ena : in std_logic;
76
 
77
                Xi : in signed(WIDTH -1 downto 0);
78
                Yi : in signed(WIDTH -1 downto 0) := (others => '0');
79
                Zi : in signed(19 downto 0);
80
 
81
                Xo : out signed(WIDTH -1 downto 0);
82
                Yo : out signed(WIDTH -1 downto 0)
83
        );
84
        end component p2r_cordic;
85
signal phase:signed( 19 downto 0 );
86
signal Xi,Yi:signed( WIDTH+7 downto 0 );
87
signal Xo,Yo:signed( WIDTH+7 downto 0 );
88
signal zeros:signed( 19-STAGE*2 downto 0 );
89
begin
90
                Xi<= Xin(WIDTH+1)&Xin&"00000";
91
                Yi<= Yin(WIDTH+1)&Yin&"00000";
92
                zeros<=(others=>'0');
93
                phase<="00"&Ain&zeros;
94
                cos<=Xo(WIDTH+7)&Xo( WIDTH+7 downto 5 );
95
                sin<=Yo(WIDTH+7)&Yo( WIDTH+7 downto 5 );
96
 
97
        u1:     p2r_cordic
98
                        generic map(PIPELINE => PipeLength, WIDTH => WIDTH+8)
99
                        port map(clk => clk, ena => ena, Xi => Xi, Yi=>Yi,Zi => phase, Xo => Xo, Yo => Yo);
100
end architecture dataflow;

powered by: WebSVN 2.1.0

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