UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Explorer
Explorer
652 Views
Registered: ‎08-31-2017

How to check the available DRAM address under linux

Jump to solution

Hi, dear elites,

 

 I'm a senior IC designer and new to Linux. Now I have a ZYBO board porting linux for some SW application via Python. I need to load a pattern file and enable DMA for data mover. Here we emulate the behavior of stream data moving from other interface via CPU. 

However, I don't know how to check the DRAM address where the Python load the pattern for DMA configuration. I need your help how to check the available DRAM address of user space which I can force Python to load the pattern file to the region first and enable DMA later. 

 

Test SW developed in Python for the following flow :

1.CPU load pattern file to DRAM <-- Goal: Emulate streaming data from other HW to verify the design behavior first 

2.Enable DMA for DATA mover  <-- However, I dont know the physical address of pattern file moved by CPU in step 1

3.Enable Co-processor engine

 

All the best,

Nanson

0 Kudos
1 Solution

Accepted Solutions
Scholar austin
Scholar
936 Views
Registered: ‎02-27-2008

Re: How to check the available DRAM address under linux

Jump to solution

N,

 

Perhaps tougher than you think.  Python operates on data as much as possible in place, and only when it reaches the final step in the function being executed.

 

As everything is dynamically assigned, only when it gets to where a result is required to be displayed, or written to a file, or printed on the console, you are chasing a moving target.  Rather, I suggest you instrument your hardware AND Python to reveal what you are interested in.  Understand the instrumentation will likely slow things down, as well.

 

With so many layers, finding THE address, is hopeless (there is no such thing).  Finding an address is more easily discovered by placing 'printf' c functions in-line in the Python code (Python will execute in line c code, look that up).

 

http://cython.org/

 

Austin Lesea
Principal Engineer
Xilinx San Jose

View solution in original post

0 Kudos
2 Replies
Scholar austin
Scholar
937 Views
Registered: ‎02-27-2008

Re: How to check the available DRAM address under linux

Jump to solution

N,

 

Perhaps tougher than you think.  Python operates on data as much as possible in place, and only when it reaches the final step in the function being executed.

 

As everything is dynamically assigned, only when it gets to where a result is required to be displayed, or written to a file, or printed on the console, you are chasing a moving target.  Rather, I suggest you instrument your hardware AND Python to reveal what you are interested in.  Understand the instrumentation will likely slow things down, as well.

 

With so many layers, finding THE address, is hopeless (there is no such thing).  Finding an address is more easily discovered by placing 'printf' c functions in-line in the Python code (Python will execute in line c code, look that up).

 

http://cython.org/

 

Austin Lesea
Principal Engineer
Xilinx San Jose

View solution in original post

0 Kudos
Explorer
Explorer
609 Views
Registered: ‎10-04-2017

Re: How to check the available DRAM address under linux

Jump to solution

  One way is you would need to convert the virtual to a physical address in userspace.  I'm not sure how to do that. 

  A second way, is you could just reserve a block of memory in the devicetree at a fixed address, then you can mmap that address from userspace and initialize it and you would already have the physical address for the DM.   I believe the keywork in the devicetree is reserved-memory.  This is pretty simple in C, I don't know about python.

 

jeff

 

0 Kudos