Karan Diwan

Hopfield Network

A binary Hopfield neural network in SystemVerilog, taken from RTL through synthesis to GDSII.

A Hopfield network is an associative memory: instead of retrieving data by address, it recalls a stored pattern from the content of a noisy or incomplete input, by repeatedly updating neuron states until the network settles into a stable configuration. This project implements one as a deterministic, synthesizable digital system, with connection weights generated by the Hebbian rule, and carries it through physical implementation to a final GDSII layout.

A corrupted 5 by 5 input pattern recalled as the stored pattern by the Hopfield network
A corrupted input pattern is recalled as the stored configuration through iterative neuron updates.

Physical implementation

Beyond synthesis, the design was taken through floorplanning, placement, clock tree synthesis, and global and detailed routing using OpenROAD and the Sky130HD standard-cell library, culminating in GDSII layout generation.

Post-route physical layout in OpenROAD
Post-route physical layout, OpenROAD.
GDSII layout in KLayout
GDSII layout, KLayout.

Physical characterization, Sky130HD

Implementation stageCell areaCellsCrit. pathFmaxPower
Post-Synthesis9,336.45 µm²1,21320.02 ns~49.95 MHz392 µW
Post-P&R (estimated parasitics)9,724.33 µm²1,33420.206 ns~49.5 MHz504 µW
Post-P&R (extracted parasitics)9,724.33 µm²1,33419.47 ns~51.36 MHz481 µW
Estimated parasitics approximate interconnect resistance and capacitance, whereas extracted parasitics derive them from the detailed-routed layout, giving more physically representative timing and power.

Verification

The implementation was verified at both the RTL and gate level: all 20 selected test inputs converged to the expected stored pattern in RTL simulation (20/20) and in post-synthesis gate-level simulation (20/20).

Twenty test inputs converging to the stored pattern
All 20 selected test inputs converged to the expected stored pattern.
Toolchain: SystemVerilog, Icarus Verilog, Yosys, OpenSTA, OpenROAD, KLayout, GTKWave, Python (Hebbian matrix generator), Sky130HD
View repository on GitHub →
← High-Performance Multipliers Next: Gate-Level Cybernetic Classifier →