Aleksandr Penskoi

Logo

Associate Professor
at SE&CS Faculty
at ITMO University
Russia


Associate Professor
at HDU-ITMO Joint Institute
China

View My GitHub Profile

Wrench

CPU Simulator, Assembler, and Auto-Grading Toolkit for Teaching Computer Architecture

Wrench is a production teaching platform for the Computer Architecture course at ITMO University. Students write programs in assembly for one of several deliberately different processor architectures, and a web service runs and checks their laboratory work automatically. Since April 2025, the service has run about 67,000 student programs, with around 90 users a day (as of November 2026).

Architecture Paradigm Inspired by
Acc32 Accumulator –
F32a Dual-stack machine GreenArrays F18a
RISC-IV Load/store RISC RISC-V
M68k Register-memory CISC Motorola 68000
VLIW-IV Static-scheduled VLIW, 4-wide bundles RISC-V + classic VLIW
Wasm32 Stack machine WebAssembly

Why simplified architectures?

Tools

Written in Haskell. Available as binaries for Linux, macOS, and Windows, and as a Docker image. To contribute, look at the issues or contact me in Telegram.

Example

Factorial on RISC-IV, the main loop (full source):

factorial_begin:
    addi     t2, zero, 1          ; acc = 1
factorial_while:
    beqz     t1, factorial_end    ; while (n != 0) {
    mul      t2, t2, t1           ;   acc *= n
    addi     t1, t1, -1           ;   n -= 1
    j        factorial_while      ; }

A YAML configuration sets the input, the reports to print, and the expected result, so the same file is a test case:

wrench factorial.s -c factorial-5.yaml

More programs for every architecture: examples.

Updated 11 November 2026