ucb-bar / riscv-mini

Simple RISC-V 3-stage Pipeline in Chisel

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

riscv-mini doesn't support print and declare the float data type variable

jtxiao82 opened this issue · comments

Hi,

I try to use the test.ld, syscall.c and crt.S from (riscv-tools and checkout to 4635ab67966c763a84f7217bc2c20b65dcabc7ec. Those sources exist in riscv-tests/benchmarks/common/. These two steps follow riscv-mini/build-riscv-tools.sh) for building the custom-bmark.

It would be success for compiling program and execute simulation with no any warning like (TOHOST: XXXX).

The simulation warning will occur during execution the system call (like printf) or floating variable computation. The screenshot shows the warning during the previous two scenarios.

main.c

int add(int a, int b);

int main(int argc, char** argv) {
  int res = add(3, 2);

  // Simple float variable computation
  float a = 1.0;
  for(int i = 0; i < 10; i++) {
    a += 0.5;
  }

  return res == 5 ? 0 : -1;
}

image

Environment

  • Ubuntu 16.04
  • riscv-gnu-toolchain installtion (based on riscv-mini/build-riscv-tools.sh)
    • riscv32-unknown-elf-gcc (GCC) 5.3.0
  • Verilator 3.922 2018-03-17

There is an another question. Could riscv-mini team provide the some source code (riscv-mini/src/test/resources/) and its corresponding crt.S, syscall.c, util.h, linker sciprt (test.ld).

Thanks you very much!!

Riscv-mini just support the basic RV32I ISA, so that float type will report error. This issue should be closed.