The register unit (often called the register file) is the microprocessor’s fast, on-chip storage that holds operands and state for the pipeline. It’s where instructions read their input values and write results, every single cycle.
What it includes
Architectural (programmer-visible) registers
- General-purpose registers (GPRs): integer operands/results.
- Special registers: PC (program counter), SP (stack pointer), LR/RA (link/return), FP (frame pointer), PSR/FLAGS (condition codes).
- Floating-point/SIMD/vector registers (if the ISA has them).
- Control/Status registers (CSR/SFR): control bits, exception state, timers, etc. (more common as separate banks in MCUs).
Microarchitectural structures (out-of-order cores)
- Physical register file (larger than the architectural set).
- Register renamer (maps architectural → physical regs to remove false dependencies).
- Reorder buffer / retirement logic (ensures precise state).
What it does each cycle
- Decode/Read: Provide source operands to ALUs/LSUs via multiple read ports.
- Writeback: Accept results from execution units via write ports.
- Update flags/state: Set condition codes, exception bits, etc.
- Forwarding/bypass (outside the file): Short-circuit recent results to new consumers to avoid stalls.
Key design parameters
- Width & count: e.g., 32×32-bit, 32×64-bit; vectors may be 128/256/512+ bits.
- Ports: Common integer file is 2-read/1-write for 3-operand ISAs; superscalar adds more ports (area/power expensive).
- Latency: Usually 1 cycle to read; writeback timing must meet setup to be readable next cycle (or use bypass).
- Organization: Unified vs. split (int vs. FP/Vector), banked (ARM banked modes), windows (SPARC).
- Reliability: Parity/ECC, reset values, retention across low-power modes.
Related but different
- Pipeline latches (IF/ID/EX/MEM/WB) are not architectural registers.
- Memory-mapped I/O registers in microcontrollers (SFRs) are control/status registers accessible via load/store—distinct from the core’s operand register file.
Why it matters
- Determines IPC and Fmax via port pressure and bypass complexity.
- Impacts code density & performance (ISA register count/width).
- Drives power/area (multi-ported SRAMs are pricey).
- Enables advanced execution (renaming removes WAR/WAW hazards).
In one line: the register unit is the CPU’s high-speed working set—storing operands, results, and state—interfacing tightly with decode, execute, and writeback to keep the pipeline fed every cycle.
Top comments (0)