GaloisInc / BESSPIN-CloudGFE

The AWS cloud deployment of the BESSPIN GFE platform.
Apache License 2.0
2 stars 2 forks source link

Build 32-bit Rocket FireSim AFI #87

Closed dhand-galois closed 4 years ago

dhand-galois commented 4 years ago

Need to test a 32-bit rocket core (similar to P1 level specs)

dhand-galois commented 4 years ago

Have a P1 working in simulation. Built an AFI and will be testing it later today.

dhand-galois commented 4 years ago

Not a particularly "wow" moment, but have a simple "Hello World" program running on a P1 on an F1 instance. Waiting on better FreeRTOS driver support to see something more exciting.

Commencing simulation.
Hello World!

*** PASSED *** after 28066727 cycles
time elapsed: 0.5 s, simulation speed = 58.38 MHz
FPGA-Cycles-to-Model-Cycles Ratio (FMR): 1.54
Runs 28066727 cycles
[PASS] FireSim Test
SEED: 1589956272
podhrmic commented 4 years ago

Nice! Which binary did you run so it printed the message?

dhand-galois commented 4 years ago

Just a simple one I wrote. I modified the riscv-tests's benchmark bare metal environment to use the SiFive UART and compiled a #include <stdio.h> void main() { printf("Hello World\n"); } using that setup. I can share the code and/or binary if it'd be helpful

podhrmic commented 4 years ago

Yes please, that would be great!

dhand-galois commented 4 years ago

Attached here.

helloworld.zip

This assumes you have a properly compiled multilib riscv64-unknown-elf-* toolchain. If you get an error compiling it, it probably isn't fully enabled for multilib (the toolchain chipyard builds by default is not). You could try changing it to riscv32-unknown-elf- if you have that available.

I also added a busy loop to each putchar call to ensure the character has time to make it out to the simulator console before ending the simulation.

dhand-galois commented 4 years ago

Fairly well tested at this point. The current Chisel P1 based AGFI is agfi-01c6bf6f90700bec2, which includes all devices and tracing support.

The latest AGFIs can be found in BESSPIN-CloudGFE/FireSim/README.md

This can be built using the FireSimCloudGFEChiselP1Config target in FireSim and the CloudGFEChiselP1Config target in chipyard.