Karan Diwan

Harvard Processor

A parameterized, multi-cycle Harvard-architecture processor built from 12 coordinated RTL modules.

The processor follows a Harvard architecture: separate program and data memories, a custom instruction set, a hardwired control unit, and a multiplexer-based internal data bus. It's demonstrated at 8 bits but parameterized to any data width at instantiation. Twelve independent modules, the ALU, registers, program counter, ROM, RAM, memory address register, flags register, instruction register, T-state counter, and control unit, are coordinated through T-state sequencing into one multi-cycle datapath.

Waveform for 2x2 matrix multiplication program
Software-only 2×2 matrix multiplication, built from the multiplication kernel.

Verification

The RTL is verified with both classical Verilog testbenches and self-checking cocotb testbenches, across three strategies: directed tests for reset, load, hold, increment, and control priority; randomized tests validated in Python against a software reference model; and, for combinational modules like the ALU, exhaustive tests covering every possible input combination.

Physical characterization

Post-synthesis results below use the Sky130HD standard-cell library, with static timing analysis constrained to a 10 ns clock, 1 ns input delay, and 1 ns output delay.

Post-synthesis characterization, Sky130HD
ModuleAreaCritical pathFmaxPower
General Purpose Registers320.3 µm²1.41 ns~709 MHz39.8 µW
Arithmetic and Logic Unit877.1 µm²3.21 ns~311 MHz349 µW
Control Unit359.1 µm²2.29 ns~437 MHz41.4 µW
ROM (256×8)2,277.2 µm²2.85 ns~351 MHz888 µW
RAM (256×8)75,862.8 µm²5.18 ns~208 MHz9.88 mW
Full Computer80,347.1 µm²25.55 ns~39 MHz8.67 mW

Amdahl's Law study: removing the MAR

An architectural study examined what happens when the Memory Address Register is eliminated from the datapath, letting memory be addressed more directly. Before the change, 84% of the ISA executed in 2 T-states; after it, 100% did, giving every instruction a uniform 2-cycle execution time. Amdahl's Law was used to validate the change.

Measured effect of the MAR optimization, by benchmark
BenchmarkMaximum speedupClock cycles saved
Maximum of two numbers1.250×3
Unsigned multiplication1.269×1,786
2×2 matrix multiplication1.231×12,256
Toolchain: Verilog, Icarus Verilog, Verilator, Yosys, OpenSTA, cocotb, GTKWave, Sky130HD
View repository on GitHub →
Next: High-Performance Adder Architectures →