当前位置:网站首页>CPU design (single cycle and pipeline)
CPU design (single cycle and pipeline)
2022-06-27 09:42:00 【Chloroplasts do not forget to breathe】
WeChat official account : Chuangxiang diary
Send keywords :cpu
obtain CPU Design source file ( Do not look at single cycle and pipeline )
List of articles
Functional description of the design ( Contains a description of all the implemented instructions , And single cycle / Assembly line CPU frequency )
add: Read the operands in the two registers containing operands specified in the instruction , Then add and write the result to the destination register .
sub: Read the operands in the two registers containing operands specified in the instruction , Then write the result to the destination register after subtracting .
and: Read the operands in the two registers containing operands specified in the instruction , Then write the result to the destination register after the and operation .
or: Read the operands in the two registers containing operands specified in the instruction , Then write the result to the destination register after the or operation .
xor: Read the operands in the two registers containing operands specified in the instruction , Then write the result to the destination register after XOR operation .
sll: Read the operands in the two registers containing operands specified in the instruction , And then I'll put the operands 1 Logical shift left operand 2 Write the result to the destination register after the number of bits of size .
srl: Read the operands in the two registers containing operands specified in the instruction , And then I'll put the operands 1 Logical shift right operand 2 Write the result to the destination register after the number of bits of size .
sra: Read the operands in the two registers containing operands specified in the instruction , And then I'll put the operands 1 Arithmetic shift right operand 2 Write the result to the destination register after the number of bits of size .
addi: Read out the operands in one of the registers containing operands specified in the instruction , Then add the operand to the immediate value specified in the instruction and write the result to the destination register .
andi: Read the operand from a register containing the operand specified in the instruction , Then the operand is summed with the immediate value specified in the instruction, and the result is written into the destination register .
ori: Read the operand from a register containing the operand specified in the instruction , Then the operand is or computed with the immediate value specified in the instruction, and the result is written to the destination register .
xori: Read the operand from a register containing the operand specified in the instruction , Then XOR the operand with the immediate number specified in the instruction and write the result to the destination register .
slli: Read the operand from a register containing the operand specified in the instruction , Then, the operand is logically shifted left by the number of bits of the size of the immediate specified in the instruction, and the result is written to the destination register .
srli: Read the operand from a register containing the operand specified in the instruction , Then, the operand is logically shifted to the right by the number of bits of the size of the immediate specified in the instruction, and the result is written to the destination register .
srai: Read the operand from a register containing the operand specified in the instruction , Then, the operand is arithmetically shifted right by the number of bits of the size of the immediate specified in the instruction, and the result is written to the destination register .
lw: Add the operand in the register containing the operand specified in the instruction to the immediate value specified in the instruction , Then read out the value of the storage unit whose address is the result of the addition , And write it to the destination register .
ialr: Add the operand in the register containing the operand specified in the instruction to the immediate value specified in the instruction as the next PC Value , And then put the current PC The value of the add 4 The resulting value is written to the destination register .
sw: The register containing the operand specified in the instruction 1 The operands in and the immediate values specified in the instruction are added , Then, the register containing the operand specified in the instruction 2 The operands in are written to the storage unit with the addition result as the address .
beq: Read the operands in the two registers containing operands specified in the instruction , And then compare them , If operand 1 And operands 2 equal , The current PC The address plus the immediate number specified in the instruction is the result of the next PC Value , otherwise , Just put the current PC Add... To the address 4 As the result of the next PC Value .
bne: Read the operands in the two registers containing operands specified in the instruction , And then compare them , If operand 1 And operands 2 It's not equal , The current PC The address plus the immediate number specified in the instruction is the result of the next PC Value , otherwise , Just put the current PC Add... To the address 4 As the result of the next PC Value .
blt: Read the operands in the two registers containing operands specified in the instruction , Then make a signed comparison , If operand 1 Less than operand 2, The current PC The address plus the immediate number specified in the instruction is the result of the next PC Value , otherwise , Just put the current PC Add... To the address 4 As the result of the next PC Value .
bge: Read the operands in the two registers containing operands specified in the instruction , Then make a signed comparison , If operand 1 Greater than or equal to the operand 2, The current PC The address plus the immediate number specified in the instruction is the result of the next PC Value , otherwise , Just put the current PC Add... To the address 4 As the result of the next PC Value .
lui: The immediate number specified in the instruction is expanded into 32 The result after bit is written to the destination register .
jal: Will the current PC The value of is added to the immediate value specified in the instruction as the next PC Value , And then put the current PC The value of the add 4 The resulting value is written to the destination register .
One cycle CPU frequency 25MHz
Assembly line CPU frequency 90MHz
Single cycle module function
PC: Pass the address value of the next instruction to imem modular .
Next. _pc: Get the next - Time of pc Value and pass to PC modular .
imem: A module that stores instructions .
decoder: Decoding unit , Split the input instruction , Get the corresponding operand or immediately after symbol expansion , For later modules .
control: Through the input instructions, the corresponding values of each control signal are obtained and output to other modules .
execute: The corresponding operands are calculated and the results are output to the required modules .
dram: Storage unit .
compare: Perform the comparison operation of the comparison instruction , And output a signal to decide whether to jump .
Pipeline module functions
PC: Pass the address value of the next instruction to irom modular .
Next_pc: Get the next pc Value and pass to PC modular .
irom: A module that stores instructions .
jump_ test: Detect whether it is a jump instruction , And decide whether to pause .
IF_ID_ reg: take IF Part of the signal of the phase is transmitted to ID Stage .
decoder: Decoding unit , Split the input instruction , Get the corresponding operand or immediately after symbol expansion , For later modules .
control: Through the input instructions, the corresponding values of each control signal are obtained and output to other modules .
conf_ test: Conflict detection module , Detect whether there are data conflicts , And output the corresponding conflict signal and the correct value that should be read out from the register after the conflict .
ID_ EX_ reg: take ID Part of the signal of the phase is transmitted to EX Stage .
execute: The corresponding operands are calculated and the results are output to the required modules .
compare: Perform the comparison operation of the comparison instruction , And output a signal to decide whether to jump .
EX_MEM_reg: take EX Part of the signal of the phase is transmitted to MEM Stage .
dram: Storage unit .
MEM_WB._reg: take MEM Part of the signal of the phase is transmitted to WB Stage .
Pipeline Division

