[Computer Architecture-01] Introduction to Instruction Set Architecture and Microarchitecture

1. “Virtual” to “Real”

insert image description here

First of all, you can look at this picture. The following Physicsrefers to things that are visible, tangible or objective in our physical world, and human beings hope to map their work content or needs to the physical level in a certain way. Use the impact of physical changes to complete the content of human work. For example, Mr. Abacus, an early calculator, completed numerical calculations by flipping beads that were endowed with numerical meanings. But that's some simple work, so what about more complex tasks? Play video, calculate and generate spreadsheets, and automatically control the operation of a system environment. How can these tasks be mapped on the physical level? Think of it this way, wow! It's a complicated enough thing, the gap between the two is too big.

So in a broad sense, computer architecture is to build an abstract description, transform the problem layer by layer, and realize the specific level, which is used to connect the two levels and fill the gap in the middle. But its work is more than that. The computer architecture is so complex that of course we want to design a structure that does not change as much as possible or does not undergo major changes. Then we use this to complete the intermediate content layering of the bridge and refine it. The more detailed abstraction layer or other layers are used to solve small problems, so that there will be no earth-shaking changes due to a little change in the physical layer or application layer, so that the design can be used repeatedly, and will be available Transform physical things into applications that humans want.
( [注]:这里的解释是笔者概括性的解释,也许有点难理解,或者说笔者的描述不够好,还请见谅!)
insert image description here
This picture is an abstraction of the entire computer environment. The hierarchy from top to bottom indicates that the lower the level, the higher the degree of dependence, and the higher the level, the higher the degree of dependence. That is to say, the upper layer depends on the relationship of the lower layer. The top layer Applicationdescribes the application software (that is, some software programs we usually use, such as: WeChat, browser, Word, Visual Studio Codeetc.), while the next layer is the algorithm layer Algorithm, and the development of application software is inseparable from the algorithm structure. The implementation of the algorithm also depends on the programming language that implements it Programming Language.

The normal operation of these software depends on the resource management interface (Operating System / Virtual Machine)provided by , as well as the control and scheduling system to escort the operation of the software. In fact, the operating system and the virtual machine environment are also software, but they are slightly more basic. .

I want to look at the next few layers from the bottom up. The physical layer (Pyhsics)refers to the physical changes in the physical world according to the basic laws of physics, the movement rules of particles, etc. The device layer (Devices)generally refers to transistors, and the circuit (Circuits)refers to the use of transistors. Circuits of various scales, gates (logic gates) (Gates)refer to the "logic gates" (such as AND gates, OR gates, NOT gates, etc.) constructed by using circuits, and we come to our key research object registers The transport layer(RTL--Register-Transfer Level) is a layer of software implemented with a register transfer level description language (common languages ​​include Verilog, VHDL, Scalaetc.), and then go up to the micro-architecture(Microarchitecture) to design the chip structure, and then go up to the instruction(Instruction Set Architecture) set architecture . Provides a specification for software programming.

2. Computer development (No statement history)

insert image description here

This picture shows that the requirements of the upper-level application will cause the changes in the three layers we focus on in the middle, while the technical level of the lower layer will limit the changes in these three layers.

insert image description here
This picture is from "Computer Architecture: Quantitative Research Methods 5th Edition" (《Computer Architecture - A Quantitative Approach 5》). This picture 1978shows AX-11/780a logarithmic line chart of computers in different years and machines in years. The horizontal axis is the year timeline, and the vertical axis 1、10、100、1000...is logarithmic. , this picture tries to express that there are some very basic and key things in the computer architecture that are driving the development of the entire computer industry (the improvement of computer performance).

It can be seen that the lines in the figure can almost be seen as a straight line rising, which is what allows the performance of computers to increase at an exponential rate. There are two reasons for the rapid development of computers. One of them is computer architecture . Although this is very important, it is not the most critical. The most critical is the development of transistor technology . We must know that the operating speed and performance of a single transistor may not be able to develop at the same rate as the exponential growth rate, but how to make the computer performance increase at an exponential rate, the computer architect thought, just use more transistors! Getting more transistors to deliver more performance is what is often referred to as Moore's Law .

You should have heard of this term, and what he means is Gordon Moore said: "Every eighteen months to two years, you can use the same amount of dollars, but you will get twice the number of transistors. " It was the earliest version, and now it is slowly changing to say that your computer will be twice as fast every year, which is not what Gordon Moore said (Moore: "I don't take the blame!") He said Spending the same money can get twice the transistors, and sometimes it is translated as the number of transistors on the chip can double every year. This is not his original words, but the meaning is not too bad. (Moore: "You have made me bear too much!")
insert image description here
From the figure, we can see that there are two obvious turning points. First of all, look at the first one 1986. There is a rapid rise at the time node of . It was the RISC computer (Reduced Instruction Set Computer), or RISCcomputer, was invented. So when people invented the RISCfirst , there was an inflection point in computer performance.

insert image description here

There is another inflection point in the figure, which is between 2003 ~ 20072000 and 2000. Prior to this, the performance of sequential processors can maintain an exponential growth trend, but here the performance of sequential processors begins to expose its problems. In order to maintain computer performance The exponential growth of the processor has changed from a sequential processor (single-core processor) to a multi-core processor that has multiple cores on a single chip, but the multi-core processor still has its bottleneck, and there will be newer technologies in the future To solve the problem of computer performance stagnation. If computer performance stagnates, that means all of a sudden all computers stop growing, and no one buys new computer chips.

