单时钟周期单时钟周期数据通路设计 - 图文
更新时间:2023-10-08 04:30:02 阅读量: 综合文库 文档下载
- 时钟周期和时钟周期数推荐度:
- 相关推荐
实验五 单时钟周期数据通路设计
实验目的
通过实现MIPS核心指令集的单时钟周期数据通路,了解单周期数据通路的原理与实现。
实验设备
1. 装有ISE10.1的PC机一台 2. EDK-3SAISE实验箱一台
实验内容
用verilog描述如下的单时钟周期数据通路,先完成行为仿真,再加载到实验箱运行。
加载到实验箱运行时,要求输入clk,rst,pausen,输出pc[5:2]、aluout[7:0]。 1.模块代码
module CPUsec(clk,rst ,pcin,pcout,inst,bdata,aluout,signextout,memout,pcp4,
waddr,regdest,zero,aluctrl,aluop,jump,brance,memread,memtoreg,memwrite,alusrc,regwrite,beqaddrout,bzaddr,rdata1,rdata2,wdata,jaddr); input clk,rst;
output[31:0]pcin,pcout,inst,bdata,aluout,signextout,memout,pcp4,beqaddrout,bzaddr,rdata1,rdata2,wdata,jaddr;
output [4:0] waddr;
output regdest,zero,jump,brance,memread,memtoreg,memwrite,alusrc,regwrite; output [2:0] aluctrl; output [1:0] aluop; wire [31:0] pcin,pcout;
Pc pc(clk,rst,pcin,pcout); module IMem(rst,addr,inst); IMem imem(rst,pcout,inst);
RegFile rfile(clk,rst,inst[25:21],inst[20:16],waddr,rdata1,rdata2,wdata,regwrite); NBitMux2to1 muxregdest(inst[15:11],inst[20:16],regdest,waddr); defparam muxregdest.n=5;
Alu alu(rdata1,bdata,aluctrl,aluout,zero); SignExt signext(inst[15:0],signextout);
NBitMux2to1 muxbdata(signextout,rdata2,alusrc,bdata);
AluCtrl aluc(aluop,inst[5:0],aluctrl);
DMem dmem(clk,rst,memwrite,memread,aluout,rdata2,memout); NBitMux2to1 muxmemtoreg(aluout,memout,memtoreg,wdata); PcPlus4 pcplus4(pcout,pcp4);
BeqAddr beqaddr(pcp4,signextout,beqaddrout);
NBitMux2to1 muxbzaddr(pcp4,beqaddrout,bz,bzaddr); and(bz,branch,zero);
assign jaddr={pcp4[31:28],inst[25:0]<<2};
Controller
ctroller(inst[31:26],regdest,jump,brance,memread,memtoreg,aluop,memwrite,alurc,regwrite);
endmodule
功能仿真测试代码
功能仿真测试时序图
1. 模块代码
module CPU(clkin,rst,pausen,pc4,alu8); input clkin,rst,pausen; output [3:0] pc4;
output [7:0] alu8;
wire[31:0]pcin,pcout,inst,bdata,aluout,signextout,memout,pcp4,beqaddrout,bzaddr,rdata1,rdata2 ,wdata,jaddr; wire [4:0] waddr;
wire regdest,zero,jump,brance,memread,memtoreg,memwrite,alusrc,regwrite; wire [2:0] aluctrl; wire [1:0] aluop;
//输出pc[5:2]
assign pc4=pcout[5:2]; assign alu8=aluout[7:0]; assign clkout=clkin; and(clk,clkout,pausen);//暂停时钟 //module Pc(clk,rst,ipc,opc); Pc pc(clk,rst,pcin,pcout);
//module IMem(rst,addr,inst); IMem imem(rst,pcout,inst);
//module
RegFile(clk,rst,ReadAddr1,ReadAddr2,WriteAddr,ReadData1,ReadData2,WriteData,we);
RegFile rfile(clk,rst,inst[25:21],inst[20:16],waddr,rdata1,rdata2,wdata,regwrite);
//module NBitMux2to1(A,B,sel,F);
NBitMux2to1 muxregdest(inst[15:11],inst[20:16],regdest,waddr); defparam muxregdest.n=5;
//module Alu(A,B,Ctrl,F,zero);
Alu alu(rdata1,bdata,aluctrl,aluout,zero);
//module SignExt(In,Out);
SignExt signext(inst[15:0],signextout);
//module NBitMux2to1(A,B,sel,F);
NBitMux2to1 muxbdata(signextout,rdata2,alusrc,bdata);
//module AluCtrl(AluOp,Func,Ctrl); AluCtrl aluc(aluop,inst[5:0],aluctrl);
//module DMem(clk,rst,we,re,addr,din,dout);
DMem dmem(clk,rst,memwrite,memread,aluout,rdata2,memout);
//module NBitMux2to1(A,B,sel,F);
NBitMux2to1 muxmemtoreg(aluout,memout,memtoreg,wdata);
//module PcPlus4(ipc,opc); PcPlus4 pcplus4(pcout,pcp4);
//module BeqAddr(pcp4,imm32,addr);
BeqAddr beqaddr(pcp4,signextout,beqaddrout);
//module NBitMux2to1(A,B,sel,F);
NBitMux2to1 muxbzaddr(pcp4,beqaddrout,bz,bzaddr);
and(bz,branch,zero);
assign jaddr={pcp4[31:28],inst[25:0]<<2};
//module NBitMux2to1(A,B,sel,F);
NBitMux2to1 muxjump(bzaddr,jaddr,jump,pcin);
//module
Controller(op,regdest,jump,branch,memread,mem2reg,aluop,memwrite,alusrc,regwrite);
Controller
ctroller(inst[31:26],regdest,jump,brance,memread,memtoreg,aluop,memwrite,alusrc,regwrite); endmodule
2. 功能仿真测试代码
3. 功能仿真测试时序图
一、实验小结
正在阅读:
校本课程管理制度05-31
2022_2022学年高中化学第一章从实验学化学第二节化学计量在实验04-16
2010年11月国家秘书职业资格考试三级试卷理论知识部分-中大网校02-29
读《诗经》有感:声色与犬马12-11
2016届高三上学期第11周物理高效课堂教学设计:验证机械能守恒定03-06
主要农作物生长条件及分布05-11
人教版PEP六年级英语上册期末试卷含答案04-09
- 多层物业服务方案
- (审判实务)习惯法与少数民族地区民间纠纷解决问题(孙 潋)
- 人教版新课标六年级下册语文全册教案
- 词语打卡
- photoshop实习报告
- 钢结构设计原理综合测试2
- 2014年期末练习题
- 高中数学中的逆向思维解题方法探讨
- 名师原创 全国通用2014-2015学年高二寒假作业 政治(一)Word版
- 北航《建筑结构检测鉴定与加固》在线作业三
- XX县卫生监督所工程建设项目可行性研究报告
- 小学四年级观察作文经典评语
- 浅谈110KV变电站电气一次设计-程泉焱(1)
- 安全员考试题库
- 国家电网公司变电运维管理规定(试行)
- 义务教育课程标准稿征求意见提纲
- 教学秘书面试技巧
- 钢结构工程施工组织设计
- 水利工程概论论文
- 09届九年级数学第四次模拟试卷
- 时钟
- 周期
- 通路
- 图文
- 数据
- 设计
- 主变安装施工方案
- 连续梁张拉、压浆施工技术交底
- 中南大学化工热力学试题-2013秋季
- 集中式空气源热泵热水系统案例分析
- 工程地质实习日记
- 朵实工贸110kV开关站带电启动方案1
- 2018年湖北省宜昌市初中毕业生学业考试数学试卷
- 九年级语文下册第六单元22《出师表》课后检测新人教版
- 2012年煤矿企业党代会工作报告
- C语言课程设计报告-附录2
- 电子线路CAD设计
- 对教师合理布置中学生作业的几点思考
- 《电磁场微波技术与天线》习题参考答案
- 18套试卷合集河北省石家庄赵县联考2019年中考物理六模物理试卷及答案
- 电子通信专业英语词汇
- 软件实训管理说明
- 经济学原理宏观经济学分册第七版课后题及答案
- 综合评分法评标方法
- 耐克网络营销策划方案
- 安徽省黄山市2013届高三(屯溪一中等)三校联考文科综合试题 - 图文