259 AdExp DPI Neuron

259 : AdExp DPI Neuron

Design render

🧠 AdEx Spiking Neuron Core

This project is a digital hardware implementation of the Adaptive Exponential (AdEx) Integrate-and-Fire neuron model. It's designed to run on an ASIC, simulating the behavior of a biological neuron, including its membrane potential and adaptation mechanisms. The core is highly configurable, allowing it to model various neural firing patterns like regular spiking, bursting, and fast spiking.

How it works ⚙️

The system operates based on two primary components: the Neuron Core and the Parameter Loader.

1. The Neuron Core

The core solves two coupled differential equations in real-time using Q4.8 fixed-point arithmetic. These equations govern the neuron's two main state variables:

  • V: The membrane potential, which simulates the voltage across the neuron's cell membrane.
  • w: The adaptation current, which models cellular fatigue and is responsible for spike-frequency adaptation.

The behavior is defined by the following equations, which are a direct representation of the hardware's operation:

\frac{dV}{dt} = \frac{-g_L(V - E_L) + g_L\Delta_T\exp\left(\frac{V - V_T}{\Delta_T}\right) - w + I}{C} 
\frac{dw}{dt} = \frac{a(V - E_L) - w}{\tau_w}

When the membrane potential V crosses a threshold VT, the core outputs a digital spike ⚡. After a spike, V is reset to Vreset and the adaptation current w is increased by a value b.

2. The Parameter Loader 📥

The neuron's specific behavior is defined by 8 distinct user-configurable parameters. To configure the core, these parameters must be loaded serially via a simple 4-bit interface.

The parameters are loaded in the following order:

Index Parameter Symbol in Equation Description
0 DeltaT ΔT Sharpness of the spike initiation
1 TauW τw Adaptation time constant
2 a a Subthreshold adaptation level
3 b b Spike-triggered adaptation increment
4 Vreset Vreset Voltage to reset to after a spike
5 VT VT Firing threshold voltage
6 Ibias I Constant input current
7 C C Membrane capacitance

The loading process is controlled by the ui_in pins:

  • ui_in[4] (load_mode): Must be high to enable loading.
  • ui_in[3] (load_enable): A rising edge on this pin latches the 4-bit value present on uio_in[3:0].

Each 8-bit parameter is sent as two 4-bit nibbles (high nibble first). After all 16 nibbles have been sent, a special footer nibble (0xF) must be sent to commit the new parameters to the core.

Inputs and Outputs

  • Inputs:
    • clk: Main clock signal.
    • rst_n: Active-low reset.
    • ui_in[4] (load_mode): Set to 1 to enable the parameter loader.
    • ui_in[3] (load_enable): Pulse high to load a 4-bit nibble from uio_in.
    • ui_in[2] (enable_core): Set to 1 to run the neuron simulation.
    • ui_in[1] (debug_mode): Selects the debug output on uo_out[6:1].
    • uio_in[3:0]: 4-bit data bus for loading parameter nibbles.
  • Outputs:
    • uo_out[0] (spike): The primary output. Pulses high for one clock cycle when the neuron fires.
    • uo_out[6:1]: A 6-bit debug bus showing the most significant bits of either V (if debug_mode=0) or w (if debug_mode=1).

Firing Modes and How to Trigger Them 🧠⚡️

The AdEx model's strength is its ability to reproduce different neural behaviors. The firing pattern is primarily determined by the interplay between the adaptation parameters (a, b, τw), input current (I), and membrane capacitance (C). By loading different parameter sets, you can make the neuron behave in specific ways.

Note: The 8-bit encoded value is what you need to send to the hardware. For signed values (Vreset, VT, Ibias), the encoding is Real Value + 128. For unsigned values, the encoding is just the Real Value. For the firing mode examples below, the C parameter should be loaded with its default value of 200 (Hex 0xC8).


📈 Regular Spiking (Adapting)

This is the "default" behavior for many excitatory neurons. The firing rate is initially high and then slows down as the adaptation current w builds up.

  • Mechanism: A non-zero spike-triggered adaptation (b) increases w with every spike, making it harder for the neuron to reach its firing threshold again.

  • Parameter Values: | Parameter | Real-World Value | 8-bit Encoded Value | Hex Value | | :--- | :--- | :--- | :--- | | a | 2 nS | 2 | 0x02 | | b | 40 pA | 40 | 0x28 | | Vreset | -65 mV | 63 | 0x3F | | Ibias | 50 pA | 178 | 0xB2 |


