Transactions on Cryptographic Hardware and Embedded Systems, Volume 2022
SoC Root Canal!:
Root Cause Analysis of Power Side-Channel Leakage in System-on-Chip Designs
README
RootCanal Artifact
This folder contains the artifact submission for RootCanal at CHES 2022.
Organization
Each example folder has the following structure:
- rtl/ folder contains the hardware design files
- synth/ folder contains the post-synthesis gate-level netlist and the gate to RTL mapping files
- sim/ folder contains the software source code, assembly file, binary file, testbench, test vectors, and the log of the program counter for each pipeline stage
- power/ folder has the mean power trace for the experiment
- aca/ folder contains the output result of the non-specific ACA for the experiment
- nga/ folder contains the scripts and outputs of netlist graph analysis
Steps
Step 1: Finding Leaky Time-Gate Tuples
The first step of RootCanal, will find the leaky time-gate tuples. This step includes synthesizing the design to generate the gate-level netlist, running gate-level simulation on the design, and simulating power consumption traces. ACA (https://arxiv.org/abs/2204.11972) is then used to find the leaky time-gate tuples.
This step of RootCanal is not open source.
Steps 2, 3: Finding Leaky Units and Instructions
nga/nga.py finds the leaky units and instructions.
Prerequisites:
To run the RootCanal on your design, the following files are required:
- ACA results
- For example, look at
aca/combinedresults-sum.yaml
- For example, look at
- PC log:
- Log of PC for each pipeline stage. An example is given in
sim/pc_log/folder. The first column is time and second column PC value.
- Log of PC for each pipeline stage. An example is given in
- Disassembly of the software program:
- By running
./compile.sh <program>insim/software/,sim/software/binaries/<program>.dumpfile is generated. This requires the 32bit RISC-V GCC to be installed. To install, follow the steps in https://github.com/riscv-collab/riscv-gnu-toolchain.
- By running
- gate-level netlist
- For example, look at
synth/skivav_sky130_50.v
- For example, look at
- HDL track file (optional)
- For example, look at
synth/skivav_sky130_50.g(generated by Cadence Genus)
- For example, look at
Setup:
To run NGA on your design, first the following scripts should be adjusted according to the design.
- nga/generate_graph.py: In the current form, this code can generate the graph from a gate-level netlist synthesized for SkyWater 130nm standard cell library and is used by nga/nga.py. Set the variable MAIN_MODULE to the name of the top-level module.
nga/nga.py: set the following variablesACA_RESULTS_FILE: set to the ACA output filePC_LOG_DIR: set to the PC log fileASSEMBLY_FILE: the disassmebly file of the software programFREQ: frequency of gate-level simulation in HzPC_LOG_TIMESCALE: time unit for PC log fileTOPLEVEL: name of the top level module in the netlistNAME: baseline of the output file namesNETLIST: set to the gate-level netlistG_FILE: set to the HDL track fileMODULE_NAMES: list of all RTL module namesMODULE_NAME_PIPE_STAGE_DICT: dictionary showing the pipeline stage for each RTL fileWITHIN_PROCESSOR_CORE: list of the RTL files inside the processor coreREGISTER_FILE: name of the register file inside the gate-level netlistEXTRA_PROCESSOR_MODULES: list of the mdoules out of the processor coreEXTRA_PROCESSOR_UNITS_DICT: dictionary showing the design block for each module out of the processor core
Run:
After setting the variables, on Ubuntu, run the following commands to install the required packages and run NGA:
sudo apt-get install python3
pip3 install argparse networkx pyyaml tqdm
python3 nga.py