All projects

SIMD processor study

A 4-stage pipelined 64-bit vector processor in synthesizable Verilog, and a five-way study of how to make it faster. Version C, my multi-cycle divide unit plus a scoreboard, came out on top.

Dates
Oct 2026 to present
Tools
Verilog, Synopsys DesignWare, Synopsys Design Compiler (FreePDK45, 45 nm), Cadence NC-Sim, Icarus Verilog
Team
2 people. We co-designed the baseline. I built its forwarding and Versions B, C, and E. My partner built Version D's issue scheduler, the 20-program benchmark testbench, and the synthesis and equivalence-checking flow. We ran the comparison together.
Results
Clock periods and areas come from Design Compiler synthesis, and cycle counts come from simulation. See the notes at the end.

Problem

One slow instruction set the clock for all of them

The baseline (Version A) is an in-order pipeline with IF, ID, EX/MEM, and WB stages. Its ALU splits each 64-bit operand into 8, 16, 32, or 64-bit lanes, and partial writes merge selected bytes into the destination register.

Division, modulo, and square root used combinational DesignWare parts inside the single-cycle ALU. The clock had to cover that path, so every instruction ran at about a 100 ns period, even a one-cycle add. The divider was also most of the area: the ALU was about 199.6k of the baseline's 250k µm².

Version C

A multi-cycle divide unit and a scoreboard

EX→ID forward WB→ID forward IF ID EX/MEM WB scoreboard: no busy regs SFU, 64-cycle shared WB port
Figure 1. Version C, simplified: an in-order 4-stage pipeline with EX-to-ID and WB-to-ID forwarding, a multi-cycle special function unit (SFU) for DIV, MOD and SQRT, and a scoreboard that lets independent instructions finish while a long operation is still running. The SFU's 64 cycles are compressed here.
  • Special function unit (SFU): I moved DIV, MOD, and SQRT out of the ALU into a separate unit built from sequential DesignWare dividers and square-root blocks, one per lane width. It has a start/done handshake and a latency parameter. A synthesis sweep showed a 32-cycle SFU still had an 11.16 ns path, while 64 cycles reached 1.96 ns, so the design uses 64.
  • Scoreboard: instructions that don't depend on the divide keep issuing and finishing while the SFU runs. ID stalls only on a true RAW or WAW against the in-flight divide, and the SFU and the pipeline arbitrate for the writeback port.
  • No reorder buffer needed: the ISA has no exceptions, and branches resolve in ID with no speculation, so nothing ever has to be undone. RAW and WAW checks alone keep the register state correct.
  • Hold versus bubble: an SFU stall has to hold the divide in ID/EX, while a load-use stall has to insert a bubble there, so I split them into separate control paths.

Results

Five designs, timed by clock period, not just cycles

Every version ran the same 20 benchmark programs in six categories, each checked against a reference memory dump. Execution time is cycles multiplied by the synthesized clock period, so no design can look good on cycle count alone.

Table 1. Totals over all 20 programs. B, C, and E use a 64-cycle SFU.
VersionClock periodArea (µm²)CyclesTimeSpeedup vs A
A. Baseline≈100 ns250k2,784278.3 µs1.0×
D. A + issue window≈100 ns259k2,651265.0 µs1.05×
B. Multi-cycle SFU1.90 ns189k10,06119.1 µs14.6×
C. B + scoreboard1.84 ns192k9,55117.6 µs15.8×, best
E. C + issue window, W=11.93 ns196k9,30418.0 µs15.5×
E. C + issue window, W=82.12 ns224k9,18819.5 µs14.3×
  • Fix the critical path first. The SFU alone (B) cut the clock from about 100 ns to 1.90 ns and area by 24%, even though each divide now takes 64 cycles.
  • Cheap latency hiding beat the complex option. C's scoreboard cost about 1.6% more area than B. On the divide-heavy benchmark with independent work, it cut cycles from 683 to 544 and runtime from 1,297.7 ns to 1,001.0 ns.
  • Fewest cycles isn't fastest. E had about 3% fewer cycles than C, but its critical path ran from the ALU through forwarding into a taken branch that flushes the issue window. Its clock grew from 1.93 ns to 2.12 ns, making it 2 to 11% slower than C.
  • Dynamic scheduling can't fix a slow clock. D saved up to 23% of cycles on branch-heavy code but only 5% overall at the same 100 ns clock.
  • Realistic kernel: on vector normalization, C took 2.71 µs against the baseline's 34.6 µs, 12.8× faster.

Verification

Forwarding and hazard checks in the baseline

I built EX-to-ID and WB-to-ID forwarding with per-byte merging of partial writes, so only load-use hazards stall. Adding EX forwarding to a version that already had WB forwarding cut total cycles 19%, from 2,014 to 1,624, across a 16-program regression.

Self-checking testbenches run 20,024 directed and random hazard checks. To be sure they catch real problems, I injected bugs into the design on purpose and confirmed the testbenches flagged them. The baseline also passes the course regression suite in NC-Sim.

Waveforms

Read the simulation yourself

These are the real Icarus Verilog traces from two test programs, one for the forwarding baseline and one for Version C. Pick a numbered event to jump to it, or move the cursor to read every signal in that cycle.

The interactive waveform needs JavaScript. Version A shows EX-to-ID and WB-to-ID forwarding over 18 cycles; Version C shows a divide, square root and modulo running in the SFU while the scoreboard stalls only dependent instructions, over 37 cycles.

Figure 2. Simulation traces, sampled just before each rising clock edge. The Version C run sets SFU_NUM_CYC to 8 instead of the full 64-cycle unit.

Notes

How to read these numbers

  • The baseline's ≈100 ns period is an upper bound, so speedups against it could shrink somewhat with a tighter synthesis run.
  • The fast designs' periods are achieved critical-path lengths with small negative slack, not signed-off timing.
  • Place and route and activity-annotated power come later in the course.

Source code isn't posted while the course is running, in line with USC's academic integrity policy. I'm happy to walk through the design in an interview.