← All articles
FPGA · Education

svLAB for Crypto Core: a structured RTL curriculum

Most people learn Verilog by writing broken testbenches and hoping. svLAB for Crypto Core is the opposite: a structured SystemVerilog curriculum anchored on a real build — the Fog-Crypto Core AES-256-GCM datapath.

Hardware is unforgiving in a way software is not: a wrong flip-flop stage is not a bug you can patch later, it is a chip that fails. The lab therefore treats RTL the way the project treats all engineering — with a defined process, not ad-hoc hacking.

A roadmap, not a tutorial

The curriculum is a progressive roadmap: from the simulator and the golden model, to a single AES core, to the pipelined GHASH and the full integration top. Each stage has an exit criterion, so progress is verifiable rather than assumed.

RTL curriculum roadmap overview — progressive stages from simulator and golden model to AES core, pipelined GHASH, and integration top.
The RTL curriculum roadmap: progressive stages, each with a verifiable exit criterion.

Specify before you synthesize

Before any code, a four-layer microarchitecture specification separates the problem into its interface, dataflow, control, and verification layers. That separation is what makes a module reviewable — and what lets the AES engine, GHASH, and the store-and-forward wrapper be developed independently and then composed.

4-layer microarchitecture specification methodology — interface, dataflow, control, and verification layers.
The four-layer microarchitecture specification methodology.

Hardware TDD

Test-driven development is not a software-only idea. The lab applies the same red-green-refactor loop to hardware: a failing co-simulation test precedes the RTL, the golden model supplies the expected vectors, and Verilator + cocotb close the loop in seconds instead of an FPGA bring-up cycle.

Hardware TDD verification pipeline — failing co-simulation test precedes RTL, golden model supplies vectors, Verilator + cocotb closes the loop.
The hardware TDD verification pipeline.

FSMD: decouple the control from the datapath

The single most useful discipline in the lab is FSMD structural decoupling: separate the finite-state machine (the when) from the datapath (the what). It keeps the control logic readable and the datapath pipelineable — exactly the move that turned the GHASH from a combinational XOR chain into a four-stage pipeline that can meet timing.

FSMD structural decoupling methodology — separating the finite-state machine (control) from the datapath.
FSMD structural decoupling: control (FSM) separated from the datapath.

The point of the lab is not to teach syntax — it is to install the habits that survive contact with a real tape-out: specify, test, decouple, verify. The AES-256-GCM build is the case study that proves the method.