欢迎来到三一办公! | 帮助中心 三一办公31ppt.com(应用文档模板下载平台)
三一办公
全部分类
  • 办公文档>
  • PPT模板>
  • 建筑/施工/环境>
  • 毕业设计>
  • 工程图纸>
  • 教育教学>
  • 素材源码>
  • 生活休闲>
  • 临时分类>
  • ImageVerifierCode 换一换
    首页 三一办公 > 资源分类 > DOC文档下载  

    SOC实验报告研究生.doc

    • 资源ID:4018879       资源大小:383.50KB        全文页数:25页
    • 资源格式: DOC        下载积分:8金币
    快捷下载 游客一键下载
    会员登录下载
    三方登录下载: 微信开放平台登录 QQ登录  
    下载资源需要8金币
    邮箱/手机:
    温馨提示:
    用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)
    支付方式: 支付宝    微信支付   
    验证码:   换一换

    加入VIP免费专享
     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    SOC实验报告研究生.doc

    SOC 设计方法与实现实验报告马 亮201111857刘家明2011118561 实验时间:2011年11月19日2011年12月15日2 实验目的完成一个数字系统的Verilog HDL描述和利用EDA工具的Verilog HDL仿真综合环境对这一描述进行仿真并综合,完整地从事一个数字VLSI系统的设计过程,理解和掌握现代集成电路的设计流程、硬件描述语言综合理论等高层次设计方法以及它和物理实现之间的关系,巩固在理论课阶段学习的相关知识 。3 实验平台 代码输入工具: QuartusII功能仿真: ModelSim SE 6.2b 综合工具:DC,Synplify Pro 8.6.24 实验内容设计一个数字信号处理器系统,其功能为:在8位微控制器 Intel8051的控制下对输入信号进行数字滤波处理并根据输入数据的大小产生一组控制液晶板的显示。系统框图如下: Intel8051 是微处理器; TH99CHLS 是要实现的系统。Display是一个液晶显示板。它包括三个显示区:一个时间显示区,一个数字显示区和一个由16个小方块组成的信号幅度显示区。显示面板为共阴极驱动,接高电平时对应的面板显示,接低时面板消失。其结构见下图所示。5:系统简介和对应的模块划分5.1:系统的整体工作过程:(1) 在外部信号PEbar的控制下,芯片从端口in读入一个八位数据。(2) 在(1)中输入的数据与微处理器给出的另一个八位数据进行按位“与”操作。(3) 在(2)中处理过的数据经数字滤波后从端口out输出。(4) TH99CHLS 内部产生一组时间信号,包括时和分,其格式为:(hh:mm)。这组时间信号的初值由微处理器给出,微处理器可以随时对时间信号进行修改。(5) 送往液晶显示板的信号有三组:a. (4)中产生的时间信号,经七段译码后从端口hour和minute送出;b. (3)中经数字滤波的信号,在转换成十进制并做七段译码后,百位经端口d00,十位经端口d10,个位经端口d01送出; c. (3)中经数字滤波的信号,在经过压缩后通过端口ap送出。 5.2: 数字滤波器数字滤波器的转移函数为: 滤波器的系数B0,B1,.,B6均由微处理器给出。微处理器可以根据需要修改这些系数。 5.2:系统模块说明和代码说明:根据功能分析,将整个系统分为8个模块。各个模块对应的源文件和功能描述如下表所示。模块名称对应源文件功能说明decoderdecoder.v将四位二进制译码为LED显示。输入4bit,输出为7bit直接驱动显示装置,为组合逻辑。H2DH2D.v进行16进制到十进制的转换。输入为8bit无符号数,输出为百,十,个位数字(其中每个数字4bit位宽),同样为组合逻辑decoder_4X16decoder_4X164-16译码器,主要是将经过y=sqrt(x)压缩后的数据送至显示设备。输入4bit,输出16bit,组合逻辑。sqrt_lutsqrt_lut.v主要实现y=sqrt(x)的运算。主要是通过比较和查找表方式实现。输入8bit,输出4bit。时序逻辑,一个时钟周期。mul8b_shiftadd_fsmmul8b_shiftadd_fsm.v乘法器设计。通过移位加的方式实现。内部通过状态机实现。完成一次乘法需要8个时钟周期timer_clktimer_clk.v时间时钟模块,主要是根据系统时钟计算秒。通过计数器级联的方式实现。filterfilter.v这是整个系统比较核心的部分。主要实现滤波器的设计和与微处理器的接口时序设计。接口需要三态控制,并且要注意读写信号的控制,滤波器采用并行设计,用面积换取速度。TH99CHLSTH99CHLS.v顶层元件例化。主要是将上述各个模块进行组合。 整个功能框图如下:6:代码功能测试下面是测试用的模块介绍,模拟TH99CHLS外围的单片机、控制信号和数据输入等:模块名称对应的源文件功能说明osc_rstosc_rst.v产生时钟频率和复位信号fir_tbfir_tb.v滤波器数据的输入wr_rdwr_rd.v单片机WR,RD信号的模拟mcumcu.v主要是模拟单片机对TH99CHLS芯片的控制,包括寄存器的读入与读出等一系列操作top_testtop_test.v顶层测试文件,主要是进行元件例化ModelSimSE功能仿真结果波形图如下:第一张图为前0-7us,第二张图为7us-15us.详细图形见source中的1.bmp和2.bmp.也可以查看其下的vsim.wlf(需要安装modelsim)。此图为对TH99CHLS芯片内部b0-b6(滤波器系数)寄存器的操作和对mini,hour寄存器初始化的操作仿真结果。7:综合结果及分析Synplify综合结果如下:DC综合结果如下:8:所占用的资源和数据通道分析该系统所占用的资源如下:在滤波器设计中,并没有采用乘法器的复用,而是采用了多个乘法器的复制,牺牲面积来换取速读的提高。综合后的频率能够达到50MHz。滤波器的数据通道如下:(用多个乘法器)9:Verilog HDL代码/timescale 1ns/10psmodule top_test(); wire clk,rst_n; wire 7:0 abus; wire ale,rbar_n,wbar_n,cs_n; wire pebar_n; wire 7:0 fir_in; wire 7:0 dbus_xio; wire 13:0 hour,mini; wire 20:0 fir_out; wire 15:0 fir_out_sqrt; wire send_data_en; fir_tb Ufir_tb(send_data_en,pebar_n,fir_in); osc_rst Uost_rst(clk,rst_n); TH99CHLS UTH99( dbus_xio, abus, rbar_n, wbar_n, ale, pebar_n, fir_in, cs_n, rst_n, clk, /output ports fir_out, fir_out_sqrt, hour, mini ); mcu Umcu( .dbus_xio(dbus_xio), .abus(abus), .rbar_n(rbar_n), .wbar_n(wbar_n), .ale(ale), .cs_n(cs_n), .send_data_en(send_data_en) );endmodule/module decoder( /input hex, /output led ); input 3:0 hex; output reg 6:0 led; always (hex) begin case(hex) 4'b0000:led=7'b011_1111; /0 4'b0001:led=7'b001_1000; /1 4'b0010:led=7'b111_0110; /2 4'b0011:led=7'b111_1100; /3 4'b0100:led=7'b101_1001; /4 4'b0101:led=7'b110_1101; /5 4'b0110:led=7'b110_1111; /6 4'b0111:led=7'b011_1000; /7 4'b1000:led=7'b111_1111; /8 4'b1001:led=7'b111_1101; /9 default :led=7'b000_0000; /null endcase endendmodule/module TH99CHLS( /input dbus_xio, abus, rbar_n, wbar_n, ale, pebar_n, fir_in, cs_n, rst_n, clk, /output ports fir_out, fir_out_sqrt, hour, mini ); input clk,rst_n; input 7:0 abus; input ale,rbar_n,wbar_n,cs_n; input pebar_n; input 7:0 fir_in; inout 7:0 dbus_xio; output 13:0 hour,mini; output 20:0 fir_out; output 15:0 fir_out_sqrt; wire 15:0 fir_out_Hex; wire 7:0 hour_Hex,mini_Hex; wire 3:0 fir_sqt_Hex; wire 3:0 hud_Hex,ten_Hex,num_Hex; filter Ufilter(.dbus_xio(dbus_xio),.abus(abus),.rbar_n(rbar_n), .wbar_n(wbar_n),.ale(ale),.pebar_n(pebar_n), .fir_in(fir_in),.cs_n(cs_n),.rst_n(rst_n),.clk(clk), .fir_out(fir_out_Hex),.hour(hour_Hex),.mini(mini_Hex); sqrt_lut Usqt(.result(fir_sqt_Hex),.in(fir_out_Hex7:0),.clk(clk),.rst_n(rst_n); decoder_4X16 Ude4X16(.out(fir_out_sqrt),.in(fir_sqt_Hex); H2D UH2d1(.hex(fir_out_Hex7:0), .hud(hud_Hex),.ten(ten_Hex),.num(num_Hex); decoder Udecoder1(.hex(hud_Hex),.led(fir_out20:14); decoder Udecoder2(.hex(ten_Hex),.led(fir_out13:7); decoder Udecoder3(.hex(num_Hex),.led(fir_out6:0); decoder Udecoder4(.hex(hour_Hex7:4),.led(hour13:7); decoder Udecoder5(.hex(hour_Hex3:0),.led(hour6:0); decoder Udecoder6(.hex(mini_Hex7:4),.led(mini13:7); decoder Udecoder7(.hex(mini_Hex3:0),.led(mini6:0);endmodule/timescale 1ns/10psmodule wr_rd( dbus_xio, abus, rbar_n, wbar_n, ale); parameter MCU_CLK=40;/25MHz parameter LL_DELAY=15; output reg 7:0 abus; output reg ale,rbar_n,wbar_n; inout 7:0 dbus_xio; reg ctrl; reg 7:0 abus_low; assign dbus_xio=ctrl?abus_low:8'hzz; /if ctrl=1 output then hiz integer i; initial begin rbar_n=1'b1; wbar_n=1'b1; end task write_register; input 7:0 write_addr; input 7:0 write_data; /write movx begin ale=1'b0;/config b0 #MCU_CLK; ale=1'b1; ctrl=1'b1; #LL_DELAY; abus_low=write_addr; abus=8'h0; #LL_DELAY; ale=0; ctrl=1'b0; /float #MCU_CLK; #MCU_CLK; ctrl=1'b1; abus_low=write_data; #1; wbar_n=1'b0; for(i=0;i<8;i=i+1) #MCU_CLK; wbar_n=1'b1; end endtask /end movx task read_register; input 7:0 read_addr; output 7:0 read_data; /read movx begin ale=1'b0;/config b0 #MCU_CLK; ale=1'b1; ctrl=1'b1; #LL_DELAY; abus_low=read_addr; abus=8'h0; #LL_DELAY; ale=0; ctrl=1'b0; /float #MCU_CLK; #MCU_CLK; ctrl=1'b0; rbar_n=1'b0; #MCU_CLK; read_data=dbus_xio; for(i=0;i<7;i=i+1) #MCU_CLK; rbar_n=1'b1; end endtask endmodule/module decoder_4X16( / output out, /16 bit width high voltag effect /input in /four bit width ); input 3:0 in; output 15:0 out; assign out15= in3 & in2 & in1 & in0; /1111 15 assign out14= in3 & in2 & in1 &(in0); /1110 14 assign out13= in3 & in2 &(in1)& in0; /1101 13 assign out12= in3 & in2 &(in1)&(in0); /1100 12 assign out11= in3 &(in2)& in1 & in0; /1011 11 assign out10= in3 &(in2)& in1 &(in0); /1010 10 assign out9 = in3 &(in2)&(in1)& in0; /1001 9 assign out8 = in3 &(in2)&(in1)&(in0); /1000 8 assign out7=(in3)& in2 & in1 & in0; /0111 7 assign out6=(in3)& in2 & in1 &(in0); /0110 6 assign out5=(in3)& in2 &(in1)& in0; /0101 5 assign out4=(in3)& in2 &(in1)&(in0); /0100 4 assign out3=(in3)&(in2)& in1 & in0; /0011 3 assign out2=(in3)&(in2)& in1 & in0; /0010 2 assign out1=(in3)&(in2)&(in1)& in0; /0001 1 assign out0=(in3)&(in2)&(in1)&(in0); /0000 0 endmodule/module filter( / input ports dbus_xio, abus, rbar_n, wbar_n, ale, pebar_n, fir_in, cs_n, rst_n, clk, /output ports fir_out, hour, mini, ); inout wire 7:0 dbus_xio; /data bus connect to p0 complex of data and addr /output reg 7:0 dbus; input 7:0 abus; /addr bus connect to p2 input rbar_n,wbar_n; /rd and wr signal connect to rd,we of mcu input ale,cs_n; input pebar_n; input 7:0 fir_in; input clk,rst_n; output reg 15:0 fir_out; output 7:0 hour,mini; /*/ /about config reg 7:0 B0,B1,B2,B3,B4,B5,B6; reg 7:0 mcu_num; reg 7:0 abus_low; reg 7:0 hour,mini; reg 7:0 dbus; reg timer_clr_n; wire 15:0 abus_inner; / wire 7:0 dbus_in; /*/ /reg about fir reg 7:0 fir_in_reg6:0; wire 15:0 mul_out6:0; reg start; wire 6:0 mul_out_en; wire mul_out_en_all; wire 7:0 fir_in_inner; integer i; /*/ assign fir_in_inner=fir_in&mcu_num; assign abus_inner=abus,abus_low; assign dbus_xio=rbar_n?8'hzz:dbus; / /*/ /* always (posedge clk or rst_n) begin /latch the address like 373 if(!rst_n) begin abus_low<=8'b0; end else begin if(ale&(!cs_n) /cs_n=0 and ale=1 latch the address of P0 abus_low<=dbus_in; end end*/ /latch not flip_flop always (ale or dbus_xio or cs_n) begin if(ale=1'b1)&(!cs_n) abus_low<=dbus_xio; end /*/ always (posedge clk or negedge rst_n) begin /config the register if(!rst_n) begin B0<=8'b0;B1<=8'b0;B2<=8'b0; B3<=8'b0;B4<=8'b0;B5<=8'b0;B6<=8'b0; end else begin if(!(cs_n|wbar_n) begin /cs_n=0 and wbar_n=0 write case(abus_inner3:0) 4'b0000:B0<=dbus_xio; 4'b0001:B1<=dbus_xio; 4'b0010:B2<=dbus_xio; 4'b0011:B3<=dbus_xio; 4'b0100:B4<=dbus_xio; 4'b0101:B5<=dbus_xio; 4'b0110:B6<=dbus_xio; 4'b0111:mcu_num<=dbus_xio; / default:version<=dbus_xio; endcase end end end /*/ always (posedge clk or negedge rst_n) begin /read the register if(!rst_n)begindbus<=8'h0;end else if(!(cs_n|rbar_n) begin /cs_n=0 and wbar_n=0 write case(abus_inner3:0) 4'b0000:dbus<=B0; 4'b0001:dbus<=B1; 4'b0010:dbus<=B2; 4'b0011:dbus<=B3; 4'b0100:dbus<=B4; 4'b0101:dbus<=B5; 4'b0110:dbus<=B6; 4'b0111:dbus<=mcu_num; 4'b1000:dbus<=mini; 4'b1001:dbus<=hour; default:dbus<=8'b0;/version endcase end end /*/input the num reg pebar1; wire in_enable; always (posedge clk or negedge rst_n) begin if(!rst_n) begin pebar1<=1'b0; end else begin pebar1<=pebar_n; end end assign in_enable=pebar1&(pebar_n); always (posedge clk or negedge rst_n) begin if(!rst_n) begin for(i=0;i<7;i=i+1) fir_in_regi<=8'b0; start<=1'b0; end else if(in_enable) begin fir_in_reg0<=fir_in_inner; for(i=0;i<6;i=i+1) fir_in_regi+1<=fir_in_regi; start<=1'b1; end else begin start<=1'b0; end end /*/ mul8b_shiftadd_fsm U0(.mul_out(mul_out0), .mul_out_en(mul_out_en0), .mul_ina(B0), .mul_inb(fir_in_reg0), .clk(clk), .start(start), .rst_n(rst_n) ); mul8b_shiftadd_fsm U1(.mul_out(mul_out1), .mul_out_en(mul_out_en1), .mul_ina(B1), .mul_inb(fir_in_reg1), .clk(clk), .start(start), .rst_n(rst_n) ); mul8b_shiftadd_fsm U2(.mul_out(mul_out2), .mul_out_en(mul_out_en2), .mul_ina(B2), .mul_inb(fir_in_reg2), .start(start), .clk(clk), .rst_n(rst_n) ); mul8b_shiftadd_fsm U3(.mul_out(mul_out3), .mul_out_en(mul_out_en3), .mul_ina(B3), .mul_inb(fir_in_reg3), .start(start), .clk(clk), .rst_n(rst_n) ); mul8b_shiftadd_fsm U4(.mul_out(mul_out4), .mul_out_en(mul_out_en4), .mul_ina(B4), .mul_inb(fir_in_reg4), .start(start), .clk(clk), .rst_n(rst_n) ); mul8b_shiftadd_fsm U5(.mul_out(mul_out5),

    注意事项

    本文(SOC实验报告研究生.doc)为本站会员(laozhun)主动上传,三一办公仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知三一办公(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    备案号:宁ICP备20000045号-2

    经营许可证:宁B2-20210002

    宁公网安备 64010402000987号

    三一办公
    收起
    展开