GithubHelp home page GithubHelp logo

githubyangjunyi / cpusimulator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from 20zurmca/cpusimulator

0.0 1.0 0.0 2.06 MB

Designed a simulation of an ARM assembler and CPU in a GUI

Java 19.84% AngelScript 0.41% Makefile 0.01% HTML 73.89% JavaScript 0.35% CSS 5.50%

cpusimulator's Introduction

CPUSimulator

Overal Description

This Project is composed of a three-program tool chain. This README will describe the order in which programs should be called and how to run the toolchain.

Program 1: Assembler

Description: A program that interprets common ARM assembly instructions and generates an image file (.o file) and stores the program instructrions into simulated main memory.

Input: “AssemblyCode.as”
Output: “AssemblyCode.o” in the working directory

Command line usage:
java LaunchAssembler “AssemblyCode.as”

After running the program, check the Assembler directory for the file.

Program 2: CPU_Emulator

Descirption: A GUI that displays the processing of pre-written ARM assembly. The user can interact with the GUI using buttons.

Input: “AssemblyCode.o” “true/false”
(Note: If “AssemblyCode.o” is somehow not in this directory, copy the file over from the Assembler directory.)
Output: A GUI allowing the user to control a simulation. Opon completion of the LEGv8 assembly, a "state of the machine" summary report will be printed to the CLI and there is an optional export to file button. This report summarizes the content of all registers and flags.

Command line usage:
java LaunchCPU “AssemblyCode.o” Boolean
Pass “true” to Boolean value for noisy mode (a debugging mode which shows print statements of the simulation in the CLI). Else, pass “false”.

Program 3: Viewer

Description: A GUI that displays the simulated memory. The user can examine specific parts of the memory. The size of the memory is specified in the .as file for Program 1.

**Command line usage: java LaunchVisualizer String, Boolean, int, int
String is the name of the image file you would like to view. Make sure this file is in the “Viewer” directory. Boolean is either “true” for viewing the memory in hexadecimal, or “false” for binary.
The first int is the starting position in memory you’d like to view. This int must be in hexadecimal and divisible by 4. This int must be at least 0 and no greater than the second int.
The second int is the ending position in memory you’d like to view. This int must be in hexadecimal and divisible by 4. This int must be at least the first int and no greater than the maximum memory size (which is specified in the .as file).

Output: A GUI allowing the user to examine arbitrary memory.
Example: java LaunchVisualizer “AssemblyCode.o” “true” 4 c

Distribution

The Jar_Distribution directory contains jar files that execute the programs with the same command line arguments as described. You will find project manuels in that folder that deliever the same information as the README.md. Project Documentation is available in the Documentation folder. Click on index.html

Demo

Running the simulation on "fast mode" with binary. ARM assembly code in lower right corner. Notice the Viewer Program also launches:
Note that the boxes labelled with "X_" are registers. PC is program counter. IR is instruction register.

After clicking "export to file:":

Demonstrating the memory viewer:

  • hex:

  • bin: (Notice that the Viewer Program can specify the memory region that you can view)

Running Noisy Mode for debugging:

Future Expandability

Future expandability includes adding more ARM instructions to the parsers as well as cleaning up the GUI. The goal is to be able to design an assembler that can simulate any given object file. This project is ~80% there

cpusimulator's People

Contributors

20zurmca avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.