The word "processor" hides three separate things: the instruction set that software sees, the microarchitecture that organizes the hardware, and the physical implementation in silicon. Keeping those layers apart is what lets one program run on many different chips, and it lets engineers change one layer without breaking the others. This article explains each layer, shows what each one can and cannot change, measures the effect of changing the bottom layer alone, and looks at where the layers leak into each other.

12 min read | Beginner

What You'll Learn

  • Distinguish instruction set, microarchitecture and implementation
  • Explain why the separation matters in industry
  • Say which layer each design decision belongs to
  • Identify cases where a lower layer becomes visible to software

Three Layers of One Processor

Every processor can be described at three levels:

Three stacked layers: the ISA seen by software, the microarchitecture that organizes the hardware, and the implementation as a chip in a cell library and process

The instruction set architecture (ISA) is the contract with software. It defines the registers, the instructions, how they're encoded, how memory behaves and how traps work. A compiler needs nothing else. What an ISA Defines covers it in detail.

The microarchitecture is how one design carries out that contract: the number of pipeline stages, the branch predictor, the cache sizes, whether instructions run out of order. Software can't see any of it directly, though it can feel the difference in speed.

The implementation is how that organization becomes a physical chip: the manufacturing process, the library of logic gates, the layout, the supply voltage and the clock frequency.

These are independent choices, within limits. Many microarchitectures can implement one ISA, and one microarchitecture can be built in many implementations.

One Program, Many Processors

The great benefit of this separation is binary compatibility. A program compiled for RV32I runs on a tiny two-stage microcontroller, and on a large out-of-order server core, and gives identical results. The first might take 1 million cycles, and the second 300,000, at ten times the clock. Only the timing differs.

That allows a software ecosystem to outlive any particular chip. An x86 program from the 1990s still runs on a modern desktop, though the processor inside has changed beyond recognition. It lets vendors sell a range of products, from cheap to fast, all running the same software. And it means one team can work on a better pipeline while another builds compilers, with only the ISA between them.

Which Layer Is This?

Here is how to place common decisions:

DecisionLayerDoes software need a change?
adding a multiply instructionISAyes, recompile to use it
32 or 16 registersISAyes
five or eight pipeline stagesmicroarchitectureno
32 KB or 64 KB cachemicroarchitectureno
forwarding pathsmicroarchitectureno
a different gate libraryimplementationno
a move to a newer processimplementationno
clock frequencyimplementation, set by the two aboveno

Quick Check

Q: Which layer does each belong to? (a) Little-endian byte order. (b) A 2-way cache. (c) Running at 0.9 V rather than 1.1 V.

Show Answer

(a) ISA, as software can see it. (b) Microarchitecture. (c) Implementation.

Changing the Microarchitecture

A microarchitecture change leaves the program the same, and changes CPI and perhaps the clock. Forwarding is a clear example. A small five-stage core was built with and without it, running the same programs with the same compiler. The speedup ranged from about 1.17 to about 1.7, for about 2.5 percent more area, as PPA Trade-offs and Amdahl's Law shows. Not one instruction changed, and no program needed recompiling. The pipeline chapter and everything after it in this tutorial describe techniques of this kind: prediction, caches, out-of-order execution. They are all at this layer.

Changing the Implementation

The same RTL can also be built in different ways. Take one small core and synthesize it, turning it into gates, using four cell libraries from the same 130 nm process:

Two bar charts: the core is about 29 percent smaller in the high-density library than in the other three, while flip-flop delay is lowest in the high-speed library and highest in the low-speed one

A standard cell library is a chip maker's catalog of ready-made logic gates, characterized for speed and power. A high-density library packs them more tightly: the same core came out about 29 percent smaller than in the other libraries, whose cells share one footprint. A high-speed library has lower gate delays and higher leakage, and a low-speed library the reverse. The RTL did not change at all, so the instructions, the cycle counts, and the CPI are all unchanged. Only the area, the frequency and the power moved.

Moving to a new process node is a stronger version of the same thing. It usually gives more speed and lower energy per operation, or a smaller die, with no change to the microarchitecture. For decades, a good share of each generation's performance came from this alone. That slowed around 2005, and today gains have to be earned at the upper layers.

Where the Layers Interact

The layers are independent in principle, but each constrains its neighbors.

The ISA shapes the microarchitecture. RISC-V's fixed instruction format makes decoding several instructions per cycle easy, while x86's variable lengths need much more logic. Delay slots, once built into an ISA for a five-stage pipeline, became a burden on later designs with different pipelines. An ISA lasts for decades, so a decision that suits today's design can be a nuisance for a long time.

The implementation shapes the microarchitecture. Clock frequency depends on the logic depth per stage, which is a microarchitecture choice, and also on gate speed, which is an implementation fact. If the wires in a process are slow, the design may need an extra pipeline stage just to cross a block. Memory macros come in certain sizes, so a cache size may be chosen by what the process offers.

The microarchitecture shapes the ISA as well, in the long run. New instructions are often added because of what hardware can do cheaply. ISA Design Choices gives examples.

When the Layers Leak

