How to debug HSS from Scratchpad #100
-
In the latest release of the HSS source code, the HSS starts from L2Scratchpad. Doesn’t look like we can use flashpro to load scratchpad and debug. So, we would like to build the HSS to start from L2LIM instead of L2Scratchpad. However, we couldn't find any information regarding the instructions on customizing the HSS to run from L2LIM. Can you kindly let us know what all modifications are required to run HSS from L2LIM. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
Hi @ManishaI31214 it should be possible to debug from the L2 scratchpad using the steps outlined below, please come back with any feedback :) Note: we made a few changes to simplify the debug process and support the steps below, these changes have been mirrored to GitHub but are not captured in the 2022.03 tag. Anyone trying to follow the steps below will need to use the HSS from the master branch or a release greater than 2022.03.Debugging the HSS From L2 ScratchThe HSS is built in two parts:
It is possible to debug and step through the Part of the difficultly in debugging code targeting the L2 Scratchpad is that Once the reduced HSS is in a while loop a debug session can be started and the HSS Start-upThe HSS code resides in eNVM, but its code size is too large so it needs to be A small decompressor at the front of eNVM sets up L2 Scratchpad as required, There are two main reasons that we run from L2 Scratchpad and not LIM:
Debugging the hss-l2scratch.elfThere are two methods for debugging the HSS from the L2 scratchpad outlined below, the first using SoftConsole and the second using the command line. Debugging the hss-l2scratch.elf using SoftConsoleStep 1 - Program eNVM with a reduced HSSMake sure to clean, build and program the modified HSS to the eNVM
There should be no other mentions of either
When configured like this, the HSS will start running from eNVM on a power-cycle At this point, as long as the SoC isn’t reset or power-cycled, it is possible Step 2 - Use the debugger to download hss-l2scratch.elf to L2 Scratchpad
Debugging the hss-l2scratch.elf using command lineStep 1 - Program eNVM with a reduced HSSIn the
There should be no other mentions of either Make sure to clean, build and program the modified HSS to the eNVM:
When configured like this, the HSS will start running from eNVM on a power-cycle At this point, as long as the SoC isn’t reset or power-cycled, it is possible Step 2 - Use the debugger to download hss-l2scratch.elf to L2 ScratchpadImportant: at this point, revert your configuration changes and rebuild the HSS
There should be no other mentions of either Make sure to clean and build the modified HSS:
In a terminal window, start OpenOCD manually:
Next, in a separate terminal, run gdb and load an image as follows:
Finally, at the (gdb) prompt, load the hss-l2scratch.elf image:
At this point you can set any breakpoints etc. and start it running.
|
Beta Was this translation helpful? Give feedback.
-
Why do you suggest update HSS and run HSS from L2scratched instead of L2LIM? |
Beta Was this translation helpful? Give feedback.
-
So if user refer to https://github.com/orgs/polarfire-soc/discussions/100 , HSS will run successfully from L2scratch? |
Beta Was this translation helpful? Give feedback.
Hi @ManishaI31214 it should be possible to debug from the L2 scratchpad using the steps outlined below, please come back with any feedback :)
Note: we made a few changes to simplify the debug process and support the steps below, these changes have been mirrored to GitHub but are not captured in the 2022.03 tag. Anyone trying to follow the steps below will need to use the HSS from the master branch or a release greater than 2022.03.
Debugging the HSS From L2 Scratch
The HSS is built in two parts:
hss-l2scratch.elf
, which contains the run-time HSS code itselfhss-envm-wrapper.hex
, which includes a small decompressor, and thehss-l2scratch.elf
converted to a binary and compressed using DEFL…