03UWASIC · Oct 2026
SPI-Controlled PWM Peripheral
3/3cocotb tests passing
Layout render

Simulation output

ncsgoes low- 16 clock pulses
shift_regfills to80f0- The register updates to
f0
ncs goes low, 16 clock pulses shift a 16-bit command in (shift_reg reaches 80f0), then ncs goes high and the register output and uo_out change to f0.Illustration
Nothing sent yet. A command takes 16 clock pulses.
What I did
This was my onboarding project at UWASIC, Waterloo's student ASIC design team.
I wrote a mode-0 SPI peripheral in basic Verilog RTL. It receives 16-bit commands and sets five registers that control the team's 16-output PWM module. The PWM module was provided; I wrote the SPI peripheral.
I handled clock-domain crossing with two-flip-flop synchronizers into the 10 MHz clock domain.
The design was taped out.
How I verified it
I verified the design in simulation, writing the cocotb tests for PWM frequency and duty cycle. All three tests pass.
Tools
- Verilog RTL (basic)
- cocotb testbenches, Python