IF Stage : Finish next time pc Calculation of values , And according to the present pc Value to change the corresponding instruction from irom Take it out of the module and output it to the subsequent stages ; Furthermore, there is the detection of jump instructions , Decide whether to pause .
ID Stage : receive IF Instructions obtained in the phase , Then the effective information in the instruction is extracted , for example I The immediate sign extension value of a type instruction 、R The operands of type instruction, etc , And get the value of each control signal, and then output it to the subsequent modules , Furthermore, check whether there is data conflict , And deal with it accordingly .
EX Stage : receive ID Some control signals and corresponding operands from the stage , And carry out corresponding calculation or comparison operation accordingly , Output the result to MEM Stage .
MEM Stage : Yes DRAM Read or write .
WB Stage : The data obtained in the previous stage is selected according to the control signal and written into the corresponding register .
边栏推荐
- 使用aspose-slides将ppt转pdf
- Scientists develop two new methods to provide stronger security protection for intelligent devices
- TDengine 邀请函:做用技术改变世界的超级英雄,成为 TD Hero
- Understand neural network structure and optimization methods
- JS array splicing "suggested collection"
- 文件名设置导致writelines写入报错:OSError: [Errno 22] Invalid argument
- E+H二次表维修PH变送器二次显示仪修理CPM253-MR0005
- unity--newtonsoft. JSON parsing
- 视频文件太大?使用FFmpeg来无损压缩它
- 分布式文件存储系统的优点和缺点
猜你喜欢

提高效率 Or 增加成本,开发人员应如何理解结对编程?

Decompile the jar package and recompile it into a jar package after modification

HiTek电源维修X光机高压发生器维修XR150-603-02

1098 insertion or heap sort (PAT class a)

Reading and writing Apache poi

ucore lab4

了解神经网络结构和优化方法
![[200 opencv routines] 212 Draw a slanted rectangle](/img/cf/da8fff386d011c939946326c55671f.png)
[200 opencv routines] 212 Draw a slanted rectangle

【OpenCV 例程200篇】211. 绘制垂直矩形

有关二叉树的一些练习题
随机推荐
Installation and use of SVN version controller
不容置疑,这是一个绝对精心制作的项目
Advanced mathematics Chapter 7 differential equations
谷歌浏览器 chropath插件
Process 0, process 1, process 2
[200 opencv routines] 211 Draw vertical rectangle
12个网络工程师必备工具
提高效率 Or 增加成本,开发人员应如何理解结对编程?
【OpenCV 例程200篇】211. 绘制垂直矩形
[STM32] Hal library stm32cubemx tutorial 12 - IIC (read AT24C02)
Take you to play with the camera module
Pakistani security forces killed 7 terrorists in anti-terrorism operation
Shortcut key bug, reproducible (it seems that bug is the required function [funny.Gif])
Use CAS to complete concurrent operations with atomic variables
std::memory_order_seq_cst内存序
The background prompt module for accessing fastadmin after installation does not exist
Reading and writing Apache poi
Five page Jump methods for wechat applet learning
技术与业务同等重要,偏向任何一方都是错误
R语言plotly可视化:plotly可视化二维直方图等高线图、在等高线上添加数值标签、自定义标签字体色彩、设置鼠标悬浮显示效果(Styled 2D Histogram Contour)