Skip to content
/ webdlx Public

DLX architecture simulator written in TypeScript & React

Notifications You must be signed in to change notification settings

micorix/webdlx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

5179431 Β· Jan 27, 2024

History

2 Commits
Jan 27, 2024
Jan 27, 2024
Jan 27, 2024
Jan 27, 2024
Jan 27, 2024
Jan 27, 2024
Jan 27, 2024
Jan 27, 2024
Jan 27, 2024
Jan 27, 2024
Jan 27, 2024
Jan 27, 2024
Jan 27, 2024
Jan 27, 2024
Jan 27, 2024
Jan 27, 2024
Jan 27, 2024
Jan 27, 2024
Jan 27, 2024
Jan 27, 2024

Repository files navigation

WebDLX

0️⃣1️⃣0️⃣1️⃣0️⃣1️⃣0️⃣1️⃣0️⃣1️⃣0️⃣1️⃣

Processor simulator written in TypeScript for the DLX architecture. Inspired by WinDLX.

Screenshot See all screenshots

Instructions follow WinDLX format and opcode table.

Info: 🦺 Work in progress. Lots of features are missing. Only integer registers are supported. Forwarding is not yet implemented.

DLX simulator can be used as a command line tool, library or a web application.

Motivation

Kinda related to the university course on computer architecture. This was not an assignment, just a fun project. Might abandon at any time or never finish.

Could all of that be done in a better way, with less effort or is WinDLX enough? The answer is YES! But c'mon writing own parser, assembler, getting pipeline stalls to work properly, implementing forwarding, creating in-browser unit tests editor to assert on mem and registers values, just sounds fun!

Features:

  • 🎨 Tired of Windows XP look? New, modern UI!
  • :www: No need to install, run directly within the browser (asynchronously in a WebWorker)!
  • πŸ”  Support for WinDLX instructions
  • πŸ’… Syntax highlighting? Oh yeah, we've got that. No more NotePad++ within a VM.
  • πŸ“Š Real-time pipeline visualization
  • πŸ’Ύ Register and memory inspection interface
  • βœ”οΈ Write tests in JavaScript for program correctness
    • chai.js assertions on register/memory values
    • I'm sorry, I think it's pretty cool
  • πŸ“ƒ Detailed, logs
  • 1️⃣ DLX assembly language assembler, including tokenizer, lexer and parser
  • πŸ” TODO: Profiler

TODO:

  • Implement pipeline
    • Implement basic pipeline
    • Implement stalls (WIP)
    • Implement forwarding
  • Implement int registers
  • Implement basic immediate arithmetic instructions and sw, lw
  • Implement memory preloading
  • Implement all instructions
  • Implement floating point instructions/registers
  • Implement double precision instructions/registers
  • Implement jumps
  • Implement profiler

Library

Library is written in TypeScript. The only runtime dependency is nanoevents package which contains isomorphic event emitter.

Command line tool

pnpm tsx repl/repl.ts -s <source file>

Web application

Web app is a client-side React application bundled with Vite.

pnpm install
pnpm run dev

Screenshots

VSCode-like Monaco Editor with syntax highlighting:

Editor screenshot

Real-time pipeline visualization:

Pipeline visualization

Tests:

Tests screenshot

References