💥 Bursting

This behavior is characterized by clusters of high-frequency spikes separated by periods of silence (hyperpolarization).

  • Mechanism: Strong subthreshold adaptation (a) and a less-negative reset potential (Vreset) are key. The adaptation current w builds up slowly, eventually stopping the burst. As w decays, the membrane potential depolarizes again, initiating the next burst.

  • Parameter Values: | Parameter | Real-World Value | 8-bit Encoded Value | Hex Value | | :--- | :--- | :--- | :--- | | a | 4 nS | 4 | 0x04 | | b | 0 pA | 0 | 0x00 | | Vreset | -50 mV | 78 | 0x4E | | Ibias | 25 pA | 153 | 0x99 |


💨 Fast Spiking

Typical of inhibitory interneurons, this mode involves sustained high-frequency firing with little to no adaptation or slowdown.

  • Mechanism: This is achieved by simply turning off all adaptation mechanisms (a and b are zero). The neuron behaves like a simple leaky integrate-and-fire model, with its firing rate determined solely by the input current.

  • Parameter Values: | Parameter | Real-World Value | 8-bit Encoded Value | Hex Value | | :--- | :--- | :--- | :--- | | a | 0 nS | 0 | 0x00 | | b | 0 pA | 0 | 0x00 | | Vreset | -65 mV | 63 | 0x3F | | Ibias | 80 pA | 208 | 0xD0 |


How to test 🧪

The recommended test procedure verifies the core's functionality by loading parameters to induce spiking and then observing the output.

The test procedure is as follows:

  1. Reset: The chip is held in reset for 10 clock cycles to initialize all internal states.

  2. Load Parameters: To provoke a spike, the test injects a strong, constant positive input current (Ibias) and sets the membrane capacitance (C).

    • The test enters load_mode.
    • It sends 12 dummy nibbles for the first 6 parameters.
    • It sends the two nibbles for Ibias (a value of 200, which is a strong supra-threshold current).
    • It sends the two nibbles for C (a value of 200, the default).
    • It sends the 0xF footer nibble to commit all 8 parameters.
    • The test exits load_mode.
  3. Run and Verify:

    • The test asserts enable_core to start the neuron simulation.
    • It then monitors the uo_out[0] (spike) pin on every clock cycle.
    • A successful test requires a spike to be detected within a set time limit (e.g., 1000 cycles).

External hardware

N/A. This project is a self-contained digital core and requires no external components.

IO

#InputOutputBidirectional
0spikeparam_nibble_in[0]
1debug_modedebug_val[0]param_nibble_in[1]
2enable_coredebug_val[1]param_nibble_in[2]
3load_enabledebug_val[2]param_nibble_in[3]
4load_modedebug_val[3]
5debug_val[4]
6debug_val[5]
7

Chip location

