~zachs/hardware-loop-rerolling

Artifact for "Loop Rerolling for Hardware Decompilation", PLDI 2023
add paper link
upload artifact to my personal repo

refs

main
browse  log 

clone

read-only
https://git.sr.ht/~zachs/hardware-loop-rerolling
read/write
git@git.sr.ht:~zachs/hardware-loop-rerolling

You can also use your local clone with git send-email.

#Loop Rerolling for Hardware Decompilation: Artifact

#Paper

Loop Rerolling For Hardware Decompilation
Zachary D. Sisco, Jonathan Balkind, Timothy Sherwood, Ben Hardekopf
Programming Language Design and Implementation (PLDI) 2023

#Artifact Overview

For evaluation, we split the artifact into 4 main parts:

  1. Loop Identification (/loop-identification/):

    • Given a benchmark suite of module-level netlists,run our loop identification tool over each netlist and produce a set of loop candidates.The result is a generated Racket file for each netlist (translated to our hardware loop rerolling IR, Maki) that gets fed into the loop rerolling tool in Step 2.
  2. Loop Rerolling (/loop-reolling/):

    • For each Maki IR program and set of loop candidates generated from Step 1, perform hardware loop rerolling. The result is a decompiled HDL program (in either SystemVerilog or PyRTL) with rerolled loops.
  3. Simulation (/simulation/):

    • To compare simulation times between the decompiled HDL code with rerolled loops and the original netlist, we have a set of scripts that simulates the two designs in Verilator and collects the timing results.
  4. Yosys Scripts for Converting Verilog to BLIF (/yosys-scripts/):

    • While we provide all netlists for evaluating the benchmark suite, users can also generate their own from Verilog using Yosys. For evaluation, the scripts in this directory are optional.

#Requirements

If evaluated through the Docker container, all requirements will already be satisfied, but for clarity, our tool requires the following:

  • Python v3.9
  • PyRTL with branch blif-cells checked out
  • Racket >v8.1 (the Docker image installs 8.7)
  • Rosette
  • Verilator (optional, used for simulation evaluation)
  • Yosys (optional, used for producing and importing your own netlists)

#How to proceed

The whole environment for the artifact can be set up using Docker.

#Step 1

Run the docker-build.sh script to build the Docker image. (Depending how Docker is installed on your machine, you may need to run the script with sudo/doas.)

$ ./docker-build.sh`

#Step 2

After successfully building the Docker image, run the docker-run.sh to launch the Docker image, landing you at a bash shell prompt.

$ ./docker-run.sh`

#Step 3

Next, cd into the loop-identification directory, and read the README.md file, following the steps written there.

#Step 4

Next, cd into the loop-rerolling directory, and read the README.md file, following the steps written there.

#Step 5

Finally, cd into the simulation directory, and read the README.md file, following the steps written there.