Overview
Five-Stage Processor Architecture
The processor follows a five-stage pipelined architecture consisting of Instruction Fetch, Instruction Decode, Execute, Memory, and Writeback.
Pipeline registers separate each stage, allowing multiple instructions to progress through the processor simultaneously. Additional control logic manages data dependencies and changes in program flow.
Implementation
One Architecture, Three HDLs
I implemented the processor architecture using VHDL, Verilog, and SystemVerilog. Implementing the same architecture across three hardware description languages gave me experience expressing equivalent digital behavior using different RTL syntax and design constructs.
The implementations were simulated to examine pipeline behavior and verify that instructions progressed through the processor as expected.
Pipeline Control
Hazard Detection, Forwarding, and Stalls
Pipelining introduces dependencies when an instruction requires a value that has not yet completed its normal path through the processor.
I implemented hazard-management logic to identify these dependencies. Forwarding allows values from later pipeline stages to be supplied to dependent instructions when possible, while stall logic handles situations that cannot be resolved immediately through forwarding.
Verification Strategy
Modular Testing Before Integration
Before integrating the complete processor, I independently verified individual modules and pipeline-control logic using simulation and testbenches.
This modular approach helped isolate incorrect behavior before the components were combined into the complete CPU.
My verification approach progressed from manually defined test cases to targeted scenarios designed to trigger specific processor conditions. I later used randomized testing to exercise the design across much larger numbers of input combinations automatically.
Verification Result 01
Hazard Detection Unit Verification
The hazard detection unit was tested across different register dependencies and memory conditions. The testbench compared actual control outputs against expected results, allowing forwarding and stall decisions to be checked automatically.
Verification Result 02
Forwarding Disabled vs. Enabled
I tested dependent instruction sequences with forwarding disabled and enabled to observe how operand dependencies affected execution.
Comparing the simulations helped verify that the forwarding paths supplied required values from later pipeline stages when appropriate.
Verification Result 03
Branch and Jump Pipeline Flushing
Branch and jump instructions required the processor to handle instructions that had already entered the pipeline before the new program counter became effective.
I used waveform analysis to trace these instructions through the pipeline and verify that instructions from the incorrect execution path were invalidated before they could continue through later stages.
What I Learned
Developing the Design and Verification Process
Waveform Debugging
At the beginning of the project, I understood the conceptual pipeline timing but did not yet know how that behavior would appear in an RTL simulation waveform. Through repeated simulation and debugging, I learned how to trace instructions and control signals across pipeline stages and relate waveform timing back to the processor architecture.
Modular Verification
Writing testbenches for individual modules before integration taught me how modular testing can isolate problems earlier and make system-level debugging more manageable.
Targeted Testing
I learned how to construct instruction sequences and input conditions specifically designed to trigger the behavior I wanted to verify, including different pipeline hazards.
Randomized Testing
I progressed beyond manually writing every test case by developing randomized testing approaches that allowed modules to be exercised across large numbers of test conditions automatically.
RTL Optimization
As the project developed, I learned to recognize repetitive RTL structures and improve the design by making portions of the implementation more modular and reusable.
Engineering Feedback
Feedback from engineering professionals I connected with during my learning journey exposed me to alternative RTL approaches. I evaluated that guidance while improving and debugging my own implementation.
Additional Verification
Additional Simulation Evidence
This portfolio highlights selected simulation results rather than every test performed during development. Additional module-level and integrated CPU verification images are available in the project repository.
View Verification Results on GitHub →