3. What is Computer Architecture/Instruction Set Architecture (Architecture or Instruction Set Architecture)

insert image description here

John_L._Hennessy and David A. Patterson will Architecturebe called Instruction Set Architecture. The following will directly use the instruction set architecture (Instruction Set Architecture) to express.

Q: What is instruction set architecture?

A: a instruction set architecture, or big A architecture is trying to provide the programmer some abstract machine model.


instruction set architecture

  • Programmer-visible state (memory, registers)
  • execution semantics
  • Input and output (I/O)
  • data type, size

The instruction set architecture is an attempt to provide programmers with an abstract machine model, and to provide programmers with some visualization of machine states, such as whether the machine has memory, whether there are registers, and also defines some operation instructions and some basic calculation instructions. And defines the operation mode of the instruction. For example, ADDthe instruction is a basic addition instruction whose actual semantics define how to fetch data from one register, add it to another register, and store it at the end.

Add two numbers and save them in another register. It seems that executing an addition instruction is not completed in one step. In fact, instructions are often not completed in one step. There are other operations that need to be processed, for example, IOinterrupt . Then it is necessary to define the instruction and actual semantics of an interrupt in the instruction set architecture, or how to input and IOoutput a piece of data, and how these operations interact with the processor. So the instruction set architecture also needs to IOdefine how the input and output work.

With input and output, you also need to consider the size of each operand, how much data is each operation? in one byte? Two bytes as a unit? four? So how long is a byte? So you also need to define the size and type of the data.

The instruction set architecture is an abstraction layer provided to the software, or such an abstraction layer (instruction set architecture) is provided for the software, so that the software will not change much. The instruction set architecture establishes a set of theoretical foundations for the program operation of the machine, that is, the machine should know how to run the program according to this, but does not clearly stipulate the size of different data structures and how fast things run. These practical execution problems will beConsidered in Microarchitecture (Microarchitecture)

With so many layers in the entire computer architecture, we need to be clear that when designing the entire computer architecture, that is, designing each layer, we need to balance . Therefore, the design of the instruction set architecture will affect the software program and micro-architecture , that is, it is necessary to implement a specific instruction set architecture while taking into account the design of the mutual influence between the upper and lower levels.

4. What is Microarchitecture/Organization

insert image description here

Q: What is a microarchtecture?

A: what microarchitecture and organization is really thinking about here is the tradeoffs as you’re going to implement a fixed instruction set architecture.


microarchitecture

  • How to achieve ISA tradeoffs for certain metrics (eg: pipeline depth, number of pipelines, Cachesize, peak power consumption, out-of-order execution, bus width, ALUwidth)

Because the instruction set architecture is generally fixed, in order to achieve multiple purposes or processors with different performances, different microarchitectures will be implemented according to the instruction set architecture according to some target indicators.

For example, Intelthe ISA X86is an instruction set architecture on which there are many different microarchitectural implementations, so there are server versions of high-performance processing and machines that focus on specific functions, although the inside of the chip looks completely different , but two processors can execute the same code because they use exactly the same instruction set architecture.

5. Comparison of instruction set architecture and microarchitecture for some examples

5.1. Same instruction set architecture but different microarchitecture

The following two processors both use X86the instruction set architecture, but the difference is that the designed microarchitecture is different, so that the two end up looking completely different, but both can run the same code because the instruction set architecture used by the two is completely different. same.

It can be seen that AMD Phenom X4the processor has 4a core, power consumption , and a125W decoding instruction , which supports out- of -order execution, and the frequency can reach . And there is only one core, but the power consumption is only one decoding instruction, which is smaller , but has the same size as the left , and can only be executed sequentially, and the frequency is only 1 ; this is the result of the microarchitecture weighing the processor indicators, according to the same instruction Different microarchitectures have been designed for the set architecture.364KBL1 I Cache64KBL1 D Cache512KBL2 Cache2.6GHzIntel Atom2W2L1 CacheL2 Cache1.6GHz

insert image description here

5.2. Different instruction set architectures and different microarchitectures

The following two processors use different instruction set architectures and different microarchitectures. The same code cannot run on the other processor.

X86The instruction set architecture used is mentioned above on the left , and the instructionIBM POWER7 set architecture used on the right. At the same time, you can see the following index parameters. The microarchitecture of the two is different. It should be noted that different instruction set architectures may be used, but the microarchitecture design may be the same, but they cannot execute each other's code.Power
insert image description here

6. Summary

The microarchitecture is more concerned with processor performance and other application indicators, while the instruction set architecture is more concerned with a software design factor.


Next article "[Computer Architecture-02] Machine Model"


If you think this article is helpful to you, please leave a like*^v^*
Please respect the author, and please indicate the source when reprinting! Thank you for your cooperation~
[Author]: Imagine Miracle
[Copyright]: This work is licensed under the "Attribution-Non-Commercial Use-Share Alike 4.0 International" license agreement.
[Link to this article]: https://blog.csdn.net/qq_36393978/article/details/128647553

Guess you like

Origin blog.csdn.net/qq_36393978/article/details/128647553