当前位置:网站首页>CPU design practice - Chapter 4 practice task 3 use pre delivery technology to solve conflicts caused by related issues
CPU design practice - Chapter 4 practice task 3 use pre delivery technology to solve conflicts caused by related issues
2022-07-05 14:38:00 【Xiaowei programmer】
Solve the conflict caused by data correlation with forward delivery technology
Preface
Practice task three is in Practical task 2 On the basis of the above !!!
stay lab4 In an experimental environment , Add the corresponding code and use the pre delivery technology to solve the conflicts caused by related , Finally, the simulation time is less than that of practical task two .
experiment
1. Add the execution level 、 The data of memory access level or write back level is delivered to the data path of decoding level
At the decoding level, it is judged that the current time is at the execution level 、 Whether the register number of the destination operand of the memory access level or write back level instruction is the same as that of the source operand of the decoding level , Indicates that data correlation has occurred , The execution level 、 The data of the memory access level or write back level is delivered to the decoding level . The code is as follows :
EXE_stage:
output [31:0] EXE_result, // Executive level
assign EXE_result = es_alu_result;
MEM_stage:
output [31:0] MEM_result
assign MEM_result = ms_final_result;
WB_stage:
output [31:0] WB_result
assign WB_result = ws_final_result;
ID_stage:
input [31:0] EXE_result,
input [31:0] MEM_result,
input [31:0] WB_result,
stay mycpu_top Add the corresponding signal to the instantiation of the corresponding module :
// Instantiate the line declaration used
wire [31:0] EXE_result;
wire [31:0] MEM_result;
wire [31:0] WB_result;
ID_stage:
.EXE_result (EXE_result),
.MEM_result (MEM_result),
.WB_result (WB_result)
EXE_stage:
.EXE_result (EXE_result)
MEM_stage:
.MEM_result (MEM_result)
WB_stage:
.WB_result (WB_result)
2. It is the execution level that needs to be delivered before judgment 、 Data at the access level or write back level
At the decoding level, we get that the current time is at the execution level 、 The instructions of memory access level and write back level need to be finally written back to the destination operand of the register , Next, we need to generate corresponding logic to judge that what needs to be passed forward is the execution level 、 Data at the access level or write back level . The code modified at the decoding level is as follows :
// Delete
/* assign rs_value = rf_rdata1; assign rt_value = rf_rdata2; */
// add to -begin
assign rs_value = rs_wait ? (rs == EXE_dest ? EXE_result :
rs == MEM_dest ? MEM_result : WB_result)
: rf_rdata1;
assign rt_value = rt_wait ? (rt == EXE_dest ? EXE_result :
rt == MEM_dest ? MEM_result : WB_result)
: rf_rdata2;
assign ds_ready_go = ds_valid & ~load_stall;
//load_stall In practice, task 2 has been added , It means the first one i The first instruction is load Instructions , The first i+1 Orders
// and load Instruction occurrence data correlation , At this time, the data that needs to be delivered in advance is not ready , Pipeline pause required .
// add to -end
experimental result
Simulation results :
launch_simulation: Time (s): cpu = 00:00:05 ; elapsed = 00:00:12 . Memory (MB): peak = 958.809 ; gain = 0.000
Tested :
----PASS!!!
run: Time (s): cpu = 00:00:18 ; elapsed = 00:00:16 . Memory (MB): peak = 958.809 ; gain = 0.000
边栏推荐
- Opengauss database source code analysis series articles -- detailed explanation of dense equivalent query technology (Part 2)
- dynamic programming
- 两个BI开发,3000多张报表?如何做的到?
- 美国费城发生“安全事故” 2名警察遭枪杀
- Drive brushless DC motor based on Ti drv10970
- SaaS multi tenant solution for FMCG industry to build digital marketing competitiveness of the whole industry chain
- 选择排序和冒泡排序
- Security analysis of Web Architecture
- 详解Vue适时清理keepalive缓存方案
- Topology可视化绘图引擎
猜你喜欢
Niuke: intercepting missiles
leetcode:881. lifeboat
Drive brushless DC motor based on Ti drv10970
【NVMe2.0b 14-9】NVMe SR-IOV
【NVMe2.0b 14-9】NVMe SR-IOV
区间 - 左闭右开
[summary of leetcode weekly competition] the 81st fortnight competition of leetcode (6.25)
Introduction, installation, introduction and detailed introduction to postman!
FR练习题目---简单题
如何将电脑复制的内容粘贴进MobaXterm?如何复制粘贴
随机推荐
开挖财上的证券账户可以吗?安全吗?
3W principle [easy to understand]
基于TI DRV10970驱动直流无刷电机
做自媒体视频二次剪辑,怎样剪辑不算侵权
SSL证书错误怎么办?浏览器常见SSL证书报错解决办法
Penetration testing methodology
Thymeleaf 模板的创建与使用
家用电器行业商业供应链协同平台解决方案:供应链系统管理精益化,助推企业智造升级
CPU设计实战-第四章实践任务三用前递技术解决相关引发的冲突
anaconda使用中科大源
PMP考试20天能通过吗?
【学习笔记】阶段测试1
Online electronic component purchasing Mall: break the problem of information asymmetry in the purchasing process, and enable enterprises to effectively coordinate management
Thymeleaf th:classappend属性追加 th:styleappend样式追加 th:data-自定义属性
【C 题集】of Ⅷ
Longest common subsequence dynamic programming
LeetCode_ 67 (binary sum)
Section - left closed right open
webRTC SDP mslabel lable
Loop invariant