当前位置:网站首页>Write your own CPU Chapter 10 - learning notes
Write your own CPU Chapter 10 - learning notes
2022-07-06 09:55:00 【code_ master2020】
This chapter begins with MIPS32 Coprocessor in architecture , It explains the function of coprocessor . because OpenMIPS Plan to implement one of the coprocessors -CP0, therefore 10.2 Section special introduction CP0, And then in 10.3 Section implements coprocessor CP0, Its implementation is a little similar HI、LO Register implementation .10.4 Section describes coprocessor access instructions mfc0、mtc0 The format of 、 effect 、 usage .10.5 Section gives the implementation idea of coprocessor access instructions , And the modification of the system structure .10.6 Section modified OpenMIPS. Realize the coprocessor access instruction , Finally, write the test program , stay ModeSim Simulation verification is carried out in .
10.1 Introduction to coprocessor
The term coprocessor is often used to denote an optional component of a processor , Responsible for processing an extension of the instruction set , It has registers independent of the processor core .MIPS32 The architecture provides up to four coprocessors , Namely CP0~CP3, effect
As of this chapter , our OpenMIPS The processor implements many instructions , But these instructions are used for operations , The actual processor also supports a wide range of other operations , for example : Interrupt handling 、 Provide optional configurations 、 Observe and control the system cache or clock 、 Address translation, etc .MIPS32 Architecture defined coprocessor CP0 The role of is to help achieve the above wide range of operations .CP0 The main work is as follows :
-- To configure CPU Working state : accord with MIPS32 The hardware of the architecture is usually very flexible , You can read / Write one or some internal registers to change some very fundamental CPU characteristic ( Such as : Change the byte order from MSB Turn into LSB Or from LSB Turn into MSB).
-- Cache control : accord with MIPS32 Architecturally CPU Generally, the cache controller is integrated , Used to control 、 read 、 Write cache .
-- Abnormal control : The detection and handling of exceptions are carried out by CP0 Some control registers in to define and control .
-- Storage snap in control : Reasonably control the storage area of the system 、 Management and distribution , It's mainly about MMU、TLB Some configuration of 、 management 、 visit .
-- other : When you want to integrate additional functions into CPU in , But it is not convenient to access as a peripheral , Often in CP0 Add some modules to realize these functions . for example : The clock 、 Time counter 、 Parity error detection, etc .
10.2 Coprocessor CP0 Register in
From the table, we can find that many registers are related to cache 、MMU、TLB、 Debugging related , and OpenMIPS The design goal of is a lightweight processor , It is not intended to implement caching 、MMU、TLB、 Debugging and other complex functions .
Let's introduce this in turn 7 Format of registers 、 effect .
1.Count register ( Label for 9)
Count Register is a non-stop counting 32 Bit register , The counting frequency is generally the same as CPU Same clock frequency , When the count reaches 32 When it is the upper limit of unsigned number , From 0 Start counting again .Count Register readable 、 Can write .
2.Compare register ( Label for 11)
Compare A register is a 32 Bit register , And Count Registers together complete the timing interrupt function . When Count The count value of the register and Compare When the values in the register are the same , A timed interrupt will occur . This interruption will remain , Know that data is written Compare register .Compare Register readable 、 Can write
3.Status register ( Label for 12)
Status Register is also a 32 position 、 Can be read 、 Writable registers , Used to control the operation mode of the processor 、 Interrupt enable and diagnostic status
CU3-CU0
Indicates whether the coprocessor is available , Control the coprocessor separately CP3、CP2、CP1、CP0. by 0 when , Indicates that the corresponding coprocessor is unavailable 1 when , Indicates that the corresponding coprocessor is available . about OpenMIPS In terms of processors , Only coprocessors CP0 Therefore, you can set this field to 4'b0001
RP
Indicates whether low power mode is enabled , But whether and how to implement it depends on the specific processor , such as : Some processors can reduce the working frequency 、 Working voltage , To achieve low power consumption ,OpenMIPS The processor does not implement these functions , So this sub paragraph has no effect .
4.Cause register ( Label for 13)
Cause The register mainly records the cause of the latest exception , Also controls software interrupt requests .Cause The fields of the register are shown in the figure , except IP[1:0]、IV and WP, The remaining fields are read-only .
10.3 Coprocessor CP0 The implementation of the
边栏推荐
- 嵌入式中的合作开发--函数指针
- Canoe cannot automatically identify serial port number? Then encapsulate a DLL so that it must work
- Hard core! One configuration center for 8 classes!
- Contest3145 - the 37th game of 2021 freshman individual training match_ C: Tour guide
- 33岁可以学PLC吗
- Elk project monitoring platform deployment + deployment of detailed use (II)
- 五月刷题03——排序
- Take you back to spark ecosystem!
- Configure system environment variables through bat script
- 四川云教和双师模式
猜你喜欢
Target detection -- yolov2 paper intensive reading
What you have to know about network IO model
单片机实现模块化编程:思维+实例+系统教程(实用程度令人发指)
Some thoughts on the study of 51 single chip microcomputer
C杂讲 浅拷贝 与 深拷贝
[NLP] bert4vec: a sentence vector generation tool based on pre training
机械工程师和电气工程师方向哪个前景比较好?
C#/. Net phase VI 01C Foundation_ 01: running environment, process of creating new C program, strict case sensitivity, meaning of class library
[deep learning] semantic segmentation - source code summary
Embedded development is much more difficult than MCU? Talk about SCM and embedded development and design experience
随机推荐
What you have to know about network IO model
大学C语言入门到底怎么学才可以走捷径
[deep learning] semantic segmentation: paper reading: (CVPR 2022) mpvit (cnn+transformer): multipath visual transformer for dense prediction
【深度学习】语义分割:论文阅读:(CVPR 2022) MPViT(CNN+Transformer):用于密集预测的多路径视觉Transformer
How does the single chip microcomputer execute the main function from power on reset?
Mapreduce实例(四):自然排序
嵌入式開發中的防禦性C語言編程
Constants and pointers
June brush question 01 - array
硬件工程师的真实前途我说出来可能你们不信
MapReduce instance (x): chainmapreduce
Cap theory
Research and implementation of hospital management inpatient system based on b/s (attached: source code paper SQL file)
通过bat脚本配置系统环境变量
May brush question 26 - concurrent search
There are software load balancing and hardware load balancing. Which one to choose?
五月刷题02——字符串
The replay block of canoe still needs to be combined with CAPL script to make it clear
[Yu Yue education] reference materials of power electronics technology of Jiangxi University of science and technology
CANoe仿真功能之自动化序列(Automation Sequences )