-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Debug host access to HyperRAM? #381
Comments
This is very weird. The SRAM and hyperRAM mapping should be the same in simulation and FPGA. Just to double check, can you run your example on the simulator matching the commit of your bitstream? |
I'm able to run hello world locally on FPGA with Sonata v1 when loaded via uf2 / USB storage driver so it might be something to do with the way @nwf is loading using OpenOCD? I'll check in with them when they are awake. |
This could be on the programming side, through the debug host on the SoC, rather than on the runtime/CPU side of things. If I run...
with
If I interleave loads and dumps, like this, I can see that the two purported copies of HyperRAM differ in exactly the way you'd expect given the above (for the first 146 bytes, the
Is it possible that the Debug Host's writes are asserting write enables on both SRAM and HyperRAM? FWIW, the board has the 1.0 bitstream in all three FPGA slots and the simple demo in software slot 1. I just redid that to be sure. But yes, if I load this image via the UF2 loader (hadn't had that working locally before now), it does indeed run fine, so it's not the image's fault, I think. ETA: is it possible to connect |
H-Hey!! sonata-system/data/xbar_main.hjson Line 234 in 46497b7
|
Experimenting with CHERIoT-Platform/cheriot-rtos#425, I have a build of the
01.hello_world
example that works fine in the sonata simulator (as in the devcontainer, build cdeeb9a17869, from today) but fails to get off the ground on the actual board.Some extremely tedious debugging 1 has brought me back to very early parts of the RTOS loader, specifically https://github.com/CHERIoT-Platform/cheriot-rtos/blob/52a1ba418013e1dbe55addf7b7fcf66e96bb4347/sdk/core/loader/boot.S#L45-L59. In particular,
ca1
correctly ends up being a tagged capability to0x00101d74
, in SRAM, and subsequent bytes, but the word read back byclw s0, IMAGE_HEADER_LOADER_CODE_START_OFFSET(ca1)
is sourced from0x40001d74
, in HyperRAM, and that's the beginning of an extremely rapid unintentional disassembly of the edifice that the loader is attempting to build.It certainly appears as though something about the actual synthesized gateware, as opposed to the simulated gateware, is misdirecting a read intended for SRAM to HyperRAM. Of note, the instructions being executed are being fetched from HyperRAM (and apparently, from observation, correctly so).
Does that theory hold water? Would the
01.hello_world
ELF and/or dump files be useful for investigation?Footnotes
In particular, this is early enough that basically nothing is initialized, but the 8 GPIO LEDs sure do work. So, 8 bits of information per recompile and code reload... let's not say "fast fluxing" of images, but I was happy to have OpenOCD working. ↩
The text was updated successfully, but these errors were encountered: