Problems with hardware accelerator memory access

Problems with hardware accelerator memory access

by Herman Kristian Dieset -
Number of replies: 2

Hi! 

I have a problem with accessing the memory from the HA module. As the picture shows, the source address for the bitswapping and the destination address for the result are successfully written to the module (from slave access), and the bitswapping in C and using a custom instruction gives the same correct result. 


As may be evident, the module reads the value 0 from memory (src adr value), but that is not the correct value. I have made a testbench, and I know that the address the module reads from is coherent with what is written to the slave part. An image from the simulation is provided in the attachment, using dummy addresses. The resulting bitswap is correct. I suspect that the problem may be in the component declaration/definition. It is shown below.


A screenshot from QSYS is attached.

So if anyone can see anything wrong or have any suggestions to what could be done to fix this, I would be very grateful, please! 

Attachment qsys.png
Attachment tb_out.png
In reply to Herman Kristian Dieset

Re: Problems with hardware accelerator memory access

by René Beuchat -

Hello,

This remark will not solve your problem, but in your test bench, the first write access to access the register 0 is done with the reset activated.

In Qsys the connection between ha_bitswap_0-> avalon_master_0 to avalon_slve_0 musst not be done. Only with the memory.

In C, how do you specify the memory area used? As a global array in global memory, on stack?

Best.

RBeuchat

In reply to René Beuchat

Re: Problems with hardware accelerator memory access

by Herman Kristian Dieset -

Hi!

Thank you for your reply. I've corrected the connection in qsys to


In C, I've tried two things. Defining the variables as unsigned int in the main loop, which gave the console output presented in the first post. Then I tried defining them globally, as shown here:


The addresses differ, but the read value from memory is still zero. I also tried defining them globally with the volatile keyword, but got the same result. Do I need to define the variables in another way? 

Best regards,

Herman Dieset