Course: Computer Architectures
Professor: E. Sanchez
Source: Multicycle operations, ASE 2026/27, 42 slides
Numbering: Lecture 05 follows the naming agreed in the earlier chat; the PDF itself has no lecture number.
Lecture summary
Complex operations break the assumption that every instruction uses the same short execution path. Follow the timing consequences from one functional unit to the performance of the whole pipeline.
A simple pipeline assumes a short execution stage, but complex operations may need several cycles. Separate execution paths let such operations take longer without forcing every instruction to use a slower clock. Different completion times then create additional scheduling problems. Multicycle Operations
To schedule those paths, distinguish when a result becomes usable from when the same unit can accept another operation. Latency concerns a dependent consumer; initiation interval concerns repeated use of a unit. A pipelined unit can accept new independent work before its earlier result is ready. Latency and Initiation Interval
Even independent instructions can conflict when hardware cannot serve them at the required time. An occupied divider or several simultaneous requests for one write port create structural hazards. The scheduling decision must consider when resources will be needed, not only whether they are free now. Structural Hazards in Multicycle Pipelines
Resource availability is only part of correctness. A reader must receive the intended earlier result, and multiple writers must leave the correct final value. RAW hazards concern reading before a result is ready; WAW hazards concern writes completing in an incorrect order. RAW and WAW Hazards
These constraints must be checked before an instruction is allowed to proceed. In the lecture’s model, decode checks resources, source values and destination conflicts, stalling when issuing would be unsafe. This connects the abstract hazard categories to a concrete control decision. Hazard Detection in ID
The lecture then makes timing concrete through the R4000 example. Its eight-stage integer pipeline divides work more finely, including memory access, to support a higher clock frequency. More stages also change when results and branch decisions become available. MIPS R4000 Pipeline
That deeper pipeline explains why younger instructions may enter before a load result or branch decision is ready. The lecture’s load and branch delay examples show the scheduling consequences of those timing gaps. Their stated delays belong to the illustrated R4000 model. Load and Branch Delay Slots
Floating-point execution adds another timing complication: different operations use different sequences of internal stages. Even operations with different names can compete for a shared stage. Correct scheduling therefore needs the functional-unit stage pattern as well as an overall operation duration. MIPS R4000 FP Pipeline
The timing diagrams become useful when translated into performance. CPI measures average cycles per completed instruction, including delays from hazards. Different workloads accumulate different stall costs, so identifying the dominant contribution tells us which improvement might matter. Pipeline CPI and Stall Costs
The detailed notes below retain the lecture’s examples, timing diagrams or comparisons, and source references. Continue afterward with Lecture 06 - Exceptions and Interrupts.
What the professor covered
Multicycle execution (slides 2-10)
Complex FP operations need several clock cycles to avoid a slow clock or excessively complex single-cycle units. EX becomes several functional units with different execution times.
The example has a one-stage integer ALU, a four-stage FP adder (A1...A4), a seven-stage FP/integer multiplier (M1...M7), and an unpipelined FP/integer divider (D). These paths converge on MEM and WB.
The professor distinguishes result-use timing from the spacing between starts:
| Functional unit | Latency | Initiation interval |
|---|---|---|
| Integer ALU | 0 | 1 |
| Data Memory | 1 | 1 |
| FP add | 3 | 1 |
| FP/integer multiply | 6 | 1 |
| FP/integer divide | 24 | 25 |
Use the lecture’s latency convention; 0 does not mean instantaneous execution. See Latency and Initiation Interval and Multicycle Operations.
Hazards and issue checks (slides 11-20)
- Structural: divider occupancy and simultaneous register writes. Slide 12 shows multiply, add, and load reaching WB in cycle 11. Extra write ports are normally too expensive; stall at ID or before MEM/WB.
- RAW: the
fld -> fmul.d -> fadd.d -> fsdchain illustrates long waits for results. - WAW: an older
fadd.dand youngerfldboth writef2; varying execution times threaten write order.
If detection is performed in ID, check resource availability, source registers against pending destinations and their availability times, and the new destination against destinations in A1...A4, D, and M1...M7. Stall when unsafe.
See Structural Hazards in Multicycle Pipelines, RAW and WAW Hazards, and Hazard Detection in ID.
MIPS R4000 (slides 21-38)
The lecture introduces the 64-bit R4000 (1991) as an eight-stage superpipeline:
IF -> IS -> RF -> EX -> DF -> DS -> TC -> WB
Pipelined instruction/data memory accesses support one new instruction per cycle, but require more forwarding. The professor gives a load delay slot of 2 cycles and branch delay slot of 3 cycles. Load data is forwarded from the end of DS; branch evaluation occurs in EX.
The R4000 FP section uses stage types A, D, E, M, N, R, S, U and a separate operation-timing table. Slide 38 reduces latency by 1 when the consuming instruction is a store.
See MIPS R4000 Pipeline, Load and Branch Delay Slots, and MIPS R4000 FP Pipeline.
Performance (slides 39-42)
In the shown SPEC92 results, branch delays dominate integer-program stall costs, while FP result stalls dominate FP-program stall costs. The professor reports total CPI between 1.2 and 2.8, depending on the program.
See Pipeline CPI and Stall Costs.
Questions to check understanding
- Why can a multiplier have latency 6 but initiation interval 1?
- How can instructions issued in order reach WB out of order?
- What distinguishes two writes to one register from two writes needing one port?
- Why does forwarding still leave a two-cycle load delay in the R4000 example?
Source
E. Sanchez, Multicycle operations, Politecnico di Torino, ASE 2026/27, slides 1-42. PDF page numbers match slide numbers.