0

I am trying to write executable programs to simulate using Verilator, but it seems like I am doing something wrong, as even the most simple program doesn't seem to run on the TinyRocketConfig.

The C code of the program:

#include <stdio.h>
#include <inttypes.h>
#include "mmio.h"

int main(void)
{
  uint32_t uint_32bits = 0x0FU;
  
  printf("%#x", uint_32bits);
  
  return 0;
}

When I run this program on Verilator on the normal RocketConfig it works, but when I try to do the same on the TinyRocketConfig it gets stuck forever without giving any output:

./simulator-chipyard-TinyRocketConfig-debug ../../tests/32b_test.riscv run-binary
This emulator compiled with JTAG Remote Bitbang client. To enable, use +jtag_rbb_enable=1.
Listening on port 35177
[UART] UART0 is here (stdin/stdout).

Having to cancel the execution manually after some time, any idea of why? Thanks for any answer and sorry for my little knowledge on the topic.

6
  • I'm guessing this has something to do with the stack size needed to run these tests. TinyRocketConfig only has 4KiB of backing memory by default. Have you tried increasing the DCache's number of sets so you can have 1MiB of backing memory? If that fixes it, it's a linker script issue with the stack size and the linker script will need some adjustments for TinyCore. Commented May 15, 2022 at 3:39
  • @metzkorn I have incremented the DCache of the TinyCore to 1 Mb and I am still in the same situation, any other possible ideas? Thanks Commented May 18, 2022 at 13:13
  • Did you compile this with the normal gcc instructions? If I remember correctly, those are targetting 64bit. I think you'll need to use the 32-bit gcc equivalents when compiling for TinyCore. Commented May 18, 2022 at 14:14
  • That might definitely be the issue, I will let you know as soon as I manage to compile for 32-bits as I am having some issues with it. Thanks Commented May 23, 2022 at 9:24
  • You can try passing -march=rv32i -mabi=ilp32 to riscv64-unknown-elf-gcc and see if that works. As described here github.com/ucb-bar/chipyard/issues/23 Commented May 23, 2022 at 15:18

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.