Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nsram-0.3.0.tar.gz (32.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nsram-0.3.0-py3-none-any.whl (31.6 kB view details)

Uploaded Python 3

File details

Details for the file nsram-0.3.0.tar.gz.

File metadata

  • Download URL: nsram-0.3.0.tar.gz
  • Upload date:
  • Size: 32.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for nsram-0.3.0.tar.gz
Algorithm Hash digest
SHA256 9408b9c13445d9bbc4769b5791f5646d79de591e6a7ee99672454ce7db927e6c
MD5 5d586a6bf8aa5e6813d1dd3af6117602
BLAKE2b-256 bad675f8a731300229b750bc6ce265db8e238b2258456d1f7d3a9db619772083

See more details on using hashes here.

File details

Details for the file nsram-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: nsram-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 31.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for nsram-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d463f5754cafeffe19cb0100390fd7bff440a06dce34e400e21b1af0586d0887
MD5 2a192cad1c0b1f1a801aa1959a8bc209
BLAKE2b-256 adb59fe10c3bc15927246db79a38c8bab5c5810e1babbe085c521d7d9e69bfe8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page