Pydrofoil: accelerating Sail-based instruction set simulators

📅 2025-03-06
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
This work addresses the challenge of generating high-performance instruction set simulators (ISS) from Sail—a high-assurance ISA specification language—whose formal semantics impede efficient execution. We propose a hybrid compilation architecture integrating ahead-of-time (AOT) compilation with PyPy’s meta-tracing just-in-time (JIT) compiler. To exploit the bit-intensive, interpreter-loop-dominated nature of ISS execution, we introduce domain-specific optimizations: bit-level operation specialization and AOT/JIT co-scheduling. Evaluated on standard benchmarks, our approach achieves an average 230× speedup over the official Sail-generated C-based ISS, substantially outperforming either pure AOT or pure JIT baselines. Our key contribution is the first application of meta-tracing JIT compilation to ISA simulation, enabling end-to-end automatic compilation of Sail specifications into high-performance ISS. This establishes the first hybrid compilation framework bridging formal ISA specifications and production-grade simulation performance.

Technology Category

Application Category

📝 Abstract
We present Pydrofoil, a multi-stage compiler that generates instruction set simulators (ISSs) from processor instruction set architectures (ISAs) expressed in the high-level, verification-oriented ISA specification language Sail. Pydrofoil shows a>230x speedup over the C-based ISS generated by Sail on our benchmarks, and is based on the following insights. (i) An ISS is effectively an interpreter loop, and tracing just-in-time (JIT) compilers have proven effective at accelerating those, albeit mostly for dynamically typed languages. (ii) ISS workloads are highly atypical, dominated by intensive bit manipulation operations. Conventional compiler optimisations for general-purpose programming languages have limited impact for speeding up such workloads. We develop suitable domain-specific optimisations. (iii) Neither tracing JIT compilers, nor ahead-of-time (AOT) compilation alone, even with domain-specific optimisations, suffice for the generation of performant ISSs. Pydrofoil therefore implements a hybrid approach, pairing an AOT compiler with a tracing JIT built on the meta-tracing PyPy framework. AOT and JIT use domain-specific optimisations. Our benchmarks demonstrate that combining AOT and JIT compilers provides significantly greater performance gains than using either compiler alone.
Problem

Research questions and friction points this paper is trying to address.

Accelerates instruction set simulators using multi-stage compilation.
Optimizes bit manipulation operations for atypical ISS workloads.
Combines AOT and JIT compilers for enhanced ISS performance.
Innovation

Methods, ideas, or system contributions that make the work stand out.

Multi-stage compiler for ISS generation
Hybrid AOT and tracing JIT compilation
Domain-specific optimizations for bit manipulation
🔎 Similar Papers
No similar papers found.