GithubHelp home page GithubHelp logo

adv_co_toh's Introduction

Advanced CO course

Description

Using the RISC-V RV32I[MA] emulator with ELF support which the emulator is shared on Hackaday be Frank Buss. as a single C-file. Shaos added some additional statics and macros.

Requires libelf-dev:

$ sudo apt-get install libelf-dev

How to compile it:

$ gcc -O3 -Wall -lelf emu-rv32i.c -o emu-rv32i

Passed RV32I compliance tests from https://github.com/riscv/riscv-compliance

$ make RISCV_TARGET=spike RISCV_DEVICE=rv32i TARGET_SIM=/full/path/emulator variant

Compiling and running simple code:

$ riscv32-unknown-elf-gcc -O3 -nostdlib test1.c -o test1

or

$ riscv64-unknown-elf-gcc -march=rv32i -mabi=ilp32 -O3 -nostdlib test1.c -o test1

then

$ ./emu-rv32i test1
Hello RISC-V!

RV32M and RV32A instructions may be enabled by commenting #define STRICT_RV32I.

Emulator rv32i

It is a emulator in order to execute the elf file and simulate the behavior of the execution environment when executing the file.

And, This file can be separated into different parts.

==Note== You should refer to the RISC-V ISA Manual Volume II and RISC-V ISA Manual Volume I carefully to understand the basic instruction set and some information of CSRs registers.

adv_co_toh's People

Watchers

James Cloos avatar Eric Tai 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.