sciecode / riscv-vector

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RV32G Processor model

This is the functional model of RISC-V instruction set architecture. It contains all the instructions necessary for running Mibench automotive programs using the base integer model. This model implements the following extensions:

  • Base integer instructions
  • Single-precision floating point instructions
  • Double-precision floating point instructions
  • Atomic instructions

Installation

acsim riscv.ac -abi     (Create the simulator)
make                    (Compile it)

Use the official RISC-V toolchain for creating the executables. Follow the steps on the RISC-V page to download the toolchain. Use the rvv-next branch when generating the toolchain binaries ( includes vector extension support ).

Configure GCC for RISC-V with the following options to enable 32-bit code generation for general purpose riscv (newlib):

./configure --prefix=/opt/riscv --with-arch=rv32imafdv --with-abi=ilp32d
make

How to create executables

Follow the steps below:

  • Step 1:. Go to the tests->libac_sysc folder and run make command via terminal.

  • Step 2:. Copy the folder of the program you wish to test from test/acstone-programs, test/automotive-IMA or test/acstone-FP to the test folder. Enter that folder and run make.

  • Use test/paranoia/Makefile as a starting point for compiling other programs.

Running the executable

To run a test program on the simulator, use the following command line:

./riscv.x -- <path/to/the/executable>.run

Debugging

Generate the simulator with -gdb flag(i.e, acsim -abi -gdb) and use, for example:

./riscv.x -- 201.atomic.riscv
riscv32-unknown-elf-gdb 201.atomic.riscv

Inside gdb use:

target remote :5000

to connect to the riscv simulator.

Future Work

The following topics need further improvement:

  • Atomic instructions needs multicore testing.
  • System instructions: CSRR* needs more testing.
  • Complete Vector Extension floating point instructions.

Float and double instructions proved to be stable as confirmed by paranoia.

References

I used the following as a reference for developing this model:

Code imported

This model uses the following third-party code:

About


Languages

Language:C 72.9%Language:C++ 14.0%Language:Makefile 11.0%Language:Assembly 2.1%