This repository contains the source code for the Design and Implementation of Microprocessors (DIMP) Tutorial Kit project. The project is split into two main components:
arm7_sim– the backend simulation library and CLI test runnerarm7_gui– the graphical user interface built on top of the backend
The project models a simplified ARM7TDMI-inspired three-stage pipeline and provides tools for:
- writing and compiling assembly programs,
- executing them cycle-by-cycle,
- inspecting registers and memory,
- visualising pipeline behaviour.
.
├── arm7_sim/ # Backend simulator library and CLI
│ ├── src/
│ │ ├── compiler.rs # Assembly parsing / compilation
│ │ ├── cpu.rs # CPU state, cycle stepping, pipeline logic
│ │ ├── instructions.rs # Instruction decoding / execution logic
│ │ ├── memory.rs # Memory model
│ │ ├── lib.rs # Library entry point
│ │ └── bin/
│ │ └── arm7_cli.rs # Command-line entry point
│ └── tests/
│ └── cpu_tests.rs # Automated backend tests
│
└── arm7_gui/ # Slint GUI frontend
├── src/
│ └── main.rs # GUI application entry point
├── ui/
│ └── main.slint # Slint UI layout
├── build.rs # Slint build step
└── third_party/ # Bundled UI resources
The backend contains the core processor simulation logic.
-
src/cpu.rs
Implements the CPU state and cycle stepping logic, including:- fetch / decode / execute pipeline progression,
- hazard detection,
- branch flushing,
- register and PC updates.
-
src/compiler.rs
Compiles supported assembly syntax into machine code for execution. -
src/instructions.rs
Defines instruction behaviour and execution semantics. -
src/memory.rs
Implements the memory system used by the simulator. -
tests/cpu_tests.rs
Contains backend tests used to validate instruction execution, hazard handling, and pipeline behaviour.
From inside arm7_sim:
cargo testFrom inside arm7_sim:
cargo run --bin arm7_cliThe frontend provides the graphical interface for interacting with the simulator.
-
src/main.rs
Launches the desktop application and connects the GUI to the backend. -
ui/main.slint
Defines the application layout and interface behaviour.
- assembly editor,
- compile / step / run / reset controls,
- register viewer,
- memory explorer,
- pipeline viewer,
- console output.
From inside arm7_gui:
cargo runThe project was developed in Rust using Cargo as the build system.
- Crate:
arm7_sim - Rust edition: 2024
- Crate:
arm7_gui - Rust edition: 2021
- GUI framework: Slint 1.15.1
chronoregexserdeserde_jsonrfd
A standard stable Rust toolchain is required. If Rust is not installed, install it through rustup and then build the relevant component using Cargo.
If you want to run the full desktop application:
- Open a terminal in
arm7_gui/ - Build and run the GUI:
cargo runBecause arm7_gui depends on arm7_sim via a local path dependency, Cargo will automatically build the backend first.
- The backend and frontend are intentionally separated.
- The backend can be tested independently using
cargo test. - The frontend depends on the backend library and provides the user-facing simulator interface.
- The key cycle execution logic is located in
arm7_sim/src/cpu.rs. - The main GUI entry point is located in
arm7_gui/src/main.rs.
The implemented processor model is a simplified educational simulator inspired by the ARM7TDMI. It includes:
- a three-stage pipeline,
- cycle-by-cycle stepping,
- stall-based RAW hazard handling,
- pipeline flushing on branch instructions,
- an assembly compiler,
- a memory explorer and pipeline viewer in the GUI.
It is intended as a teaching and learning tool rather than a full ARM7TDMI-compatible implementation.