Altera_Forum
Honored Contributor
8 years agodirect DDR communication via VHDL/Verilog
Hello all,
I would like to setup a kernel with an RTL library that directly access the DDR. This kind of work is illustrated here, in example 2: https://www.altera.com/support/support-resources/design-examples/design-software/opencl/library-design-example.html Unfortunately, this example does not compile with the 17.1 suite (see this other thread (https://www.alteraforum.com/forum/showthread.php?t=57777)), but this is not the point here. I want to reproduce the engineering work done here but I am currently unable to do so. Here is my problem: I can see this interface in the XML code (for the CopyElement function here):
<MEM_INPUT port="m_input_dst" access="readwrite"/>
<MEM_INPUT port="m_input_src" access="readonly"/>
<INPUT port="m_input_global_id_0" width="32"/>
<INPUT port="m_input_local_id_3" width="32"/>
<INPUT port="m_input_global_size_0" width="32"/>
<INPUT port="m_workgroup_size" width="32"/>
<OUTPUT port="m_output_0" width="32"/>
<AVALON_MEM port="avm_local_bb1_ld_" width="512" burstwidth="5" optype="read" buffer_location="" />
<AVALON_MEM port="avm_local_bb1_st_" width="512" burstwidth="5" optype="write" buffer_location="" />
I understand that MEM_INPUT is for giving the pointer of an address to the RTL kernel. Got it. I also understand that AVALON_MEM is for defining an Avalon_mm interface that will be communicating with the BSP, the latter being responsible for DDR communication. The Avalon_mm interface to put in my RTL component should look like, also for CopyElement and for the avm_loval_bb1_ld interface:
input avm_local_bb1_ld__readdata,
input avm_local_bb1_ld__readdatavalid,
input avm_local_bb1_ld__waitrequest,
output avm_local_bb1_ld__address,
output avm_local_bb1_ld__read,
output avm_local_bb1_ld__write,
input avm_local_bb1_ld__writeack,
output avm_local_bb1_ld__writedata,
output avm_local_bb1_ld__byteenable,
output avm_local_bb1_ld__burstcount,
Until here, I'm ok. But now I would like to write some simple code that drives this interface, or at least use a simplifying black box. This is where I'm stuck. Because in the example, I have the idea that Intel designers only took what was produced by aocl compiler (written in openCL), and just copy/pasted it in this example. The modules are unreadable, have curious names, are organized as basic blocks... For instance, there is a module type called lsu_top which reminds me of the LSU generated with OpenCL. This block is directly wired to the previous interface signals. The complexity of the block on the underlying hierarchy prevents me from extracting information on how to drive the interface. Plus the files containing the description of the modules are on the internals of the generated project and so nowhere to be found on the example directory, but this is not the core of my problem. The point is: I am not able to retrieve information from the design example. I made a simple sketch describing my current understanding of the ... thing :) It is attached. Correct me if I'm wrong ! So my question is: where can I found some information on how to design a RTL module that can interface (INSIDE my OpenCL kernels of course) with the Avalon-MM without writing everything from scratch? Thanks in advance for any help! Alban