LoginSignup
0
0

More than 5 years have passed since last update.

Zybo > Chronicles blog 50 > AMPの使用 > 7. OCMによるCore同士の通信 > 実装 > データ転送 > 1:Xil_IO使用 / 2:ポインタ使用

Last updated at Posted at 2016-06-22

MicroZed Chronicles リスト http://adiuvoengineering.com/?page_id=285
@ Adam Taylor blog
https://forums.xilinx.com/t5/Xcell-Daily-Blog/Adam-Taylor-s-MicroZed-Chronicles-Part-50-AMP-and-the-Zynq-SoC-s/ba-p/521889

OCM経由でのCore0, Core1間の通信の実装例

The demo for this will use CPU0 to communicate over the UART link to a laptop. We’ll send an 8-bit ASCII value from the laptop to the Zynq Soc’s UART. Once received, this 8-bit value will be transferred into the selected OCM memory address, which is shared between the two processors. Each time its private timer expires, CPU1 will read this memory address and set its GPIO output pins accordingly.

使用するメモリアドレスを選択する。そのためにOCMのキャッシュを切る

Xil_SetTlbAttributes(0xFFFF0000,0x14de2);

指定のメモリアドレスへのデータ転送方法は2つある。

The first method uses the generic Xilinx I/O functions to read from and write to the selected memory address.

Xil_Out8(0xFFFF0000,0x55);

read_char = Xil_In8(0xFFFF0000);

The second method is for both programs to access the memory location using pointers.

#define LED_OP (*(volatileunsignedint *)(0xFFFF0000))
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0