- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a Cyclone V with Linux application on ARM.
The application accesses FPGA directly by mapping HW light- and heavy-weight bridges into virtual memory space (without kernel driver).
Currently, I have a working application which does all access via alt_read_word() and alt_write_word().
I recall from NIOS documentation that this is the proper way to access HW memory to avoid caching issues but I couldn't find anything about it with regards to ARM. So I'd like to ask the following:
- Should FPGA memory be accessed by HPS only via SoCAL Memory Read/Write Utilities or it can be used as normal HPS RAM including calling memcopy() to move data between FPGA and HPS?
- Is there a document for SW developers which describes how HPS should access FPGA memory space?
Thanks.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
If you use the HPS and FPFA on chip RAM, then this can be accessed using the mmap() function in linux.
You can refer the Cyclone V GSRD on below link. https://www.rocketboards.org/foswiki/Documentation/CycloneVSoCGSRD
Cyclone V, FPGA-to-HPS Bridges Design Example
Regards
Tiwari
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Tiwari
I, indeed, use mmap() to gain access to FPGA memory space. But my question was about what happens during actual read and write.
Should I read the memory word-by-word using alt_read_word() function or reading big memory chunks using standard memcpy() also OK?
I am asking it because I'm not sure how ARM's data caching will behave during mempcpy() and I'm afraid caching can cause data corruption.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Cross-compiler vendors generally include a precompiled set of standard class libraries, including a basic implementation of memcpy() . Unfortunately, since this same code must run on hardware with a variety of processors and memory architectures, it can't be optimized for any specific architecture.
A variety of hardware and software factors might affect your decision about a memcpy() algorithm. These include the speed of your processor, the width of your memory bus, the availability and features of a data cache, and the size and alignment of the memory transfers your application will make.
An intimate knowledge of your target hardware and memory-transfer needs can help you write a much more efficient implementation of custom memcpy() functions.
You can also refer below link on memcpy and custom memcpy functions-
I suggest you to use the data reading using driver APIs i.e. alt_read_word();
Regards
Jeetesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
If you have any other question on the matter, please let me know.
Regards
Jeetesh

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page