title: Vivado/XSDK: How to access address from Zynq M_AXI_GP0 Bus?
body: <p>Let's say I built a vivado Zynq FPGA project, and I want to write and read the Zynq's "M_AXI_GP0" port from a c-program running on the zynq as follows.  Further, let's suppose the address I want to read and write on the "M_AXI_GP0" port of the Zynq is address "0x000A1000". How would I do that in the code below?  Do I need to worry about virtual address to physical address translation in the ARM?  is there a XIL api for that? etc... see code example:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include "platform.h"
  
  
  #include "xil_printf.h"
  
  void write(uint32_t addr, uint32_t wdata) {
     //????? how to implement
  }
  
  uint32_t read(uint32_t addr) {
      return 0;
  }
  
  int main()
  {
      init_platform();
  
      print("Hello World\n\r");
  
      uint32_t beef;
      write(0x000A1000, 0xDEADBEEF);
      write(0x000A1004, 0x12345678);
      beef = read(0x000A1000);
  
      cleanup_platform();
      return 0;
  }
  
  
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/aKZWL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aKZWL.png" alt="Xilinx ZYNQ - ARM CORTEX A9 -Xilinx SDK"></a></p>