NS-RAM: Neuro-Synaptic RAM simulator — floating-body transistor neuron/synapse modeling with charge-trapping plasticity
Project description
nsram — Neuro-Synaptic RAM Simulator
The first open-source Python library for simulating NS-RAM floating-body transistor neurons with charge-trapping synaptic plasticity.
Based on: Pazos et al., "Synaptic and neural behaviours in a standard silicon transistor", Nature 640, 69-76 (2025).
Installation
pip install nsram # CPU only (numpy)
pip install nsram[gpu] # GPU acceleration (PyTorch)
pip install nsram[all] # Everything (GPU + plotting + ODE solvers)
Quickstart
from nsram import NSRAMReservoir, rc_benchmark
# Create 128-neuron reservoir with heterogeneous short-term plasticity
res = NSRAMReservoir(N=128, stp='heterogeneous')
# Run reservoir computing benchmarks
results = rc_benchmark(res)
# XOR-1: 90.3%, MC: 2.29, NARMA-10: 0.52, Wave-4: 92.5%
What is NS-RAM?
NS-RAM (Neuro-Synaptic Random Access Memory) is a standard CMOS floating-body transistor that exhibits both neuron-like spiking and synapse-like plasticity from device physics alone — no special materials or processes required.
Key device physics simulated:
- Impact ionization avalanche (Chynoweth model):
I_aval = I0 × exp((Vcb - BVpar) / Vt) - Breakdown voltage control:
BVpar = 3.5 - 1.5 × Vg1(gate-tunable, from Pazos SPICE) - Temperature dependence:
BVpar(T) = BVpar × (1 - 21.3μ × ΔT) - SRH charge trapping:
dQ/dt = k_cap(Vg2) × (1-Q) × rate - k_em × Q - VG2-controlled mode switching (neuron ↔ synapse)
Novel Finding: Charge Trapping = Tsodyks-Markram STP
This library implements the mapping between NS-RAM charge trapping and the Tsodyks-Markram short-term plasticity model:
| NS-RAM physics | TM-STP neuroscience |
|---|---|
| Q (trapped charge) | 1 − x (depleted resources) |
| k_cap(VG2) | U (utilization) |
| 1/k_em | τ_rec (recovery time) |
| ΔVth = −αQ | PSP amplitude modulation |
VG2 voltage controls the STP type: low VG2 → depression, high VG2 → facilitation.
API Reference
NSRAMReservoir(N, stp, connectivity, ...)
| Parameter | Default | Description |
|---|---|---|
N |
128 | Number of neurons |
stp |
'heterogeneous' |
STP mode: 'none', 'std', 'stf', 'heterogeneous' |
connectivity |
'sparse' |
'sparse' (15%), 'small_world', 'dense' |
spectral_radius |
0.90 | Recurrent weight spectral radius |
variability |
0.10 | Die-to-die parameter variability |
backend |
'auto' |
'numpy', 'torch', 'auto' |
rc_benchmark(reservoir, n_steps, n_reps)
Runs XOR (τ=1,2,5), Memory Capacity, NARMA-5/10, and 4-class waveform classification.
Lower-level API
from nsram import NSRAMParams, NSRAMNetwork
from nsram.physics import breakdown_voltage, avalanche_current, srh_trapping
# Direct physics calculations
bvpar = breakdown_voltage(Vg1=0.40, temperature=350)
I_aval = avalanche_current(Vcb=2.5, Vg1=0.40)
# Custom network
params = NSRAMParams(N=256, variability=0.20, bg_frac=0.90)
net = NSRAMNetwork(N=256, params=params, connectivity='small_world')
result = net.run(input_signal, noise_sigma=0.01)
Device Parameters
Default parameters from Pazos et al. SPICE model (Zenodo: 13843362):
| Parameter | Value | Source |
|---|---|---|
| BVpar₀ | 3.5 V | BJTparams.txt |
| dBVpar/dVg1 | -1.5 V/V | BJTparams.txt |
| Tbv1 | -21.3 μ/K | Davalanche.txt |
| Is | 1×10⁻¹⁶ A | BJTparams.txt |
| Bf | 50 | BJTparams.txt |
| Vth₀ (NMOS) | 0.432 V | PTM130bulk_lite.txt |
| Energy/spike | 21 fJ | Nature 640 |
| Cell area (1T) | 8 μm² | Nature 640 |
| Cell area (2T) | 17 μm² | Nature 640 |
Citation
If you use this library, please cite:
@article{pazos2025nsram,
title={Synaptic and neural behaviours in a standard silicon transistor},
author={Pazos, Sebastian and others},
journal={Nature},
volume={640},
pages={69--76},
year={2025}
}
License
Apache 2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nsram-0.2.0.tar.gz.
File metadata
- Download URL: nsram-0.2.0.tar.gz
- Upload date:
- Size: 23.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
33cc0334734933fd18ecf694800d93dd27316bde5743b2aabe54f967f20f8880
|
|
| MD5 |
44f338cf4b178b7a6b978e7563ebb9cc
|
|
| BLAKE2b-256 |
8e7844b76fd491060aa0d16e0a6d113c8f0e0be5e96b9b3fe707c228ae579bd5
|
File details
Details for the file nsram-0.2.0-py3-none-any.whl.
File metadata
- Download URL: nsram-0.2.0-py3-none-any.whl
- Upload date:
- Size: 21.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
290068c8169de715c58c39fac12bcfdd4f3d8cd57b33eb05801ca08c9c40dd74
|
|
| MD5 |
949c4c473b44d50a37e9161ddbe20fe2
|
|
| BLAKE2b-256 |
cf531cbff904b9a6486b8bad506abee0ae3a4f1bd68476390ee54ea965f50db7
|