CPU Architecture
CPU architecture covers the internal design of processors: instruction pipelines, execution units, branch predictors, caches, and the microarchitectural features that determine how fast instructions complete. It explains why the same code runs at different speeds on different chips.
itComputer architecture and hardware | OpenSkills.info
Course pathWalk it in order
Look it upDip in anytime
Go furtherLeaves this page
Don't Panic
Don't Panic: CPU Architecture
A CPU turns machine instructions into observable work. It sounds like a job description written on a very small business card, but it is enough to start. A program supplies instructions. The CPU fetches one, decodes it, finds operands, performs the operation, records the result, and chooses where to look next. Without that path, software is a detailed list with nobody moving down it.
The durable distinction is between an instruction set architecture, or ISA, and a microarchitecture. The ISA is the contract visible to software: instructions, registers, memory behavior, exceptions, and privilege rules. A microarchitecture is the machinery chosen to keep that contract. Two processors can run the same machine code while having different pipelines, caches, predictors, timing, and energy use. Compatibility does not mean identical manners.
Modern CPUs overlap the instruction path. While one instruction executes, another may decode and another may be fetched. That is a pipeline, and it improves throughput when the work cooperates. Unfortunately, work has a habit of being related to other work. A result may not exist yet, a branch may not reveal the next address, or two operations may want one resource. The CPU then stalls, forwards a result, predicts, or finds independent work. None of these is magic. They are ways to keep useful work ready while the inconvenient part catches up.
The surprising fact is that a CPU can be busy without making the program finish quickly. A wide execution engine cannot rescue a chain of dependencies. A fast clock cannot make main memory answer sooner. More cores cannot split a serial task into polite pieces because a brochure has introduced them. Ask where useful work waits: the front end, an execution resource, a branch redirect, a cache or TLB miss, memory traffic, or the lack of independent work.
Memory deserves its own quiet alarm bell. Registers and caches are close to execution, while main memory is farther away. Locality means reusing nearby or recent data so the hierarchy can help. Virtual addresses add a translation path, and the TLB caches recent translations. Data-layout changes can therefore alter elapsed time even when the algorithm's mathematical result is unchanged. The machine has not become offended. It has merely had to wait somewhere else.
Read the intro for the contract, pipeline, memory, and privilege model. Use the slides when relationships matter more than detail, and keep the cheatsheet nearby for hazards, cache events, translations, and multicore terms. The reference links lead from a small processor model to real ISA manuals. The exercise then gives the waiting question a stopwatch, which is less glamorous than a clock-frequency argument and considerably more useful.
Where this skill leads
Relevant careers
See how this topic contributes to broader role-level skill maps.
Sources
- https://developer.arm.com/-/media/Arm%20Developer%20Community/PDF/Learn%20the%20Architecture/Introducing%20the%20Arm%20architecture.pdf?revision=0b6b67ea-edd7-4975-b23c-d4904ac0cb35
Supports
- Architecture as the software-visible functional specification
- Microarchitecture as implementation details including pipelines, caches, and timing
- Different microarchitectures implementing one compatible architecture
- In-order and out-of-order implementation examples
- https://docs.riscv.org/reference/home/index.html
Supports
- Current ratified unprivileged and privileged RISC-V specification sets
- Base instruction sets, extensions, profiles, and privileged architecture as separate specification areas
- https://docs.riscv.org/reference/isa/unpriv/intro.html
Supports
- ISA as a software-visible interface independent of a particular microarchitecture
- Separation of unprivileged instructions from privileged architecture
- Instruction-set extensions and implementation flexibility
- https://docs.riscv.org/reference/isa/unpriv/rv32.html
Supports
- General-purpose registers and program-counter state
- Register operands, instruction encodings, and control-flow changes
- https://docs.riscv.org/reference/isa/unpriv/rvwmo.html
Supports
- Memory consistency as rules for values returned by loads
- Cross-hart observations under RVWMO
- Explicit synchronization through fences and atomic instructions
- Distinction between a memory model and a required cache implementation
- https://www.intel.com/content/www/us/en/developer/articles/technical/intel-sdm.html
Supports
- Intel architecture and programming environment
- Basic architecture and instruction-reference organization
- Memory management, protection, interrupts, exceptions, and multiprocessor support
- Optimization documentation for processor implementation behavior
- https://www.intel.com/content/www/us/en/developer/articles/technical/software-security-guidance/technical-documentation/hardware-behavior-related-to-speculative-execution.html
Supports
- Control-flow and data prediction
- Speculative execution before assumptions resolve
- Retirement of correct work and squashing of mispredicted work
- Transient execution effects and security implications
- https://www.intel.com/content/www/us/en/developer/articles/technical/software-security-guidance/best-practices/refined-speculative-execution-terminology.html
Supports
- Out-of-order execution and speculative use of predicted values
- Architectural and microarchitectural effects of transient instructions
- https://developer.arm.com/-/media/Arm%20Developer%20Community/PDF/Learn%20the%20Architecture/LearnTheArchitecture-MemoryManagement-101811_0100_00_en.pdf?revision=1fdc3375-d81c-4457-b786-04fb98557de0
Supports
- Virtual-to-physical address translation through translation tables
- TLBs as caches of interpreted translations
- Address-space permissions and translation faults
- https://ocw.mit.edu/courses/6-004-computation-structures-spring-2017/pages/c9/c9s1/
Supports
- Stored-program processor organization
- Program counter, instruction fetch, decode, datapath, control, and next-address behavior
- ISA as a functional contract between software and hardware
- https://ocw.mit.edu/courses/6-004-computation-structures-spring-2017/pages/c15/c15s1/
Supports
- Pipelining as overlapped instruction execution
- Latency and throughput distinctions
- Data and control hazards, stalls, forwarding, and branch handling
- Workload instruction count, cycles per instruction, and clock period as performance factors
- https://ocw.mit.edu/courses/6-004-computation-structures-spring-2017/pages/c14/c14s1/
Supports
- Cache hits, misses, fills, and hierarchy levels
- Temporal and spatial locality
- Working sets and storage latency-capacity tradeoffs
- Separate instruction and data cache roles
- https://man7.org/linux/man-pages/man1/perf-stat.1.html
Supports
- perf stat as a command for counting performance-monitoring events during a workload
- Selection of hardware event names for measurement
- https://www.intel.com/content/www/us/en/newsroom/opinion/chip-that-changed-world.html
Supports
- Intel 4004 introduction in November 1971
- The 4004 as a programmable microprocessor for a calculator
- https://www.intel.com/content/www/us/en/history/virtual-vault/articles/the-8086-and-the-ibm-pc.html
Supports
- Intel 8086 introduction in 1978
- The 8086 architecture as a template for later processor families
- https://www.intel.com/pressroom/kits/quickrefyr.htm?pStoreID=nar
Supports
- Intel386 release in October 1985
- Historical Intel processor release dates
- https://timeline.intel.com/1993/the-birth-of-pentium
Supports
- Pentium release in 1993
- Pentium as Intel's fifth-generation x86 processor
- https://ir.amd.com/financial-information/sec-filings/content/0001012870-03-001181/d10k.htm
Supports
- AMD plans for the April 2003 Opteron introduction
- x86-64 compatibility with existing 32-bit software
- https://docs.riscv.org/reference/isa/v20250508/unpriv/history.html
Supports
- RISC-V ISA definition beginning in summer 2010
- Early RISC-V silicon implementations and the open ISA's research origin
- https://www.apple.com/newsroom/2020/11/apple-unleashes-m1/
Supports
- Apple M1 introduction in November 2020
- M1 as Apple's first chip designed specifically for Mac systems
- M1 unified memory architecture
- https://www.intel.com/content/www/us/en/developer/articles/technical/hybrid-architecture.html
Supports
- Intel 12th-generation performance hybrid architecture
- Performance-cores and Efficient-cores as distinct core types
- Operating-system scheduling and Thread Director considerations
- https://www.intel.com/content/www/us/en/products/details/processors/core.html
Supports
- Intel Core processor family product information
- https://www.amd.com/en/technologies/zen-core.html
Supports
- AMD Zen architecture and Ryzen processor family
- Branch prediction, wider pipelines, execution resources, and chiplet design
- https://www.qualcomm.com/laptops
Supports
- Snapdragon X series platforms for laptops, desktops, and tablets
- Snapdragon X system-level client computing positioning
- https://www.arm.com/products/cloud-datacenter
Supports
- Arm Neoverse infrastructure compute platform
- CPU designs and system architecture for cloud and data-center workloads
- https://www.brendangregg.com/perf.html
Supports
- Hardware-counter sampling for cache misses, memory stall cycles, and other low-level events
- perf usage examples for CPU performance analysis
