HEEPidermis is a chip based on the open-source RISC-V platform X-HEEP intended to record Galvanic Skin Response (GSR) and Impedance (Z). HEEPidermis is capable of injecting arbitrary-wave currents on the skin with an 8-bit iDAC and measure voltage through a 14-bit VCO-based ADC. Parameters of the iDAC and ADC can be programmed dynamically using the on-board Ibex CPU. Acquired data can be stored in the 16 kB RAM memory for on-chip processing, compression, and transmission.
HEEPidermis can be interfaced through JTAG for code-debugging, SPI to obtain recordings from memory, or UART. External ADCs and peripherals can also be commanded via SPI.
The Direct Memory Access (DMA) block allows the chip to operate autonomously without the constant interaction of the CPU. Given proper configuration, the DMA can take care of controlling the current injection profile, read data from the local ADC (or an external one), store data and/or transmit it through SPI. The DMA can additionally re-direct data to a digital Level Crossing (dLC) block to filter data and reduce the output data rate. The output of the dLC can be stored in memory (along timestamps) or be exposed to be used as feedback loop for the analog front-end, interface with transmission circuits or as input to Spiking Neural Networks. The dLC block also accepts inputs from analog LC ADCs (instead of the on-chip ADC).
HEEPidermis can also decimate 1-bit ΔΣ-ADCs' output with an integrated CIC filter or, alternatively, with an integrated custom smoothing stage, followed by the dLC block.
Being based on the X-HEEP platform, you can check its documentation on how to program, debug, or understand how it was built. We suggest using the vendorized X-HEEP's documentation. For all HEEPidermis-specific documentation, please refer to the documentation below.
- 
Analog Front End
 - 
Digital Back End
 - 
Related documents
 
Since this project is based on X-HEEP, it has the same prerequisites.
- Follow X-HEEP's Prerequisite section to download the necessary tools.
To correctly generate hardware and software, an extended version of the core-v-mini-mcu environment is required. To install it run:
make conda
 
Make sure the Conda environment is active:
conda activate heepidermis- Make sure that the following tools are available in your system's 
PATH:- RISC-V toolchain (supporting at least 
rv32imc) - Verible
 - GTKWave
 - Siemens QuestaSim version 2020.4 or above
 - Synopsys Design Compiler version 2020.09 or above
 - Verilator 4
 
 - RISC-V toolchain (supporting at least 
 
The included makefile proves all the necessary rules to build HEEPidermis:
- 
Generate all the RTL files (and software headers):
make cheep-gen
Some X-HEEP configuration parameters (e.g.
BUS,MEMORY_BANKSetc.) are still supported, although the default configuration may differ (checkperipherals_config). In general, these should not be passed through the makefile targets but should be configured in the hjson files in theconfigfolder. - 
Build the simulation model:
make verilator-build # Verilator make questasim-build # QuestaSim
 - 
The software build process is primarily handled by X-HEEP, and most of its example applications will work on HEEPidermis as well. You can choose other
BOOT_MODE, just be sure to match it with the one used withmake *-build(by default they usefore).forcewill be the faster for simulation. 
make app PROJECT=test_dlc_vco BOOT_MODE=forceThe combinations of compatible linker and boot modes can be found here:
- 
Launch the simulation with the compiled firmware:
make verilator-run # Verilator with waveforms dump make verilator-opt # Verilator without waveforms dump make questasim-run # QuestaSim make questasim-gui # QuestaSim with GUI
You can also set other parameters like the
FUSESOC_FLAGS,LOG_LEVEL,BOOT_MODE,VCD_MODE, etc. to customize the simulation. Refer to themakefilefor more details. - 
HEEPidermis
stdoutis exposed through a UART DPI interface at/dev/pts/<N>, whereNis a number printed on the simulation log during execution. You can connect to it usingscreenor similar tools, e.g.:screen /dev/pts/0
The UART output is also stored to the
uart.logfile in the common simulation directory (build/sim-common/uart.log).Using
printf()will significantly increase the firmware execution time and therefore the simulation. For quick debugging, it recommended to use the return value frommaininstead. When it is not zero, the testbench will print it out at the end of the simulation. - 
The waveforms dumped during the simulation can be opened using:
make verilator-waves # after Verilator simulation make questasim-waves # after QuestaSim simulation
 
This will open the waveforms (example from test_dlc_vco application):
Assuming that your firmware is already available, steps 1., 3., and 4. can be repeated with a single command using the verilator-sim or questasim-sim targets.
Have questions? curiosities? ideas on how to exploit HEEPidermis? Want to contribute on following versions of the SoC? Drop an email :) juan.sapriza@epfl.ch