The separation isn't perfect, and some lower-layer details become visible to software.

  • Timing. A program can measure how long things take, and then it can see a cache or a predictor. Performance tuning does that on purpose. Attacks such as Spectre do it to steal data.
  • Memory ordering. The consistency model exists because hardware buffers change what other cores see.
  • Pipeline-specific tuning. A compiler's -mtune option schedules code for one microarchitecture, as Compiler Optimization Levels describes. The code runs anywhere, but it runs best on that one.
  • Cache management. Drivers that share buffers with DMA need to know about caches, even though the ISA tries to hide them.
  • Errata. A bug in one implementation may need a software workaround on that chip alone.

Where Does This Matter?

Business models are built on these layers. Arm sells architecture licenses, which let a company design its own microarchitecture for the Arm ISA, and also sells ready-made core designs. RISC-V makes the ISA free, and companies compete at the microarchitecture level. A foundry such as TSMC or Samsung supplies the implementation layer for many designers. A single RISC-V or Arm core design can be built in several processes, and tuned for speed in one and for low power in another.

A Worked Example: Same Program, Two Chips

Take a program of 1 million instructions, and two chips that implement the same ISA. Chip A is a small three-stage core with a CPI of 1.3 at 200 MHz. Chip B is a large out-of-order core with a CPI of 0.5 at 2 GHz. These numbers are assumptions for this example. Using the performance equation:

chip A:  1,000,000 x 1.3 x 5 ns    = 6.5 ms
chip B:  1,000,000 x 0.5 x 0.5 ns  = 0.25 ms

Chip B is 26 times faster, and the program didn't change at all. The instruction count is the same on both, because that belongs to the ISA and the compiler. The CPI differs because of the microarchitecture. The clock differs because of both the microarchitecture and the implementation. So the speed difference breaks down neatly: a factor of 2.6 from CPI, and a factor of 10 from the clock. If a third chip had B's design at 1 GHz in an older process, B would beat it by exactly 2, a gain that comes only from the clock. This kind of breakdown tells you which layer gets the credit for a result.

How an ISA Grows

An ISA doesn't stay fixed forever. It must change slowly, though, because old software has to keep running. The usual rule is that new instructions may be added, but old ones are never removed or changed. x86 has grown this way for more than forty years, and Arm has done something similar. RISC-V is built around the idea: a small frozen base, with optional extensions, each with its own letter or name.

Options create a new problem. If each chip picks its own set of extensions, software cannot know what it can use. RISC-V's answer is profiles: named sets of extensions that a whole class of processors agree to provide, so that an operating system can target one profile and run on all of them. Software can also check at run time which features exist, and choose a faster routine if it can. A library function such as memcpy often has several versions, and picks one when the program starts.

Why Vendors Keep the Layers Apart

The separation also shapes how companies work. Because software depends only on the ISA, a chip company can replace its microarchitecture every generation without asking anybody's permission. It can use the same design in a laptop and in a server, at different voltages and frequencies. And it can move a design to a new foundry with no change to the software. Each layer can be improved, licensed or bought separately. Without those clean boundaries, every new chip would need all of its software rewritten.

Layers Below and Above

Real systems have even more layers. Below the implementation are transistor physics and the manufacturing process. Above the ISA come the ABI, the operating system and the language. Each layer provides a contract to the one above, and hides the one below. That is how a system of billions of transistors can be built by people who only understand a few layers each.

Quick Check

Q: Two chips implement RV32IM. One takes 40 cycles for a divide, and the other 3. Is this a difference in the ISA? Can a correct program depend on it?

Show Answer

No. Both follow the same ISA, and the timing is a microarchitecture matter. A correct program must not rely on how many cycles an instruction takes. If it needs a time delay, it should use a timer.

Software can even cross the ISA boundary. Binary translation rewrites a program for one ISA into instructions for another, which is how Apple kept x86 programs running when its computers moved to Arm.

Common Mistakes

Mistake #1: Mixing up "architecture" and "microarchitecture"

Saying "the architecture has a 32 KB cache" is common but wrong: that's the microarchitecture. It matters, because the ISA is a promise to software, while the cache size isn't.

Mistake #2: Comparing cores in different implementations

A core that is faster in a 5 nm process may be worse than another in the same process. Compare in the same process and library, or scale carefully.

Mistake #3: Writing software that depends on timing

Delay loops tuned to one chip break on the next. Use a hardware timer, since instruction timing isn't part of the contract.

Practice Exercise

Challenge: What Changed?

For each change, name the layer and which factors of the performance equation (instruction count, CPI, clock period) can move. (a) Add a hardware multiply instruction and recompile. (b) Add a branch predictor. (c) Move to a process with 30 percent faster gates. (d) Add a pipeline stage to raise the clock. (e) Change the compiler's optimization level.

Hint

Instruction count needs a change in software or in the ISA. See The Performance Equation.

Solution

(a) ISA: instruction count falls, and CPI may change. (b) Microarchitecture: CPI falls. (c) Implementation: the clock period falls. (d) Microarchitecture: the clock period falls and CPI rises. (e) Software, none of the three layers: instruction count and CPI both change, and the hardware doesn't.

Summary

  • The ISA is the contract with software, the microarchitecture organizes the hardware, and the implementation is the physical chip.
  • Separating them lets one program run on many chips, and lets each layer change alone.
  • Microarchitecture changes CPI and timing; forwarding gave up to 1.7 times the speed with no software change.
  • Implementation changes area, speed and power: one library gave a core about 29 percent smaller, with the same RTL.
  • The layers interact, and they leak, through timing, memory ordering and cache management.
Did you find what you were looking for?

Quiz

No quiz questions available for this article.