GithubHelp home page GithubHelp logo

riscv-32ic-sim's Introduction

RISCV-32IC-Sim

Design

Our purpose from the very start was to create a universal ISA simulator working cross-platform on any ISA the user gives to it. In fact, we have a human friendly configuration file which contains all the RV32IC needed information that we can replace if wanted to with any other instruction set and our simulator would still work.

Implementation

Our program is composed of these main classes and concepts: Fetcher, Decoder, Decompressor, Simulator (Executor). Thus, we process the raw binary file and fetch every instruction, then pass it to the Decoder which decodes the binary instructions into Instruction objects which contains all the information it needs about the instruction by matching with the yaml file(instruction name, format, opcode, funct3/funct4/funct7, register s1, register s2, register d, immediate). This allows the Decompressor to easily understand what are the different fields the instruction has and print it on screen. Afterwards, the simulator takes this same Instruction object with its encoded instruction and matches the name of the instruction with one of its keys mapping to the execution function, as we have an implementation for every instruction in the RV32IC in a class called Instructions (note that RV32C ‘s instructions map to its equivalent uncompressed instruction).

Limitations

Unfortunately, we didn’t finish the compressed isa. In addition to that, our simulator is hardcoded (unlike the Decoder, and the Disassembler) so it is only compatible with RV32IC architecture. We didn’t also have the time to implement a user interface or add additional support to any other ISA (for instance, MIPS) but all of that will come later. 

riscv-32ic-sim's People

Contributors

khaledsoliman avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

riscv-32ic-sim's Issues

Adding to the Config File

Add the following in the config file:

  • Add Data Register File and Custom System Register File
  • Add Operators based on data
  • Create new instruction behavior based on the defined operators
  • Add Custom Interupts given hardcoded interrupts (like NMI, TMR,...)

Template Configuration File Refactoring

  • Remove 'key:op' from instruction group level to 'primaryKey' being at the top level of all formats.
  • Remove secondary and precedence and replace with concatenation in code.
  • Fix Immediate Formats.

config file improvements part2

  • Rename 'Name' to 'src' having as possible values either 'instr' or 'const'
    If 'const' then have a value field

  • Support all possible architectures (16,32,...)

  • Remove ImmediateLoadable

  • If several architectures, must devine default architecture then foreach instruction that is not the default size, specify a mapping instr.

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.