A compact RTL and Python framework for simulating Arbiter PUF variants, extracting CRPs, measuring core PUF metrics, and benchmarking simple modeling attacks.
rtl/arbiter_puf.svrtl/xor_arbiter_puf.svrtl/multi_bit_arbiter_puf.svsim/tb_arbiter_puf.svsim/puf_assert.svAn Arbiter PUF sends a challenge-controlled race through a chain of mux stages. The final race outcome is sampled by an arbiter latch. In this repository, SEED-driven mux bias is used to model repeatable simulation variation; that is useful for verification, but it is still a deterministic simulation model, not physical silicon randomness.

arbiter_puf| Port | Direction | Description |
|---|---|---|
clk |
input | Clock |
rst_n |
input | Active-low reset |
valid_in |
input | Input strobe |
challenge[N-1:0] |
input | Challenge vector |
response |
output | 1-bit response |
valid_out |
output | Response valid strobe |
| Parameter | Default | Description |
|---|---|---|
N |
64 |
Number of stages |
SEED |
64'h9E3779B97F4A7C15 |
Deterministic stage-bias seed |
xor_arbiter_puf| Port | Direction | Description |
|---|---|---|
clk |
input | Clock |
rst_n |
input | Active-low reset |
valid_in |
input | Input strobe |
challenge[N-1:0] |
input | Shared challenge vector |
response |
output | XOR of K internal Arbiter responses |
valid_out |
output | Response valid strobe |
| Parameter | Default | Description |
|---|---|---|
N |
64 |
Number of stages per Arbiter |
K |
4 |
Number of parallel arbiters |
SEED_BASE |
64'h9E3779B97F4A7C15 |
Base seed for internal instances |
multi_bit_arbiter_puf| Port | Direction | Description |
|---|---|---|
clk |
input | Clock |
rst_n |
input | Active-low reset |
valid_in |
input | Input strobe |
challenge[N-1:0] |
input | Shared challenge vector |
response[M-1:0] |
output | Multi-bit response vector |
valid_out |
output | Response valid strobe |
| Parameter | Default | Description |
|---|---|---|
N |
64 |
Number of stages per Arbiter |
M |
64 |
Number of response bits |
SEED_BASE |
64'hD1B5_4A32_9F3C_6E21 |
Base seed for bit lanes |
arbiter_puf #(
.N(64),
.SEED(64'h0123_4567_89AB_CDEF)
) u_basic (
.clk(clk),
.rst_n(rst_n),
.valid_in(valid_in),
.challenge(challenge),
.response(response),
.valid_out(valid_out)
);
xor_arbiter_puf #(
.N(64),
.K(4),
.SEED_BASE(64'hA5A5_5A5A_0123_4567)
) u_xor (
.clk(clk),
.rst_n(rst_n),
.valid_in(valid_in),
.challenge(challenge),
.response(response),
.valid_out(valid_out)
);
multi_bit_arbiter_puf #(
.N(64),
.M(64),
.SEED_BASE(64'h0F0F_F0F0_1357_9BDF)
) u_multi (
.clk(clk),
.rst_n(rst_n),
.valid_in(valid_in),
.challenge(challenge),
.response(response),
.valid_out(valid_out)
);
The main testbench exercises all three RTL modules, emits CRPs to sim/crp_data.csv, injects response noise for reliability measurement, and prints a PASS/FAIL summary.
Run it with Icarus Verilog:
make -f scripts/Makefile sim
That command compiles:
rtl/arbiter_puf.svrtl/mux_stage.svrtl/xor_arbiter_puf.svrtl/multi_bit_arbiter_puf.svsim/puf_assert.svsim/tb_arbiter_puf.svRun the full metrics suite on the generated CSV:
python scripts/analyze_puf.py --input sim/crp_data.csv --output-dir sim/analysis
Outputs:
sim/analysis/metrics.jsonsim/analysis/metrics.txtsim/analysis/metrics_dashboard.pngsim/analysis/metrics_dashboard.pdfMetrics covered:
Benchmark a simple logistic-regression attacker against the basic and XOR PUFs:
python scripts/ml_attack.py --input sim/crp_data.csv --output-dir sim/attack
Outputs:
sim/attack/ml_attack.jsonsim/attack/ml_attack.txtThe expected trend is that the basic Arbiter PUF is easier to model than the XOR variant.
Generate the README figures:
python scripts/generate_puf_figures.py --output-dir docs

The dashboard should land near these targets:
GitHub Actions runs:
git clone https://github.com/a0ax/ArbiterPUF.git
cd ArbiterPUF
make -f scripts/Makefile sim
python scripts/analyze_puf.py --input sim/crp_data.csv --output-dir sim/analysis
python scripts/ml_attack.py --input sim/crp_data.csv --output-dir sim/attack
python scripts/generate_puf_figures.py --output-dir docs
rtl/ - synthesizable SystemVerilog modulessim/ - testbench and assertion logicscripts/ - analysis, figures, and attack toolingmodels/ - behavioral Python model for fast prototypingdocs/ - generated figures for the README