Git Product home page Git Product logo

riscv-isa-sim's Introduction

==========================================================================
RISC-V ISA Simulator
==========================================================================
# Author  : Andrew Waterman
# Date    : June 19, 2011
# Version : (under version control)

The RISC-V ISA Simulator implements a functional model of one or more
RISC-V processors.

--------------------------------------------------------------------------
Build Steps
--------------------------------------------------------------------------

 % mkdir build
 % cd build
 % ../configure
 % make
 % [sudo] make install

--------------------------------------------------------------------------
Usage
--------------------------------------------------------------------------

The riscv-isa-run program is not usually invoked directly; rather, fesvr, the
Front-End Server, invokes riscv-isa-run.  fesvr and riscv-pk must be installed
to simulate a RISC-V user program using riscv-isa-run.

--------------------------------------------------------------------------
Compiling and Running a Simple C Program
--------------------------------------------------------------------------

Install riscv-isa-run (see Build Steps), then install the following additional
packages: riscv-fesvr, riscv-gcc, riscv-pk.

Write a short C program and name it hello.c.  Then, compile it into a RISC-V
ELF binary named hello:

 % riscv-gcc -o hello hello.c

Now you can simulate the program:

 % riscv-fesvr hello

--------------------------------------------------------------------------
Simulating a New Instruction
--------------------------------------------------------------------------

Adding an instruction to the simulator requires two steps:

  1. Describe the instruction's functional behavior in the file
     riscv/insns/<new_instruction_name>.h.  Examine other instructions
     in that directory as a starting point.

  2. Add the instruction to the riscv-opcodes package:

      % cd ../riscv-opcodes
      % vi opcodes       // add a line for the new instruction
      % make install

  3. Rebuild the simulator.

riscv-isa-sim's People

Contributors

aswaterman avatar qmn avatar rimasaviz avatar yunsup avatar

Stargazers

 avatar

Watchers

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