Unable to interface the memory of custom peripheral correctly
Hello community,
I'm trying to write data to and read data from a custom ip via the HPS of a Cyclone V SoC. The custom ip is a simple RAM with 16 x 32 Bits of storage and connected via the LW AXI Bus as an avalon slave. (see qsys.png, component.png and memory_avalon.vhd)
When I write 32 bits into a register I would expect that only the addressed register is updated with the respective data but in my case writing to a register in the custom ip affects other registers, too. A few bits will be set depending on the input data in the other registers (see output.txt). Also strange is, that I cannot write to the
The system is created in the platform designer and the generated .qsys file is used as the top-level file. In the pin planner the clock and reset signals are assigned and the system synthesizes successfully. Then, I regenerated the preloader.
Afterwards, I use a uboot image and a linux kernel to boot into a terminal. In linux I wrote a simple user space application that mmaps the peripheral into ram (code is adjusted from the "Embedded Linux Beginners Guide" from Rocketboards.org) that can read and write those registers. (see testsystem.c)
In the BFM simulation the registers could be written and read correctly. Therefore, I think something is wrong with my linux configuration or my userspace application.
Has anybody faced such a problem yet ?
Since I'm new to this forum I hope that the provided information is sufficient. If not, please ask for specific parts.
Thanks in advance!
Tim
Hello,
thanks for your reply. The address is 0x0 or 0x3f I don't remember but it should be close to the lightweight bus base. But in the meanwhile I found the issue.
The avalon read process that I implemented was not complete. The else part for the "if avs_s0_read = '1' then" was missing. Therefore, the syntheziser inferred this process to be registered and clocked by "avs_s0_read". The message about the incorrectly inferred registered process was hidden among the warnings.
After implementing the else block and putting all read signals into the sensitivity list the peripheral works as expected. Although, I read in one of the threads in this community that the sensitivity list should not be the issue since it's not used during synthesizing but only for simulation.