Controller Mux Mux Mux Mux Mux Mux Mux Mux Mux Mux Mux Mux Mux Mux Mux Mux Mux tt_um_chip_rom (Chip ROM) tt_um_factory_test (Tiny Tapeout Factory Test) tt_um_oscillating_bones (Oscillating Bones) tt_um_tt_tinyQV (TinyQV - Crowdsourced Risc-V SoC) tt_um_rejunity_atari2600 (Atari 2600) tt_um_rejunity_lgn_mnist (LGN hand-written digit classifier (MNIST, 16x16 pixels)) tt_um_izh_neuron_lite (LIF Neuron) tt_um_blptrk_weaving01 (weaving in silicon #1) tt_um_rte_eink_driver (E-ink display driver) tt_um_bleeptrack_prism (Prism) tt_um_zerotoasic_logo_screensaver (VGA Screensaver with Zero to ASIC Logo) tt_um_kianV_rv32ima_uLinux_SoC (KianV uLinux SoC) tt_um_nefelimet_updown_cntr (3-bit up-down counter) tt_um_wokwi_434917577229968385 (LIF neuron) tt_um_wokwi_434917320361309185 (TinyTapeout 2025) tt_um_wokwi_434917171311441921 (MC first Wokwi) tt_um_wokwi_434917344830882817 ('') tt_um_wokwi_434918300941464577 (WowkiProject) tt_um_wokwi_434917453767462913 (Mini Calculator v1) tt_um_wokwi_434917219039482881 (and) tt_um_wokwi_434917025263649793 (DigOTA) tt_um_wokwi_434917044822739969 (TinyTapeoutWorkshop) tt_um_wokwi_434921821909078017 (and gate) tt_um_wokwi_434917167895180289 (Encoder) tt_um_wokwi_434917143298726913 (Chip design from Wokwi) tt_um_wokwi_434921804663145473 (Tapeout try) tt_um_wokwi_434917374201501697 (dummy) tt_um_wokwi_434917318393129985 (Tiny Tapeout Template Copy) tt_um_wokwi_434917632188986369 (Timo 1) tt_um_wokwi_434917842159020033 (And Gate) tt_um_wokwi_434917427319226369 (Tiny Tapeout Chip) tt_um_wokwi_434917260383792129 (Tiny Tapeout Workshop Project by Nick Figner) tt_um_wokwi_434917040492120065 (4 bit incrementer) tt_um_wokwi_434917990496885761 (Projekt) tt_um_wokwi_434917381796339713 (Nils Tinytapeout Proj) tt_um_wokwi_434917317189363713 (tinytapeoutchip) tt_um_wokwi_434917679388544001 (tiny tapeout chip) tt_um_wokwi_434917506576906241 (ToDo) tt_um_wokwi_434917139713644545 (in progress) tt_um_wokwi_434917382645687297 (numbers) tt_um_wokwi_434917816595781633 (number display) tt_um_wokwi_434918311072808961 (GG) tt_um_wokwi_434917362908337153 (noclue) tt_um_wokwi_434917682511205377 (Random) tt_um_wokwi_434925031692840961 (demo-tiny) tt_um_wokwi_434917760986646529 (Barans erster Template Design) tt_um_wokwi_434917419779963905 (Tapeout Test1) tt_um_wokwi_434917684709021697 (Tiny Tapeout Template Copy_Orion) tt_um_wokwi_434918956220790785 (Simple classification perceptron ) tt_um_wokwi_434918068909406209 (Tiny Tapeout) tt_um_parx (example-verilog) tt_um_wokwi_434917624377094145 (brostarscard) tt_um_urish_simon (Simon Says memory game) tt_um_emmk_riscv (ENSEIRB-MATMECA RISC-V ASIC) tt_um_abhinav8prasad_dds (8-bit DDS sine wave generator) tt_um_wokwi_436554456427191297 (OCDCpro TT key lock test design IHP) tt_um_wokwi_434391222509479937 (4-Bit Adder) tt_um_ihp_logo_screensaver (VGA Screensaver with the IHP Logo) tt_um_pqn (PQN Model with Verilog) tt_um_Xelef2000 (RNG) tt_um_gamepad_pmod_demo (Gamepad Pmod Demo) tt_um_anujic (Morse Code Trainer) tt_um_rodald_cpr (CRP - Custom Risc Processor) tt_um_alif_dual_unileak (LIF Neuron) tt_um_riscv_mini_ihp (RISC-V Mini IHP) tt_um_wokwi_434917200607612929 (test_design) tt_um_alif_single_dualleak (Simple LIF Neuron) tt_um_blptrk_weaving02 (weaving in silicon #2) tt_um_blptrk_weaving03 (weaving in silicon #3) tt_um_blptrk_weaving04 (weaving in silicon #3) tt_um_dumbrv_yliu_hashed (DUMBRV) tt_um_iz_neuron (IZH Neuron) tt_um_test_chip_pius (Verilog OR-Gate) tt_um_pwm_block (PWM_SPI) tt_um_2048_vga_game (2048 sliding tile puzzle game (VGA)) tt_um_dpi_adexp (AdExp DPI Neuron ) tt_um_urish_sic1 (SIC-1 8-bit SUBLEQ Single Instruction Computer) tt_um_cedrichirschi_sar (SAR ADC Controller) tt_um_htfab_yadge (Yet Another Diffraction Grating Experiment) tt_um_ds_comp_adc (Delta Sigma Comparator Based ADC) tt_um_tinytapeout_logo_screensaver (VGA Screensaver with Tiny Tapeout Logo) Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available Available