GithubHelp home page GithubHelp logo

simonamtoft / riscv-simulator Goto Github PK

View Code? Open in Web Editor NEW
7.0 2.0 2.0 396 KB

A simulator of RISC-V instruction set written in Java

Java 94.67% Assembly 4.29% C 1.05%
java riscv32 gui rv32i riscv-simulator simulator

riscv-simulator's Introduction

RISCV-Simulator

An instruction set simulator for the RISC-V architecture written in Java. Written as the last assignment for the course "02155: Computer Architecture and Engineering" at the Technical University of Denmark

Simulates the RV32I Base Instruction Set (excluding EBREAK, CSR*, fence* and some environment calls)

Environment Calls

ID x10 Name Description
1 print_int Prints integer in x11
4 print_string Prints null-terminated string whose address is in x11
10 exit Stops execution
11 print_char Prints character in x11

Compiling and running

Install packages

If you haven't run a JavaFX application on Ubuntu before run the following command:

sudo apt-get install openjfx

Java Development Kit 8

Compile

Assuming no other Java files present:

cd path/to/package/files
javac *.java

Run

Assuming current work directory contains RISCVSimulator package directory:

cd path/to/package/
java RISCVSimulator.Main

OpenJDK 11

As OpenJDK no longer supplies a runtime environment or JavaFX, it is required to have OpenJFX downloaded. The path to OpenJFX will be referred to as %PATH_TO_FX%.

Compile

cd path/to/package/files
javac --module-path %PATH_TO_FX% --add-modules javafx.fxml,javafx.base,javafx.controls,javafx.graphics *.java

Run

Requires a Java 11 Runtime Environment. This is easily obtained on Ubuntu through apt, but Windows users will need to use jlink to build their own. See Releases for example. Assuming current work directory contains RISCVSimulator package directory:

cd path/to/package
java --module-path %PATH_TO_FX% --add-modules javafx.fxml,javafx.base,javafx.controls,javafx.graphics RISCVSimulator.Main

Unfortunately, the program was not written with modular Java support in mind. For this reason, there is no better way of running the program, as it's not possible to use jlink in order to build the application with all dependencies bundled. Writing batch files or shell scripts is adviced.

riscv-simulator's People

Contributors

msboeg avatar simonamtoft avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

wind0136 jim3692

riscv-simulator's Issues

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.