I couldn't think of a more descriptive title so let me please explain what i am trying to achieve.
I'm using a hardware accelerator and have quite some amount of data (weights, inputs, etc) that i need to send to the accelerator.
The idea was to use the SPI flash model to store the flash_stim (and the other data) in the flash memory, without using the UserPreload feature.
Now there are a few things that aren't clear to me which i couldn't resolve by reading the issues on github or reading the forum.
Here is my approach so far:
First i wrote an application to send data to the flash memory, similar to the send example.
I created an array that contains some data with the intend of having this array contain the data from the flash_stim.slm file (without the addresses).
This worked for smaller data sets where i defined an array with random sample data to send to the flash.
At some point the array (and therefore the whole code) was simply too big to fit in the Pri banks of the L2 memory and i was stuck in "Waiting for end of computation".
So now i am using JTAG to load my data into the non Pri banks of the L2 memory.
The goal is to send this data to the flash memory, effectively making the flash memory contain the same data as if i had been using the UserPreload feature of the S25FS256S model.
Sending data to the L2 via JTAG of course works fine but also raises the first question.
There are different stimuli files for either JTAG (stim.txt) or STANDALONE (flash_stim.slm).
Effectively they should both do the same thing in the end, but are different in size and format.
For example i can't use readmemh to load the flash_stim.slm into the stimuli array.
As far as i understand there is no way to directly load the flash memory via JTAG because it's not memory mapped, correct?
If this is true, then would the correct way to do this be:
1) Use JTAG to load the image (in this case the stim.txt) into L2 just as you would do when booting from L2 but use a different address (e.g. 0x1C030000).
2) Use SPI to transfer that data to the flash memory (this i do by code, similar to the send example i mentioned, using pulp_read32 to get the data from L2, but this seems rather inefficient).
3) Now i should be able to boot from ROM even tho i didn't use the UserPreload feature.
What i am wondering about are the following things:
- Is the way i described above the correct or rather most efficient way to do this?
- Is there a way to load the flash_stim.sml to flash without using the UserPreload feature or converting the format so readmemh can be used?
- This issue mentions the way to do this would be to write data from JTAG to L2 (like i am doing too) and then to engage the udma to transfer this data to the flash. Unfortunately i'm not sure how you would do this and i couldn't find a documentation or guide on this.
Thank you for your help,
LPLA
I'm using a hardware accelerator and have quite some amount of data (weights, inputs, etc) that i need to send to the accelerator.
The idea was to use the SPI flash model to store the flash_stim (and the other data) in the flash memory, without using the UserPreload feature.
Now there are a few things that aren't clear to me which i couldn't resolve by reading the issues on github or reading the forum.
Here is my approach so far:
First i wrote an application to send data to the flash memory, similar to the send example.
I created an array that contains some data with the intend of having this array contain the data from the flash_stim.slm file (without the addresses).
This worked for smaller data sets where i defined an array with random sample data to send to the flash.
At some point the array (and therefore the whole code) was simply too big to fit in the Pri banks of the L2 memory and i was stuck in "Waiting for end of computation".
So now i am using JTAG to load my data into the non Pri banks of the L2 memory.
The goal is to send this data to the flash memory, effectively making the flash memory contain the same data as if i had been using the UserPreload feature of the S25FS256S model.
Sending data to the L2 via JTAG of course works fine but also raises the first question.
There are different stimuli files for either JTAG (stim.txt) or STANDALONE (flash_stim.slm).
Effectively they should both do the same thing in the end, but are different in size and format.
For example i can't use readmemh to load the flash_stim.slm into the stimuli array.
As far as i understand there is no way to directly load the flash memory via JTAG because it's not memory mapped, correct?
If this is true, then would the correct way to do this be:
1) Use JTAG to load the image (in this case the stim.txt) into L2 just as you would do when booting from L2 but use a different address (e.g. 0x1C030000).
2) Use SPI to transfer that data to the flash memory (this i do by code, similar to the send example i mentioned, using pulp_read32 to get the data from L2, but this seems rather inefficient).
3) Now i should be able to boot from ROM even tho i didn't use the UserPreload feature.
What i am wondering about are the following things:
- Is the way i described above the correct or rather most efficient way to do this?
- Is there a way to load the flash_stim.sml to flash without using the UserPreload feature or converting the format so readmemh can be used?
- This issue mentions the way to do this would be to write data from JTAG to L2 (like i am doing too) and then to engage the udma to transfer this data to the flash. Unfortunately i'm not sure how you would do this and i couldn't find a documentation or guide on this.
Thank you for your help,
LPLA