OpenCores
URL https://opencores.org/ocsvn/bluespec-80211atransmitter/bluespec-80211atransmitter/trunk

Subversion Repositories bluespec-80211atransmitter

[/] [bluespec-80211atransmitter/] [trunk/] [IFFT.bsv] - Blame information for rev 3

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 ndave
// The MIT License
2
//
3
// Copyright (c) 2006 Nirav Dave (ndave@csail.mit.edu)
4
//
5
// Permission is hereby granted, free of charge, to any person obtaining a copy
6
// of this software and associated documentation files (the "Software"), to deal
7
// in the Software without restriction, including without limitation the rights
8
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
// copies of the Software, and to permit persons to whom the Software is
10
// furnished to do so, subject to the following conditions:
11
//
12
// The above copyright notice and this permission notice shall be included in
13
// all copies or substantial portions of the Software.
14
//
15
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
// THE SOFTWARE.
22
 
23
 
24
 
25
 
26
import ComplexF::*;
27
import DataTypes::*;
28
import Interfaces::*;
29
import IFFT_Library::*;
30
 
31
import Pipelines::*;
32
import FIFO::*;
33
import FIFOF::*;
34
import Vector::*;
35
 
36
 
37
(* synthesize *)
38
module  mkIFFT_Circ(IFFT#(64));
39
  let _x <- mkIFFT(mkPipeline_Circ(2'd3, 2'd1, stagefunction));
40
  return (_x);
41
endmodule
42
 
43
(* synthesize *)
44
module  mkIFFT_Pipe(IFFT#(64));
45
  let _x <- mkIFFT(mkPipeline_Sync(2'd3, 2'd1, stagefunction));
46
  return (_x);
47
endmodule
48
 
49
(* synthesize *)
50
module  mkIFFT_Comb(IFFT#(64));
51
  let _x <- mkIFFT(mkPipeline_Comb(2'd3, 2'd1, stagefunction));
52
  return (_x);
53
endmodule
54
 
55
(* synthesize *)
56
module  mkIFFT_Circ_w_1Radix(IFFT#(64));
57
  let _x <- mkIFFT(mkPipeline_Circ(6'd48, 6'd1, stagefunction2));
58
  return (_x);
59
endmodule
60
 
61
(* synthesize *)
62
module  mkIFFT_Circ_w_2Radix(IFFT#(64));
63
  let _x <- mkIFFT(mkPipeline_Circ(6'd48, 6'd2, stagefunction2));
64
  return (_x);
65
endmodule
66
 
67
(* synthesize *)
68
module  mkIFFT_Circ_w_4Radix(IFFT#(64));
69
  let _x <- mkIFFT(mkPipeline_Circ(6'd48, 6'd4, stagefunction2));
70
  return (_x);
71
endmodule
72
 
73
(* synthesize *)
74
module  mkIFFT_Circ_w_8Radix(IFFT#(64));
75
  let _x <- mkIFFT(mkPipeline_Circ(6'd48, 6'd8, stagefunction2));
76
  return (_x);
77
endmodule
78
 
79
 
80
module [Module] mkIFFT#(Module#(Pipeline#(IFFTData)) mkP)
81
              (IFFT#(64));
82
 
83
   Pipeline#(IFFTData) p <- mkP();
84
 
85
   method Action fromMapper(MsgComplexFVec#(64) x);
86
     IFFTData data = x.data;
87
     IFFTData reordered_data = newVector();
88
     for(Integer i = 0; i < 64; i = i + 1)
89
       begin
90
         // note swapped values
91
         reordered_data[i].i = data[63-reorder[i]].q;
92
         reordered_data[i].q = data[63-reorder[i]].i;
93
       end
94
     p.put(reordered_data);
95
   endmethod
96
 
97
   // output to cyclic extend queue method
98
 
99
   method ActionValue#(MsgComplexFVec#(64)) toCyclicExtender();
100
 
101
     IFFTData data <- p.get();
102
 
103
     IFFTData data_out = newVector();
104
     for(Integer i = 0; i < 64; i = i + 1)
105
       begin
106
         data_out[i].i = data[63-i].q;
107
         data_out[i].q = data[63-i].i;
108
       end
109
     return(MsgComplexFVec{
110
              new_message: True,
111
              data       : data_out
112
             });
113
   endmethod
114
 
115
 
116
 
117
 
118
 
119
endmodule

powered by: WebSVN 2.1.0

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