Course: Computer Architectures · Lab 04 · Results recorded 26 October 2026

Status: implementation, experiments and report completed. University upload is not established by these results.

Objective and calculation

This lab extends Lab 03 - Normalization Scheduling and Unrolling by comparing rescheduling, factor-two unrolling and factor-four unrolling, then changing arithmetic-unit latencies independently. The program updates eight accumulated-gradient values and weights. In this assignment’s simplified AdaGrad calculation, each element performs:

h[i] = h[i] + g[i] * g[i]
w[i] = w[i] - learning_rate * g[i] / h[i]

The denominator is the updated h value; this is the supplied simplified formula, not a claim that every AdaGrad implementation uses it. The baseline follows the assignment; rescheduling preserves the opcode multiset. Unrolling retains each element’s FP operation order. N=8 is divisible by two and four, so no remainder loop is required. See Loop Unrolling and SIMD and Register Renaming.

Configuration and independent experiments

Initial integer ALU/MUL/DIV latencies are 1/3/8; FP ALU/MUL/DIV are 4/6/30 cycles. Single precision, forwarding and the assignment’s out-of-order option are enabled; compressed instructions are disabled. All arithmetic units except FP DIV are pipelined. Direct-memory instruction/read/write latency is 1/1/1. The selected teaching model is MinorCPU, not the separate superscalar O3 configuration used in Lab 05.

In the MUL experiment, only FP MUL changes from 6 to 4. In the DIV experiment, only FP DIV changes from 30 to 28; MUL is restored to 6. The two changes are not combined.

Measured results

VersionTransformationInstructionsInitial cyclesFP MUL = 4FP DIV = 28
program_1Baseline132479447463
program_1_rRescheduled132415399399
program_1_uUnrolled by two112347343331
program_1_oUnrolled by four102323319307

The initial four-way version reduces elapsed time by (479−323)/479 = 32.57%, for a speedup 479/323 = 1.4830. Initial CPI falls from 479/132 = 3.6288 to 323/102 = 3.1667. Count the expanded instructions: each la becomes two real instructions. Counts exclude squashed work and the protected exit block.

The benefit from a faster functional unit depends on scheduling and overlap. For example, reducing FP MUL saves 32 cycles in the baseline but only four in the four-way version. A latency reduction is not automatically the same as an elapsed reduction; compare Latency and Initiation Interval and Amdahl Law and Pipeline Speedup. These experiments use ASE teaching cycles, not raw gem5 ticks.

Correctness and manual schedule evidence

All 16 output words match the independent binary32 reference across all 12 experiments and the four final export rebuilds: 256 checked store words. Updated h is [1.25, 3, 0.5625, 5, 4.25, 3.25, 0.3125, 3]. Updated w is approximately [0.26000002, −0.66666663, 1.15555561, 0.01000000, −0.38823530, 0.85384613, −1.01999998, 0.56666666].

All 12 source-derived stage worksheets match the executed pipeline entries. They reconstruct explicit local scheduling rules; they are not independent pre-measurement predictions.

Separate hypothetical branch-delay calculation

The assignment also asks for a hand calculation with one always-executed delay slot filled by moving an existing pointer increment. It gives baseline 472 cycles / 132 instructions = 3.5758 CPI and four-way 322 / 102 = 3.1569. These are hypothetical schedules, not the measured RISC-V results above. RISC-V does not have architectural branch delay slots. See Load and Branch Delay Slots for the distinction between a timing gap and an architectural slot.

Review and evidence

Explain why the two latency columns must use separate baselines, why the manual delay-slot figures cannot replace the simulator results, and how unrolling preserves per-element dependencies while exposing independent work.

Results come from the preserved Lab 04 completion record, analysis.json, source snapshots and branch-delay evidence. The public measurement table contains the main totals. Personalized reports and native submission archives remain private; no simulation was rerun for publication.

Continue with Lab 05 - Superscalar Execution and Load Store Units to compare machine configurations rather than only scheduling transformations. Professor context: Lecture 04 - Pipelining, Lecture 05 - Multicycle Operations, Lecture 07 - Instruction-Level Parallelism.