Saltar al contenido ForoHackers

Microarchitecture: start here

Microarquitectura
#493 · Ophuscado · · Denunciar

Microarchitecture is how a processor implements its instruction set: pipeline stages, caches, predictors and execution units. Two chips can run the same programs and differ wildly in speed and energy. It is where performance, power and area are traded against each other, and where side channels come from.

Key concepts

  • Pipeline and hazards: data, control and structural hazards, solved by forwarding, stalls and prediction.
  • Out-of-order execution: instructions run when their inputs are ready, then retire in program order.
  • Branch prediction: guessing the direction of a branch so the front end never waits.
  • Cache and memory system: levels, associativity, replacement, prefetching and coherence between cores.
  • Speculation: work done before it is known to be needed, and undone if wrong, which leaves traces.

Vocabulary

  • Reorder buffer: the structure that lets instructions finish out of order but commit in order.
  • Issue width: how many instructions the core can start per cycle.
  • Cache coherence: the protocol that keeps each core's view of memory consistent.
  • Side channel: information leaked through timing or shared state rather than the program's output.

What to study, in order

  1. A five-stage in-order pipeline and its hazards, drawn cycle by cycle.
  2. Write a cycle-level simulator of that pipeline in a language you know.
  3. Add a branch predictor and measure its accuracy on real traces.
  4. Study scoreboarding and register renaming, then out-of-order execution.
  5. Microbenchmark a real machine: cache sizes, line size and branch penalties.

Related tags

#computer-architecture #digital-design #performance #hardware-security

Inicia sesión o únete para responder.