Entries from 2024-04-01 to 1 month

Checking LiteX's UART Hardware (Reading the Migen Source Code)

I wanted to check how LiteX's UART device behaves, so I'm going through the Migen source code: The UART device is connected via Wishbone. litex/litex/soc/cores/uart.py class UARTWishboneBridge(UARTBone): def __init__(self, pads, clk_freq, …

Changing the Spike Model Simulator Environment for My Own CPU (4. Booting the LiteX BIOS)

When I updated the Spike simulator for my own CPU for the first time in quite a while, a lot of functions had changed and I was thoroughly confused. I made the LiteX and Spike settings configurable and got it running in LiteX mode for now.…

Changing the Spike Model Simulator Environment for My Own CPU (3. Changing the Spike Configuration)

When I updated the Spike simulator for my own CPU for the first time in quite a while, a lot of functions had changed and I was thoroughly confused. Last time, the model simulator hung partway through, but after cleaning everything once an…

Investigating the RISC-V RVA/RVB Profiles

Regarding RISC-V profiles, a mysterious profile called RVB had been added following RVA, so I decided to investigate it. RVA is the one among RISC-V's profiles that targets application processors. RVB, on the other hand, is also a profile …

Changing the Spike Model Simulator Environment for My Own CPU (2. Changing the Spike Configuration)

When I updated the Spike simulator for my own CPU for the first time in quite a while, a lot of functions had changed and I was thoroughly confused. Last time, the model simulator hung partway through, but after cleaning everything once an…

Updating the Spike Model Simulator for My Own CPU

When I updated the Spike simulator for my own CPU for the first time in quite a while, a lot of functions had changed and I was thoroughly confused. I managed to fix all the compile errors and tried running it, but it seems an error occurs…

Investigating How to Build the LiteX BIOS Software Independently (2. Checking the Behavior of Spike's CLINT)

CLINT : 0x02000000 PLIC : 0x0c000000 When MIE is set, a timer interrupt is taken. core 0: 3 0x0000000000001760 (0x09313c23) mem 0x0000000010001fd8 0x0000000000000000 core 0: 0x0000000000001764 (0x0c0027b7) lui a5, 0xc002 core 0: 3 0x000000…

Checking the PLIC and CLINT Implementations in Spike

I updated to the latest Spike implementation and am trying various things to get the PLIC and CLINT working. I want to run the LiteX BIOS, so I've been trying all sorts of things. ../spike_dpi/riscv-isa-sim/spike -l --log-commits --dtb=../…

Checking the PLIC and CLINT Implementations in Spike

Continued from the previous article. I had assumed exception interrupt #7 was an exception, but it turned out to be an interrupt. This tells us that a timer interrupt was already being raised at the point where this interrupt was taken. Ti…

How to Start riscv-isa-sim from PC=0x0?

I wanted to tweak the verification environment for my own CPU so that I can run verification with the reset PC set to 0, but Spike keeps throwing an error. If I load an ELF that contains the boot code at 0x0, I get an error along the lines…

Investigating How to Build the LiteX BIOS Software Independently

I want to port the LiteX BIOS boot environment to my own RTL simulation environment, so I'm taking notes here. Basically, I move the whole litex/litex/soc/software/ directory, which shows up when you download LiteX, into a separate directo…

Trying to Build an SoC Environment with LiteX (21. Debugging with the ILA)

It's looping around 0x28. This is the exception handling part. 0000000000000020 <trap_entry>: 20: fe113c23 sd ra,-8(sp) 24: fe513823 sd t0,-16(sp) 28: fe613423 sd t1,-24(sp) 2c: fe713023 sd t2,-32(sp) 30: fca13c23 sd a0,-40(sp) 34: fcb13823 sd a1,-48(</trap_entry>…

Trying the Open-Source Waveform Viewer Surfer

It was a hot topic a little while ago, and I've been experimenting with Surfer, an open-source waveform viewer written in Rust. surfer-project / surfer · GitLab Until now I've mostly used GTKwave as my waveform viewer, but GTKwave is rathe…

About the UART Write Flow in LiteX

I'm going to check the flow of a UART write in LiteX. litex/litex/soc/software/libc/stdio.c static int litex_putc(char c, FILE *file) { (void) file; /* Not used in this function */ #ifdef CSR_UART_BASE uart_write(c); if (c == '\n') litex_p…