信号与信息综合处理
实 验 报 告
学院:信息与通信工程学院
班级:
姓名:
学号:
实验二 用FPGA实现FFT
1.实验目的
1)掌握Xilinx ISE中IP Core的使用方法;
2)初步掌握Xilinx 公司的FFT IPCore的使用方法;
3)比较DSP和FPGA实现FFT的异同。
2.实验内容
1)按实验指导书所给出的步骤,用Xilinx IP Core实现256点的FFT并进行仿真和测试;
2)将所给出的例子改写为512点的IFFT并进行仿真和测试;
3)将FFT点数改为1024,重新进行仿真和测试;
4)将FFT IP core改为Radix-4 Burst I/O架构,重新完成仿真和测试。
3.实验原理
3.1. Xilinx FFT IP core使用说明
在Xilinx公司的IPCore中,提供两不同的架构:Burst I/O架构和Streaming I/O流水线架构。所谓的Burst I/O是指数据的输入和输出都是突发的,即输入输出是一段一段的而不是连续的;所谓的Streaming I/O流水线架构则是指输入数据和输出数据都是以一定的频率连续不断地进行的。Burst I/O 架构下,采用的是时间抽取(DIT)方法,而在Streaming I/O流水线架构下采用的是频率抽取(DIF)方法。当采用基4分解时,N点FFT共需log4 (N) 级,每一级包含N/4个基4的蝶形图,如果点数N不是4的幂次,则还需要另外一个基2的级。如果采用基2的分解,则共有log2 (N)级,每一级包含N/2个基2蝶形。IFFT通过将对应的FFT的相位因子取共轭实现。
本实验以Streaming I/O流水线架构为例学习Xilinx FFT IPcore的使用方法。Streaming I/O流水线架构示意图如下图所示。这种架构将多个基2的蝶形处理单元排成流水线形式以提供连续的数据处理,每个处理单元有它自己的存储单元用于存储输入和中间数据。数据数据可以连续输入到流水线的前级,经过一段计算时延,从输出端连续输出一个数据块的数据。当然,这种架构也允许在数据块之间添加一段时间的间隔。
在scaled fixed-point模式下,数据在每进行一对基2级之后都会进行一次移位,移位次数可以事先根据输入数据范围确定。除了这种模式外,IP core还提供一种块浮点模式用于改善性能。输出数据可以以比特逆序输出,也可以自然序输出,当采用自然序输出时,需要用到额外的存储资源。
与streaming I/O架构不同,Burst I/O以一组蝶形计算单元完成所有运算,其中基4的Burst I/O架构示意图如下图所示。在这种架构下,输入数据分为4块存储到RAM中,每计算一次蝶形运算,计算结果仍然存储到这4块RAM中,直至最后输出。在这种架构下,数据不能连续输入,整个IPcore的工作状态分为数据输入、处理和输出等不同的状态。显然,这种架构占用资源量明显少于Streaming I/O结构,但是处理数据的吞吐量有限。
在不同的配置下,IPcore对外的接口有一些差别,下面仅对在本实验中将要用到的部分端口的功能做以下说明:
| 端口名 | 位宽 | 方向 | 描述 |
| Xn_re | 可配 | 输入 | 输入数据实部,与xn_index对应 |
| Xn_im | 可配 | 输入 | 输入数据虚部 |
| start | 1 | 输入 | 启动控制信号,拉高则FFT开始加载数据,可一直置高,此时由IP core的状态控制加载 |
| Fwd_inv | 1 | 输入 | 1表示FFT,0表示IFFT |
| Scale_sch | 在不同模式下位宽不同,在Streaming I/O模式下, | 输入 | 各级移位次数 |
| Sclr | 1 | 输入 | 同步复位信号 |
| Clk | 1 | 输入 | 工作时钟 |
| Xk_re | 可配,scaled模式下同Xn_re | 输入 | 输入数据实部,与xn_index对应 |
| Xk_im | 同上 | 输入 | 输入数据虚部 |
| Xn_index | 与点数有关 | 输出 | Xn所对应的序号 |
| Xk_index | 与点数有关 | 输出 | Xk所对应的序号 |
| RFD | 1 | 输出 | 加载数据阶段为高 |
| Dv | 1 | 输出 | 输出数据时为高 |
4.1.256点FFT变换
1)新建工程;
2)新建FFT IPcore。命名为fft256,在IP列表中选择Digital signal-processing -> transforms ->FFTs,选择7.1版本,点击Next,然后点击finish;
3)在按以下截图下设置参数,然后点击下一步;
4)在第2个页面上按下图设置,其含义分别为:定点格式;输入数据位宽16比特,相位因子16比特、Scaling选项选择scaled,截取模式选择truncation、添加同步复位sclr控制管脚、输出自然顺序,输入数据时序3 clock cycle offset选项。点击Next,进入第3页面
5)第3页面上,选择Number of Stages using block ram为3,点击Generate生成IPcore;
6)新建block RAM IPcore,取名为imput_rom_I;
7)在第2页面上选择单口ROM,其他选项保持不变;
8)第3页面设置如下图,注意选择use ENA pin选项;
9)第4页面上,选择下图中所示的两个寄存器选项;
10)选择压缩包中的input_I.coe作为该ROM的初始化文件;其他选项保持默认值,点击Generate;
11)再按照上述步骤生成一个ROM,选择压缩包中的input_Q.coe文件作为初始化文件;
12)将压缩包中的fft_top.v,fft_ctrl.v添加到工程中;
13)为fft_top.v编写测试文件,可参阅压缩包中的test_fft.v,注意理解程序中文件输出部分的功能;
14)对该设计进行功能仿真,记录仿真波形,并分析Streaming I/O架构下256点FFT的计算时延;
15)使用Chipcope对该设计进行在板测试,观察xn_index、xn_im、xn_re、xk_im、xk_re、xk_index的相对时序关系,触发条件可以xk_index、out_block_index或rd_block_index、xn_index取某一具体数值开始触发采数操作;
16)去掉cdc文件,在布局布线报告中找到Device Utilization Summary部分,观察FFT部分的资源占用情况;
17)比较DSP实现FFT与FPGA实现FFT的异同。
4.2.1024点FFT变换
将上述点数设置改为1024点,其余相同,重新完成上述流程。
4.3.Burst I/O架构下1024点FFT变换
将FFT IPcore改为Radix-4 Burst I/O架构,重新完成上述过程(注意,此时需要uload信号,直接在ctrl模块里置1即可),并对streaming I/O方式的时延、吞吐量以及资源占用情况进行比较。
5.关键代码
5.1.Streaming架构下256点FFT
input rst1,
output rfd,
output dv,
output [15:0] output_re,
output [15:0]output_im,
output [1:0] out_block_index
);
wire rst;
assign rst = ~rst1;
wire start;//FFT 开始信号高有效: START 为高表示开始加载数据并计算变换(Burst I/O architectures).
wire fwd_inv;//FFT/IFFT指示信号 1:FFT, 0:IFFT
wire done;//完成指示,只有一个cycle宽度的高电平,表示处理完成
wire busy;//忙指示,该信号为高表示FFT变换计算完毕
wire scale_sch_we;// SCALE_SCH 写使能
wire fwd_inv_we;//fwd_inv写使能
wire edone;//将完成,在done之前一个周期给出高电平
wire [31 : 0] xn;//输入数据,高位为实部
wire [7 : 0] xn_index;//xn序号
wire [7 : 0] scale_sch;//各个stage的定标调整值
wire [31 : 0] xk;//输出数据,高位为实部
wire [7 : 0] xk_index;//输出数据序号
wire rd_en;//从ROM中读取数据的使能信号
wire wr_en;//往RAM里写数据的使能信号
wire [9:0] rd_addr;//ROM中读取数据的地址信号
wire sclr;//FFT核同步复位信号
wire [1:0] rd_block_index; //ROM中存4个块,表示块序号
assign fwd_inv_we = 1'b0; //不允许修改FFT和IFFT指示
assign scale_sch_we = 1'b0;//不允许修改scale_sch
assign fwd_inv = 1'b1; //FFT
assign scale_sch = 8'b10_10_10_10;
assign rd_addr = {rd_block_index, xn_index};
assign output_re = xk[31:16];
assign output_im = xk[15:0];
//fft控制
fft_ctrl ctrl_inst(
.clk(clk),
.reset(rst),
.rd_en(rd_en),
.wr_en(wr_en),
.done(done),
.edone(edone),
.rd_block_index(rd_block_index),
.out_block_index(out_block_index),
.start(start),
.rfd(rfd),
.dv(dv),
.sclr(sclr),
.xn_index(xn_index),
.xk_index(xk_index)
);
fft256 fft_inst(
.rfd(rfd),
.start(start),
.fwd_inv(fwd_inv),
.dv(dv),
.done(done),
.clk(clk),
.busy(busy),
.scale_sch_we(scale_sch_we),
.fwd_inv_we(fwd_inv_we),
.edone(edone),
.xn_re(xn[31:16]),
.xn_im(xn[15:0]),
.xn_index(xn_index),
.scale_sch(scale_sch),
.xk_re(xk[31:16]),
.xk_im(xk[15:0]),
.xk_index(xk_index),
.sclr(sclr)
);
input_rom_I rom_inst_I(
.clka(clk),
.ena(rd_en),
.addra(rd_addr),
.douta(xn[31:16])
);
input_rom_Q rom_inst_Q(
.clka(clk),
.ena(rd_en),
.addra(rd_addr),
.douta(xn[15:0])
);
Endmodule
5.2.Streaming架构下1024点FFT
timescale 1ns / 1ps
module fft_top(
input clk,
input rst1,
output dv,
output rfd,
output [15:0] output_re,
output [15:0]output_im,
output [2:0] out_block_index
);
wire rst;
assign rst = ~rst1;
wire start;//FFT 开始信号高有效: START 为高表示开始加载数据并计算变换(Burst I/O architectures).
wire fwd_inv;//FFT/IFFT指示信号 1:FFT, 0:IFFT
wire done;//完成指示,只有一个cycle宽度的高电平,表示处理完成
wire busy;//忙指示,该信号为高表示FFT变换计算完毕
wire scale_sch_we;// SCALE_SCH 写使能
wire fwd_inv_we;//fwd_inv写使能
wire edone;//将完成,在done之前一个周期给出高电平
wire [31 : 0] xn;//输入数据,高位为实部
wire [9 : 0] xn_index;//xn序号
wire [9 : 0] scale_sch;//各个stage的定标调整值
wire [31 : 0] xk;//输出数据,高位为实部
wire [9 : 0] xk_index;//输出数据序号
wire rd_en;//从ROM中读取数据的使能信号
wire wr_en;//往RAM里写数据的使能信号
wire [9:0] rd_addr;//ROM中读取数据的地址信号
wire sclr;//FFT核同步复位信号
wire [2:0] rd_block_index; //ROM中存4个块,表示块序号
assign fwd_inv_we = 1'b0; //不允许修改FFT和IFFT指示
assign scale_sch_we = 1'b0;//不允许修改scale_sch
assign fwd_inv = 1'b1; //FFT
assign scale_sch = 10'b10_10_10_10_10;
assign rd_addr = {rd_block_index, xn_index};
assign output_re = xk[31:16];
assign output_im = xk[15:0];
//fft控制
fft_ctrl ctrl_inst(
.clk(clk),
.reset(rst),
.rd_en(rd_en),
.wr_en(wr_en),
.done(done),
.edone(edone),
.rd_block_index(rd_block_index),
.out_block_index(out_block_index),
.start(start),
.rfd(rfd),
.dv(dv),
.sclr(sclr),
.xn_index(xn_index),
.xk_index(xk_index)
);
fft1024 fft_inst(
.rfd(rfd),
.start(start),
.fwd_inv(fwd_inv),
.dv(dv),
.done(done),
.clk(clk),
.busy(busy),
.scale_sch_we(scale_sch_we),
.fwd_inv_we(fwd_inv_we),
.edone(edone),
.xn_re(xn[31:16]),
.xn_im(xn[15:0]),
.xn_index(xn_index),
.scale_sch(scale_sch),
.xk_re(xk[31:16]),
.xk_im(xk[15:0]),
.xk_index(xk_index),
.sclr(sclr)
);
input_rom_I rom_inst_I(
clka(clk),
.ena(rd_en),
.addra(rd_addr),
.douta(xn[31:16])
);
input_rom_Q rom_inst_Q(
.clka(clk),
.ena(rd_en),
.addra(rd_addr),
.douta(xn[15:0])
)
endmodule
5.3.Burst I/O架构下1024点FFT变换
module fft_top(
input clk,
input rst1,
output dv,
output [15:0] output_re,
output [15:0] output_im,
output [9:0] xk_index,
output rfd
);
wire rst;
assign rst = ~rst1;
wire start;//FFT 开始信号高有效: START 为高表示开始加载数据并计算变换(Burst I/O architectures).
wire fwd_inv;//FFT/IFFT指示信号 1:FFT, 0:IFFT
wire done;//完成指示,只有一个cycle宽度的高电平,表示处理完成
wire busy;//忙指示,该信号为高表示FFT变换计算完毕
wire scale_sch_we;// SCALE_SCH 写使能
wire fwd_inv_we;//fwd_inv写使能
wire edone;//将完成,在done之前一个周期给出高电平
wire [31 : 0] xn;//输入数据,高位为实部
wire [9 : 0] xn_index;//xn序号
wire [9 : 0] scale_sch;//各个stage的定标调整值
wire [31 : 0] xk;//输出数据,高位为实部
wire rd_en;//从ROM中读取数据的使能信号
wire wr_en;//往RAM里写数据的使能信号
wire [9:0] rd_addr;//ROM中读取数据的地址信号
wire sclr;//FFT核同步复位信号
assign fwd_inv_we = 1'b0; //不允许修改FFT和IFFT指示
assign scale_sch_we = 1'b0;//不允许修改scale_sch
assign fwd_inv = 1'b1; //FFT
assign scale_sch = 10'b10_10_10_10_10;
assign rd_addr = xn_index;
assign output_re = xk[31:16];
assign output_im = xk[15:0];
fft_burst fft_inst(
.rfd(rfd),
.start(start),
.fwd_inv(fwd_inv),
.dv(dv),
.done(done),
.clk(clk),
.busy(busy),
.unload(unload),
.scale_sch_we(scale_sch_we),
.fwd_inv_we(fwd_inv_we),
.edone(edone),
.xn_re(xn[31:16]),
.xn_im(xn[15:0]),
.xn_index(xn_index),
.scale_sch(scale_sch),
.xk_re(xk[31:16]),
.xk_im(xk[15:0]),
.xk_index(xk_index),
.sclr(sclr)
);
input_rom_I rom_inst_I(
.clka(clk),
.ena(rd_en),
.addra(rd_addr),
.douta(xn[31:16])
);
input_rom_Q rom_inst_Q(
.clka(clk),
.ena(rd_en),
.addra(rd_addr),
.douta(xn[15:0])
);
endmodule
6.实验结果及分析
6.1.Streaming I/O架构256点FFT
1)仿真结果
对工程进行仿真,并将仿真结果与老师压缩包中256点FFT结果进行如下比对:
为了验证结果的正确性,我们将modelsim中的仿真结果以带符号十进制数形式显示,发现仿真结果与理论输出结果一致,实验正确。
2)上板测试结果
连接数码板后,进行测试,并将测试结果与output_data.txt中数据进行比对,找到吻合序列,说明测试结果正确。
3)资源利用情况
查看FPGA资源利用情况发现,一共用到了12个乘法器,2068个LUT。LUT的部分还有469个被用作memory,全部都是移位寄存器。在设计fft的IP core的时候,选择了Number of Stages using block ram为3,即4组蝶形运算的前3组为block RAM,最后一组为distributed RAM。具体说明如下:
| fft_top Project Status | |||
| Project File: | lab3_256.xise | Parser Errors: | No Errors |
| Module Name: | fft_top | Implementation State: | Programming File Generated |
| Target Device: | xc6slx9-2tqg144 | ∙Errors: | No Errors |
| Product Version: | ISE 13.2 | ∙Warnings: | 123 Warnings (12 new) |
| Design Goal: | Balanced | ∙Routing Results: | All Signals Completely Routed |
| Design Strategy: | Xilinx Default (unlocked) | ∙Timing Constraints: | All Constraints Met |
| Environment: | System Settings | ∙Final Timing Score: | 0 (Timing Report) |
| Device Utilization Summary | [-] | |||
| Slice Logic Utilization | Used | Available | Utilization | Note(s) |
| Number of Slice Registers | 3,107 | 11,440 | 27% | |
| Number used as Flip Flops | 3,106 | |||
| Number used as Latches | 1 | |||
| Number used as Latch-thrus | 0 | |||
| Number used as AND/OR logics | 0 | |||
| Number of Slice LUTs | 2,068 | 5,720 | 36% | |
| Number used as logic | 1,358 | 5,720 | 23% | |
| Number using O6 output only | 620 | |||
| Number using O5 output only | 70 | |||
| Number using O5 and O6 | 668 | |||
| Number used as ROM | 0 | |||
| Number used as Memory | 469 | 1,440 | 32% | |
| Number used as Dual Port RAM | 0 | |||
| Number used as Single Port RAM | 0 | |||
| Number used as Shift Register | 469 | |||
| Number using O6 output only | 148 | |||
| Number using O5 output only | 1 | |||
| Number using O5 and O6 | 320 | |||
| Number used exclusively as route-thrus | 241 | |||
| Number with same-slice register load | 226 | |||
| Number with same-slice carry load | 15 | |||
| Number with other load | 0 | |||
| Number of occupied Slices | 827 | 1,430 | 57% | |
| Number of LUT Flip Flop pairs used | 2,487 | |||
| Number with an unused Flip Flop | 228 | 2,487 | 9% | |
| Number with an unused LUT | 419 | 2,487 | 16% | |
| Number of fully used LUT-FF pairs | 1,840 | 2,487 | 73% | |
| Number of unique control sets | 80 | |||
| Number of slice register sites lost to control set restrictions | 408 | 11,440 | 3% | |
| Number of bonded IOBs | 38 | 102 | 37% | |
| Number of LOCed IOBs | 22 | 38 | 57% | |
| Number of RAMB16BWERs | 6 | 32 | 18% | |
| Number of RAMB8BWERs | 6 | 9% | ||
| Number of BUFIO2/BUFIO2_2CLKs | 0 | 32 | 0% | |
| Number of BUFIO2FB/BUFIO2FB_2CLKs | 0 | 32 | 0% | |
| Number of BUFG/BUFGMUXs | 2 | 16 | 12% | |
| Number used as BUFGs | 2 | |||
| Number used as BUFGMUX | 0 | |||
| Number of DCM/DCM_CLKGENs | 0 | 4 | 0% | |
| Number of ILOGIC2/ISERDES2s | 0 | 200 | 0% | |
| Number of IODELAY2/IODRP2/IODRP2_MCBs | 0 | 200 | 0% | |
| Number of OLOGIC2/OSERDES2s | 0 | 200 | 0% | |
| Number of BSCANs | 1 | 4 | 25% | |
| Number of BUFHs | 0 | 128 | 0% | |
| Number of BUFPLLs | 0 | 8 | 0% | |
| Number of BUFPLL_MCBs | 0 | 4 | 0% | |
| Number of DSP48A1s | 12 | 16 | 75% | |
| Number of ICAPs | 0 | 1 | 0% | |
| Number of MCBs | 0 | 2 | 0% | |
| Number of PCILOGICSEs | 0 | 2 | 0% | |
| Number of PLL_ADVs | 0 | 2 | 0% | |
| Number of PMVs | 0 | 1 | 0% | |
| Number of STARTUPs | 0 | 1 | 0% | |
| Number of SUSPEND_SYNCs | 0 | 1 | 0% | |
| Number of RPM macros | 9 | |||
| Average Fanout of Non-Clock Nets | 2.16 | |||
| Performance Summary | [-] | ||
| Final Timing Score: | 0 (Setup: 0, Hold: 0, Component Switching Limit: 0) | Pinout Data: | Pinout Report |
| Routing Results: | All Signals Completely Routed | Clock Data: | Clock Report |
| Timing Constraints: | All Constraints Met | ||
根据仿真结果图,第一个上升沿出现的时间为6095100ps,具体情况如下:
6.2.Streaming I/O架构1024点FFT
1)理论输出结果
将1024点输入数据输入matlab,并在其上生成理论1024点FFT变换结果,具体如下:
2)仿真结果
输出仿真结果,并与matlab中的理论结果进行比对,说明如下:
由图中可以看出,仿真结果与理论值存在误差,但是差异相对较小,属于误差允许范围内。Matlab是纯理论的计算,不存在外界干扰情况,计算结果严谨精确,而FPGA是用硬件电路实现FFT的附加运算,以寄存器为例,因为其位长有限,当两个浮点数相乘时,必定会出现寄存器位数不够的情况,导致部分数位上的数被舍去,导致了误差的产生。因而,利用FPGA进行FFT变换,运算过程中由于诸多因素的干扰,产生误差在所难免,但只要其控制在允许范围内,则认为计算结果正确。
6.3.Streaming架构与Burst I/O架构下1024点FFT比对
6.3.1.时延情况比对分析
1)Streaming架构下1024点FFT的时延情况如下:
2)Burst I/O架构下1024点FFT的时延情况如下:
3)区别分析说明
通过对比可以发,在Streaming I/O架构下,时延为21595100ps,Burst I/O架构下时延为24175100ps,即Burst I/O的架构延时比Streaming I/O架构的延时大。时延的长短与输入信号的长度有关系,如果是输入几组1024长度的信号,Streaming I/O的延时将不受到影响,而Burst I/O的方式则会因为要逐次计算每一组信号,延时将会随之增加。因而,在进行1024点FFT变换时,Burst I/O的架构延时大于Streaming I/O架构的延时。
6.3.2.资源利用情况比对分析
1)Streaming架构下1024点FFT的资源利用情况如下:
| fft_top Project Status | |||
| Project File: | lab3_4.xise | Parser Errors: | No Errors |
| Module Name: | fft_top | Implementation State: | Programming File Generated |
| Target Device: | xc6slx9-2tqg144 | ∙Errors: | |
| Product Version: | ISE 13.2 | ∙Warnings: | |
| Design Goal: | Balanced | ∙Routing Results: | All Signals Completely Routed |
| Design Strategy: | Xilinx Default (unlocked) | ∙Timing Constraints: | All Constraints Met |
| Environment: | System Settings | ∙Final Timing Score: | 0 (Timing Report) |
| Device Utilization Summary | [-] | |||
| Slice Logic Utilization | Used | Available | Utilization | Note(s) |
| Number of Slice Registers | 3,324 | 11,440 | 29% | |
| Number used as Flip Flops | 3,324 | |||
| Number used as Latches | 0 | |||
| Number used as Latch-thrus | 0 | |||
| Number used as AND/OR logics | 0 | |||
| Number of Slice LUTs | 2,300 | 5,720 | 40% | |
| Number used as logic | 1,566 | 5,720 | 27% | |
| Number using O6 output only | 6 | |||
| Number using O5 output only | 39 | |||
| Number using O5 and O6 | 881 | |||
| Number used as ROM | 0 | |||
| Number used as Memory | 563 | 1,440 | 39% | |
| Number used as Dual Port RAM | 0 | |||
| Number used as Single Port RAM | 32 | |||
| Number using O6 output only | 32 | |||
| Number using O5 output only | 0 | |||
| Number using O5 and O6 | 0 | |||
| Number used as Shift Register | 531 | |||
| Number using O6 output only | 153 | |||
| Number using O5 output only | 0 | |||
| Number using O5 and O6 | 378 | |||
| Number used exclusively as route-thrus | 171 | |||
| Number with same-slice register load | 160 | |||
| Number with same-slice carry load | 11 | |||
| Number with other load | 0 | |||
| Number of occupied Slices | 816 | 1,430 | 57% | |
| Number of LUT Flip Flop pairs used | 2,604 | |||
| Number with an unused Flip Flop | 168 | 2,604 | 6% | |
| Number with an unused LUT | 304 | 2,604 | 11% | |
| Number of fully used LUT-FF pairs | 2,132 | 2,604 | 81% | |
| Number of unique control sets | 34 | |||
| Number of slice register sites lost to control set restrictions | 143 | 11,440 | 1% | |
| Number of bonded IOBs | 39 | 102 | 38% | |
| Number of LOCed IOBs | 22 | 39 | 56% | |
| Number of RAMB16BWERs | 6 | 32 | 18% | |
| Number of RAMB8BWERs | 2 | 3% | ||
| Number of BUFIO2/BUFIO2_2CLKs | 0 | 32 | 0% | |
| Number of BUFIO2FB/BUFIO2FB_2CLKs | 0 | 32 | 0% | |
| Number of BUFG/BUFGMUXs | 1 | 16 | 6% | |
| Number used as BUFGs | 1 | |||
| Number used as BUFGMUX | 0 | |||
| Number of DCM/DCM_CLKGENs | 0 | 4 | 0% | |
| Number of ILOGIC2/ISERDES2s | 0 | 200 | 0% | |
| Number of IODELAY2/IODRP2/IODRP2_MCBs | 0 | 200 | 0% | |
| Number of OLOGIC2/OSERDES2s | 0 | 200 | 0% | |
| Number of BSCANs | 0 | 4 | 0% | |
| Number of BUFHs | 0 | 128 | 0% | |
| Number of BUFPLLs | 0 | 8 | 0% | |
| Number of BUFPLL_MCBs | 0 | 4 | 0% | |
| Number of DSP48A1s | 16 | 16 | 100% | |
| Number of ICAPs | 0 | 1 | 0% | |
| Number of MCBs | 0 | 2 | 0% | |
| Number of PCILOGICSEs | 0 | 2 | 0% | |
| Number of PLL_ADVs | 0 | 2 | 0% | |
| Number of PMVs | 0 | 1 | 0% | |
| Number of STARTUPs | 0 | 1 | 0% | |
| Number of SUSPEND_SYNCs | 0 | 1 | 0% | |
| Average Fanout of Non-Clock Nets | 2.13 | |||
| Performance Summary | [-] | |||
| Final Timing Score: | 0 (Setup: 0, Hold: 0, Component Switching Limit: 0) | Pinout Data: | Pinout Report | |
| Routing Results: | All Signals Completely Routed | Clock Data: | Clock Report | |
| Timing Constraints: | All Constraints Met | |||
2)Burst I/O架构下1024点FFT的资源利用情况如下:
| fft_top Project Status | |||
| Project File: | lab3.xise | Parser Errors: | No Errors |
| Module Name: | fft_top | Implementation State: | Programming File Generated |
| Target Device: | xc6slx9-2tqg144 | ∙Errors: | |
| Product Version: | ISE 13.2 | ∙Warnings: | |
| Design Goal: | Balanced | ∙Routing Results: | All Signals Completely Routed |
| Design Strategy: | Xilinx Default (unlocked) | ∙Timing Constraints: | All Constraints Met |
| Environment: | System Settings | ∙Final Timing Score: | 0 (Timing Report) |
| Device Utilization Summary | [-] | ||||
| Slice Logic Utilization | Used | Available | Utilization | Note(s) | |
| Number of Slice Registers | 1,993 | 11,440 | 17% | ||
| Number used as Flip Flops | 1,993 | ||||
| Number used as Latches | 0 | ||||
| Number used as Latch-thrus | 0 | ||||
| Number used as AND/OR logics | 0 | ||||
| Number of Slice LUTs | 1,436 | 5,720 | 25% | ||
| Number used as logic | 1,148 | 5,720 | 20% | ||
| Number using O6 output only | 812 | ||||
| Number using O5 output only | 1 | ||||
| Number using O5 and O6 | 335 | ||||
| Number used as ROM | 0 | ||||
| Number used as Memory | 222 | 1,440 | 15% | ||
| Number used as Dual Port RAM | 0 | ||||
| Number used as Single Port RAM | 0 | ||||
| Number used as Shift Register | 222 | ||||
| Number using O6 output only | 25 | ||||
| Number using O5 output only | 0 | ||||
| Number using O5 and O6 | 197 | ||||
| Number used exclusively as route-thrus | 66 | ||||
| Number with same-slice register load | 65 | ||||
| Number with same-slice carry load | 1 | ||||
| Number with other load | 0 | ||||
| Number of occupied Slices | 571 | 1,430 | 39% | ||
| Number of LUT Flip Flop pairs used | 1,749 | ||||
| Number with an unused Flip Flop | 147 | 1,749 | 8% | ||
| Number with an unused LUT | 313 | 1,749 | 17% | ||
| Number of fully used LUT-FF pairs | 1,2 | 1,749 | 73% | ||
| Number of unique control sets | 11 | ||||
| Number of slice register sites lost to control set restrictions | 44 | 11,440 | 1% | ||
| Number of bonded IOBs | 46 | 102 | 45% | ||
| Number of LOCed IOBs | 20 | 46 | 43% | ||
| Number of RAMB16BWERs | 5 | 32 | 15% | ||
| Number of RAMB8BWERs | 4 | 6% | |||
| Number of BUFIO2/BUFIO2_2CLKs | 0 | 32 | 0% | ||
| Number of BUFIO2FB/BUFIO2FB_2CLKs | 0 | 32 | 0% | ||
| Number of BUFG/BUFGMUXs | 1 | 16 | 6% | ||
| Number used as BUFGs | 1 | ||||
| Number used as BUFGMUX | 0 | ||||
| Number of DCM/DCM_CLKGENs | 0 | 4 | 0% | ||
| Number of ILOGIC2/ISERDES2s | 0 | 200 | 0% | ||
| Number of IODELAY2/IODRP2/IODRP2_MCBs | 0 | 200 | 0% | ||
| Number of OLOGIC2/OSERDES2s | 0 | 200 | 0% | ||
| Number of BSCANs | 0 | 4 | 0% | ||
| Number of BUFHs | 0 | 128 | 0% | ||
| Number of BUFPLLs | 0 | 8 | 0% | ||
| Number of BUFPLL_MCBs | 0 | 4 | 0% | ||
| Number of DSP48A1s | 9 | 16 | 56% | ||
| Number of ICAPs | 0 | 1 | 0% | ||
| Number of MCBs | 0 | 2 | 0% | ||
| Number of PCILOGICSEs | 0 | 2 | 0% | ||
| Number of PLL_ADVs | 0 | 2 | 0% | ||
| Number of PMVs | 0 | 1 | 0% | ||
| Number of STARTUPs | 0 | 1 | 0% | ||
| Number of SUSPEND_SYNCs | 0 | 1 | 0% | ||
| Average Fanout of Non-Clock Nets | 2.68 | ||||
| Performance Summary | [-] | |||
| Final Timing Score: | 0 (Setup: 0, Hold: 0, Component Switching Limit: 0) | Pinout Data: | Pinout Report | |
| Routing Results: | All Signals Completely Routed | Clock Data: | Clock Report | |
| Timing Constraints: | All Constraints Met | |||
从以上表格可以看出,以LUT数量作为代表,Streaming I/O架构下1024点FFT有2604个LUT,而Burst I/O架构下1024点FFT只有1436个LUT。
因此可以得出,Burst I/O 方式的资源占用情况相对于 Streaming I/O 有了明显的下降。由Burst I/O 的工作方式可以知道,每计算一次蝶形运算,计算结果仍然存储到这4块RAM中,直至最后输出。显然,在这种工作方式下,资源占用情况将会有所下降,因而Burst I/O 架构下的资源占用情况更为可观。
7.组内分工
8.1.实验重点
1)DSP与FPGA的区别
在之前的实验中,曾经有过通过DSP完成FFT变换的经历。通过比较发现,在工程的创建,代码的理解方面,DSP更加有优势,编译语言是我们比较有基础的C语言,更好理解;通过实验指导书的内容可以看出,FPGA更多的是要对核心模块的各个部分的功能有整体的认识。对比运行的时钟周期,不难发现FPGA有着很高的效率,并行运算方面性能远高于DSP,而且精度方面也更胜一筹。而且有着很高的灵活性,对于数据的表示和处理方面也更加多元化。
2)两种架构下测试结果区别:
在本次实验中,除了利用Streaming架构实现FFT以外,还与Burst I/O架构下实现FFT进行比对,以Streaming I/O架构为例,每次在进行一次蝶形运算后,会将结果放入到另外的ROM 里面,256点的FFT运算需要4级,因此在一开始ROM分块的时候就分成了4块,在每次执行完运算后,由flt_ctrl 模块检测 rd_block_index 和out_block_index信号控制输入模块的推进。架构的区别使得实现变换的方式有所不同,从而在时延、吞吐量、资源利用情况等方面均造成了影响。两种架构下对应的不同情况已在实验结果分析(6.3)中做了详细说明,因而在此不做赘述。
8.2.实验难点
1)数据输出为恒定直线
仿真时间设置过短时会出现仿真结果恒为一条直线的情况,为了解决该情况,只需将仿真时间加长即可,或直接选中“Run All”,将波形调制适合观测状态 记录仿真结果即可。
2)验证实验结果是否正确
验证仿真结果是否正确需要和理论的输出值进行比对,如若直接对比每一根输出结果,工作量繁琐且不直观。为了解决这一问题,可以将输出按组显示,并通过带符号十进制数来反应仿真结果,可与理论值进行比较,大大提高了验证实验结果的效率。
9.心得体会
本次实验是FPGA部分的第二次实验,在之前已经通过DSP实心FFT的基础上,在FPGA上完成指定点数的FFT变换。在对FFT相关原理的掌握有之前的基础的情况下,实验进行的相对流畅。本次实验需要理解两种不同架构下的工作模式,并对其时延情况、吞吐量及资源利用情况有所掌握。尽管一开始我们对着两种架构都不太熟悉,但是仔细参考实验指导书的情况下,并通过仿真结果及测试分析等情况反复比对两种架构的异同。通过本次实验,我们对这两种架构的优缺点有了初步的掌握,对我们来说获益匪浅。
FPGA虽然只是一块数码版,但是在不同的工作模式及架构下,实验结果也不同。这一情况引起了我们的强烈好奇,在今后的学习过程中,我们将自主学习相关知识,希望能对FPGA掌握的更加深入。下载本文