欢迎来到天天文库
浏览记录
ID:57682195
大小:150.50 KB
页数:6页
时间:2020-08-31
《实验7-取指令与指令译码实验.doc》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、实验报告2018年5月5日成绩:姓名阳光男学号16041321班级16052317专业计算机科学与技术课程名称《计算机组成原理与系统结构试验》任课老师张翔老师指导老师张翔老师机位号默认实验序号7实验名称《实验七取指令与指令译码实验》实验时间2018/5/30实验地点1教211实验设备号个人电脑+Nexy3开发板一、实验程序源代码顶层电路:moduletop(inputclk,inputrst,input[1:0]C,outputreg[7:0]LED);wire[31:0]Inst_code;pcpc_
2、test(clk,rst,Inst_code);always@(*)begincase(C)2'b00:LED=Inst_code[7:0];2'b01:LED=Inst_code[15:8];2'b10:LED=Inst_code[23:16];2'b11:LED=Inst_code[31:24];endcaseendendmodulePC取指令电路modulepc(inputclk,inputrst,outputwire[31:0]Inst_code);reg[31:0]PC;wire[31:0]P
3、C_new;initialPC=32'h00000000;Inst_ROMInst_ROM1(.clka(clk),.addra(PC[7:2]),.douta(Inst_code));assignPC_new=PC+4;always@(posedgerstornegedgeclk)beginif(rst)PC=32'h00000000;elsePC={24'h000000,PC_new[7:0]};endendmodule测试代码:moduletest;//Inputsregclk;regrst;//
4、Outputswire[31:0]Inst_code;//InstantiatetheUnitUnderTest(UUT)pcuut(.clk(clk),.rst(rst),.Inst_code(Inst_code));initialbegin//InitializeInputsclk=0;rst=0;//Wait100nsforglobalresettofinish#100;clk=1;rst=0;#100;clk=0;rst=0;#100;clk=1;rst=0;#100;clk=0;rst=0;#
5、100;clk=1;rst=0;#100;clk=0;rst=0;#100;clk=1;rst=0;#100;clk=0;rst=0;//Addstimulushereendendmodule二、仿真波形三、电路图顶层电路模块顶层电路内部结构:四、引脚配置(约束文件)NET"LED[7]"LOC=T11;NET"LED[6]"LOC=R11;NET"LED[5]"LOC=N11;NET"LED[4]"LOC=M11;NET"LED[3]"LOC=V15;NET"LED[2]"LOC=U15;NET"LE
6、D[1]"LOC=V16;NET"LED[0]"LOC=U16;NET"C[1]"LOC=T9;NET"C[0]"LOC=T10;NET"clk"LOC=D9;NET"rst"LOC=C9;五、思考与探索R0(r0)=00000000R8(t0)=00007000R16(s0)=fffffff0R24(t8)=00000000R1(at)=ffffffffR9(t1)=ffff8fffR17(s1)=00000010R25(t9)=00000000R2(v0)=00000001R10(t2)=ffff8
7、ffeR18(s2)=70000000R26(k0)=00000000R3(v1)=00000002R11(t3)=00006ff2R19(s3)=00020000R27(k1)=00000000R4(a0)=00000003R12(t4)=ffff900eR20(s4)=80000000R28(gp)=00000000R5(a1)=00000005R13(t5)=ffff800eR21(s5)=00000000R29(sp)=7ffff364R6(a2)=00000007R14(t6)=ffff9ff
8、fR22(s6)=00000000R30(s8)=00000000R7(a3)=0000000eR15(t7)=0000000fR23(s7)=00000000R31(ra)=00000000
此文档下载收益归作者所有