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

Subversion Repositories ofdm

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 4 tmsiqueira
library IEEE;
2
use IEEE.STD_LOGIC_1164.all;
3
use IEEE.STD_LOGIC_ARITH.all;
4
use IEEE.STD_LOGIC_SIGNED.all;
5
 
6
entity cfft_control is
7
  generic (
8
    Tx_nRx : natural := 0;              -- tx = 1, rx = 0
9
    stage  : natural := 3);
10
  port (
11
    clk       : in std_logic;
12
    rst       : in std_logic;
13
    mem_ready : in std_logic;
14
 
15
    sel_mux       : out std_logic;
16
    factorstart   : out std_logic;
17
    cfft4start    : out std_logic;
18
    inv           : out std_logic;
19
    Output_enable : out std_logic;
20
    bank0_busy    : out std_logic;
21
    bank1_busy    : out std_logic;
22
 
23
    mem_block : out std_logic;
24
 
25
    addrout_in   : out std_logic_vector(stage*2-Tx_nRx downto 0);
26
    wen_proc     : out std_logic;
27
    addrin_proc  : out std_logic_vector(stage*2-1 downto 0);
28
    addrout_proc : out std_logic_vector(stage*2-1 downto 0);
29
    wen_out      : out std_logic;
30
    addrin_out   : out std_logic_vector(stage*2-1 downto 0));
31
end cfft_control;
32
 
33
architecture cfft_control of cfft_control is
34
 
35
  component counter
36
    generic (
37
      stage : natural);
38
    port (
39
      clk       : in  std_logic;
40
      rst       : in  std_logic;
41
      mem_ready : in  std_logic;
42
      mem_bk    : out std_logic;
43
      count     : out std_logic_vector(2*stage+2 downto 0));
44
  end component;
45
 
46
  component ram_control
47
    generic (
48
      Tx_nRX : natural;
49
      stage  : natural);
50
    port (
51
      clk          : in  std_logic;
52
      rst          : in  std_logic;
53
      Gen_state    : in  std_logic_vector(2*stage+2 downto 0);
54
      mem_bk       : in  std_logic;
55
      addrout_in   : out std_logic_vector(stage*2-Tx_nRX downto 0);
56
      wen_proc     : out std_logic;
57
      addrin_proc  : out std_logic_vector(stage*2-1 downto 0);
58
      addrout_proc : out std_logic_vector(stage*2-1 downto 0);
59
      wen_out      : out std_logic;
60
      addrin_out   : out std_logic_vector(stage*2-1 downto 0));
61
  end component;
62
 
63
  component mux_control
64
    generic (
65
      stage : natural);
66
    port (
67
      clk       : in  std_logic;
68
      rst       : in  std_logic;
69
      Gen_state : in  std_logic_vector(8 downto 0);
70
      sel_mux   : out std_logic);
71
  end component;
72
 
73
  component starts
74
    generic (
75
      stage : natural);
76
    port (
77
      clk         : in  std_logic;
78
      rst         : in  std_logic;
79
      Gen_state   : in  std_logic_vector(2*stage+2 downto 0);
80
      factorstart : out std_logic;
81
      cfft4start  : out std_logic);
82
  end component;
83
 
84
  component inv_control
85
    generic (
86
      stage : natural);
87
    port (
88
      clk       : in  std_logic;
89
      rst       : in  std_logic;
90
      Gen_state : in  std_logic_vector(2*stage+2 downto 0);
91
      inv       : out std_logic);
92
  end component;
93
 
94
  component io_control
95
    generic (
96
      stage : natural);
97
    port (
98
      clk           : in  std_logic;
99
      rst           : in  std_logic;
100
      mem_bk        : in  std_logic;
101
      Gen_state     : in  std_logic_vector(2*stage+2 downto 0);
102
      bank0_busy    : out std_logic;
103
      bank1_busy    : out std_logic;
104
      Output_enable : out std_logic);
105
  end component;
106
 
107
  signal count  : std_logic_vector(2*stage+2 downto 0);
108
  signal mem_bk : std_logic;
109
begin
110
 
111
  mem_block <= mem_bk;
112
 
113
  counter_1 : counter
114
    generic map (
115
      stage => stage)
116
    port map (
117
      clk       => clk,
118
      rst       => rst,
119
      mem_ready => mem_ready,
120
      mem_bk    => mem_bk,
121
      count     => count);
122
 
123
  ram_control_1 : ram_control
124
    generic map (
125
      Tx_nRX => Tx_nRX,
126
      stage  => stage)
127
    port map (
128
      clk          => clk,
129
      rst          => rst,
130
      Gen_state    => count,
131
      mem_bk       => mem_bk,
132
      addrout_in   => addrout_in,
133
      wen_proc     => wen_proc,
134
      addrin_proc  => addrin_proc,
135
      addrout_proc => addrout_proc,
136
      wen_out      => wen_out,
137
      addrin_out   => addrin_out);
138
 
139
  mux_control_1 : mux_control
140
    generic map (
141
      stage => stage)
142
    port map (
143
      clk       => clk,
144
      rst       => rst,
145
      Gen_state => count,
146
      sel_mux   => sel_mux);
147
 
148
  starts_1 : starts
149
    generic map (
150
      stage => stage)
151
    port map (
152
      clk         => clk,
153
      rst         => rst,
154
      Gen_state   => count,
155
      factorstart => factorstart,
156
      cfft4start  => cfft4start);
157
 
158
  TX_inv : if Tx_nRx = 1 generate
159
    inv_control_1 : inv_control
160
      generic map (
161
        stage => stage)
162
      port map (
163
        clk       => clk,
164
        rst       => rst,
165
        Gen_state => count,
166
        inv       => inv);
167
  end generate;
168
 
169
  io_control_1 : io_control
170
    generic map (
171
      stage => stage)
172
    port map (
173
      clk           => clk,
174
      rst           => rst,
175
      mem_bk        => mem_bk,
176
      Gen_state     => count,
177
      bank0_busy    => bank0_busy,
178
      bank1_busy    => bank1_busy,
179
      Output_enable => Output_enable);
180
 
181
end cfft_control;

powered by: WebSVN 2.1.0

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