Skip to content

JUSTadICE-CHaN/DIMP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DIMP Tutorial Kit / ARM7 Simulator

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 runner
  • arm7_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.

Repository Structure

.
├── 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

Component Overview

1. arm7_sim – Backend

The backend contains the core processor simulation logic.

Main files

  • 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.

Running backend tests

From inside arm7_sim:

cargo test

Running the backend CLI

From inside arm7_sim:

cargo run --bin arm7_cli

2. arm7_gui – Frontend

The frontend provides the graphical interface for interacting with the simulator.

Main files

  • src/main.rs
    Launches the desktop application and connects the GUI to the backend.

  • ui/main.slint
    Defines the application layout and interface behaviour.

Features exposed by the GUI

  • assembly editor,
  • compile / step / run / reset controls,
  • register viewer,
  • memory explorer,
  • pipeline viewer,
  • console output.

Running the GUI

From inside arm7_gui:

cargo run

Environment Used

The project was developed in Rust using Cargo as the build system.

Backend

  • Crate: arm7_sim
  • Rust edition: 2024

Frontend

  • Crate: arm7_gui
  • Rust edition: 2021
  • GUI framework: Slint 1.15.1

Additional frontend dependencies

  • chrono
  • regex
  • serde
  • serde_json
  • rfd

A standard stable Rust toolchain is required. If Rust is not installed, install it through rustup and then build the relevant component using Cargo.


Build / Run Order

If you want to run the full desktop application:

  1. Open a terminal in arm7_gui/
  2. Build and run the GUI:
cargo run

Because arm7_gui depends on arm7_sim via a local path dependency, Cargo will automatically build the backend first.


Notes for Assessment

  • 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.

Known Scope of the Project

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors