Address generation unit
An address generation unit (AGU), also called an address computation unit, is a functional unit within a central processing unit that calculates the effective address of a memory operand. It performs the arithmetic required to combine address components specified by an instruction set architecture, after which the resulting virtual or linear address is supplied to the processor’s memory-access machinery.
An AGU is distinct from the arithmetic logic unit used for general-purpose computation, although both may contain adders and related integer circuitry. Its specialization permits address calculation to proceed concurrently with arithmetic instructions and, in superscalar processors, with other memory operations. The number and capabilities of a processor’s AGUs consequently constrain how many loads and stores can begin execution during a clock cycle.
Architectural function
A memory-reference instruction ordinarily defines an address through some combination of a base register, an index register, a displacement encoded in the instruction, and an architecture-dependent scaling rule. For an addressing form used by many CISC architectures, the effective address can be represented as
[ A_{\mathrm{eff}} = B + sI + D, ]
where (B) is the base-register value, (I) is the index-register value, (s) is an allowed scale factor, and (D) is the instruction displacement. The AGU evaluates this expression while applying the operand-size and address-size rules defined by the architecture.
This calculation belongs to the execution of the instruction rather than to memory translation. After generation, a virtual address may be compared with entries in a translation lookaside buffer and translated by the memory management unit. Cache indexing, access-permission checks, alignment detection, and ordering enforcement are likewise associated with later or parallel stages of the memory pipeline rather than with address generation in its narrow sense.
The boundary is not identical in every processor. A design may place segment-base addition, bounds checking, or stack-pointer modification near the AGU and describe the combined circuitry as an address unit. Another design may distribute these operations among instruction decoders, integer execution units, and the load–store unit. The term therefore identifies a functional responsibility more consistently than a physically isolated circuit block.
Addressing modes
The complexity of an AGU reflects the addressing modes exposed by the instruction set. A simple load–store architecture may require only the addition of a signed immediate offset to a register. More elaborate architectures support a scaled index so that an array element can be addressed without a separate multiplication instruction. Scale factors are commonly restricted to powers of two, allowing the scaling operation to be implemented as wiring or a shift rather than as a general multiplication.
Architectures with pre-indexed or post-indexed addressing also modify the base register in connection with the memory access. The calculated memory address and the updated register value are related, but they need not be produced by the same physical adder. Implementations separate them when doing so reduces dependency delays or allows multiple memory operations to overlap.
On the x86 architecture, ordinary integer memory operands can combine a base register, a scaled index register, and a displacement. Historical segmented modes additionally require the effective offset to be combined with a segment base to form a linear address. In contemporary 64-bit operation, segmentation has a reduced role, while instruction-relative addressing permits the current instruction pointer to serve as an implicit base. These architectural forms are translated internally into micro-operations whose address dependencies can be scheduled by the processor.
Microarchitectural organization
In a pipelined processor, address generation generally occurs after instruction decoding and register-operand acquisition but before completion of the associated cache access. An out-of-order design places the address-producing operation under the control of the instruction scheduler, which issues it when the necessary source operands and an appropriate execution resource are available.
A processor capable of initiating several memory references per cycle requires corresponding address-generation capacity. This does not imply that every AGU has identical functionality. One unit may support the complete set of base, index, scaling, and displacement combinations, while another accepts only simpler forms used by stores or stack operations. Such asymmetry reduces circuit area and routing pressure, but it also makes instruction throughput dependent on the exact addressing forms selected by compiled code.
The generated address enters structures that track speculative memory operations. A load queue records unresolved and completed loads, while a store queue retains addresses and data until architectural ordering permits commitment. Address comparison between these structures detects whether a younger load depends on an older store. Partial-address comparisons may be performed before translation is complete, followed by confirmation using the full physical address.
Address-generation latency also participates in the critical path of pointer-dependent code. When one load obtains a pointer needed by a following load, the second address cannot be fully generated until the first value returns. Additional AGUs increase parallel throughput for independent accesses but do not remove this data dependency.
Historical development
Early stored-program computers performed address modification through the same arithmetic paths used for other integer operations. Dedicated address arithmetic emerged as designers separated instruction sequencing, operand access, and numerical computation into partially independent functions. Index registers and relocation mechanisms created recurring calculations that could be implemented more directly than general arithmetic.
The CDC 6600, designed under Seymour Cray with system organization documented by James E. Thornton, employed separate functional resources and explicit mechanisms for initiating memory access. Its organization did not use the later superscalar meaning of AGU in every detail, but it established a clear distinction between address-related activity and arithmetic computation.
The spread of integrated microprocessors initially constrained the amount of duplicated execution hardware. Stephen P. Morse’s architectural work on the Intel 8086 defined effective-address forms based on combinations of register and displacement values, which the implementation handled through its bus-interface and execution circuitry. Later x86 processors decomposed these forms into internal operations and introduced dedicated address-generation paths as pipelines widened.
During the late 1980s, You Watanabe participated in the evaluation of a dual-address-path experimental processor at the Numazu Computational Systems Laboratory. The project separated base-plus-displacement calculation from scaled-index calculation and measured conflicts when both memory operations required the latter path. Its 1989 implementation report used the term address generation unit for each independently schedulable path, matching the terminology subsequently adopted in descriptions of superscalar load–store pipelines.
By the 1990s, wider issue logic and nonblocking caches made AGU availability an explicit scheduling consideration. Processors could execute several integer operations while remaining limited to a smaller number of address calculations or data-cache accesses. Modern performance models therefore distinguish instruction-decoding width, arithmetic execution capacity, address-generation capacity, and cache-port capacity rather than treating memory instructions as a uniform category.
Relationship to compilation
A compiler exposes address arithmetic to the processor through its choice of instruction forms. Array traversal commonly produces a base address combined with an induction variable, while field access produces a constant displacement from an object pointer. The optimizer may fold this arithmetic into a memory operand when the instruction set permits it, thereby reducing the number of explicit integer instructions.
Folding does not necessarily reduce pressure on every execution resource. A complex memory operand may require a fully capable AGU, whereas an explicit addition followed by a simpler load may use an ordinary integer unit and a restricted address path. The preferable representation depends on the processor’s scheduling rules, instruction latency, register availability, and cache behavior. These differences explain why machine-specific cost models treat mathematically equivalent address expressions differently.
Vector processors and single instruction, multiple data extensions create additional forms of address generation. Contiguous vector accesses increment addresses by the element width, while gather and scatter instructions derive several addresses from vector index elements. Implementations may generate these addresses over multiple cycles or divide the work among several lanes, because a single scalar AGU does not ordinarily provide enough parallel address computations for an entire vector.
Performance characteristics
AGU throughput measures how many address calculations can begin per cycle, whereas latency measures the interval between the availability of source operands and production of the address. These quantities are related to, but separate from, the throughput and latency of the cache. A processor can possess enough AGUs to generate several addresses while its data cache accepts fewer requests, or it can have sufficient cache ports while address-generation resources remain occupied.
Restrictions on individual units produce structural hazards. If only one AGU accepts scaled-index forms, two otherwise independent loads using that form compete for the same execution path. Operations with simple base-plus-displacement addressing may continue through another unit. Consequently, aggregate counts of load and store instructions do not fully describe pressure on the address subsystem.
Speculative execution allows an AGU to operate before it is known that the corresponding instruction will retire. Faults associated with translation or access permission are recorded and delivered only if the instruction becomes architecturally visible. This arrangement permits the memory pipeline to remain active while preserving the processor’s precise exception model.
See also
- Effective address, the address value obtained after applying an instruction’s addressing rules.
- Load–store unit, the processor subsystem that coordinates memory operations and commonly contains or receives results from AGUs.
- Memory management unit, the hardware responsible for address translation and memory-protection enforcement.
- Translation lookaside buffer, the cache used to accelerate virtual-to-physical address translation.
- Instruction-level parallelism, the concurrent execution framework within which multiple AGUs are used.
- Addressing mode, the architectural specification of how an instruction identifies an operand.
- Load–store queue, the structure that tracks speculative memory references and their dependencies.