当前位置:网站首页>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
边栏推荐
- dynamic programming
- 【数组和进阶指针经典笔试题12道】这些题,满足你对数组和指针的所有幻想,come on !
- 美国费城发生“安全事故” 2名警察遭枪杀
- Opengauss database source code analysis series articles -- detailed explanation of dense equivalent query technology (Part 2)
- Handwriting promise and async await
- The speed monitoring chip based on Bernoulli principle can be used for natural gas pipeline leakage detection
- 申请代码签名证书时如何选择合适的证书品牌?
- 基于TI DRV10970驱动直流无刷电机
- 如何将电脑复制的内容粘贴进MobaXterm?如何复制粘贴
- openGauss数据库源码解析系列文章—— 密态等值查询技术详解(下)
猜你喜欢
无密码身份验证如何保障用户隐私安全?
危机重重下的企业发展,数字化转型到底是不是企业未来救星
How to protect user privacy without password authentication?
How can non-technical departments participate in Devops?
FR练习题目---简单题
Share 20 strange JS expressions and see how many correct answers you can get
How to choose the appropriate certificate brand when applying for code signing certificate?
[detailed explanation of Huawei machine test] character statistics and rearrangement
Thymeleaf th:with局部变量的使用
Penetration testing methodology
随机推荐
【招聘岗位】软件工程师(全栈)- 公共安全方向
leetcode:881. 救生艇
裁员下的上海
【数组和进阶指针经典笔试题12道】这些题,满足你对数组和指针的所有幻想,come on !
[learning notes] stage test 1
CPU设计相关笔记
浅谈Dataset和Dataloader在加载数据时如何调用到__getitem__()函数
mysql8.0JSON_CONTAINS的使用说明
【華為機試真題詳解】歡樂的周末
The forked VM terminated without saying properly goodbye
Chow Tai Fook fulfills the "centenary commitment" and sincerely serves to promote green environmental protection
MongDB学习笔记
Postgresql 13 安装
安装配置Jenkins
Long list optimized virtual scrolling
动态规划
开挖财上的证券账户可以吗?安全吗?
CPU设计实战-第四章实践任务三用前递技术解决相关引发的冲突
How can non-technical departments participate in Devops?
FR练习题目---简单题