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: 
Observer pstootman
Observer
6,965 Views
Registered: ‎03-29-2015

2016.1 openamp - missing memory barrier ?

Jump to solution

SDK 2016.1, openamp_v1_0 component of BSP, default linaro toolchain.

 

I think MEM_BARRIER() macro turns out to be defined as blank in openamp source code

 

From;

workspacename\bspname\ps7_cortexa9_1\libsrc\openamp_v1_0\src\open-amp\lib\include\openamp\system\freertos\machine\zynq7\machine_system.h

 

 

/* Memory barrier */
#if (defined(__CC_ARM))
#define MEM_BARRIER() __schedule_barrier()
#elif (defined(__GNUC__))
#define MEM_BARRIER() asm volatile("dsb" : : : "memory")
#else
#define MEM_BARRIER()
#endif

 

It is used in bm_env.c functions [env_mb(), env_rmb(), env_wmb() ], which are in turn used in the vring buffer access code.

 

Is this a bug ? There should be a barrier to prevent re-ordering (either in compiler, or in CPU or DDR controller) on the order of accesses to the DDR for the vrings ?

 

I am having a problem with PS0/linux and PS1/FreeRTOS, where the Zynq(A9) chip hangs if I use -O2 compiler optimisation for the PS1 side (which is the default optimisation level for BSP) if I am moving data between PL<=>DDR while at the same time doing PS0<=>PS1 openamp communications (with vrings in DDR)  ... if I use -O0 on the PS1 side (for both BSP and my application), the chip no longer hangs.

 

Thanks.

 

0 Kudos
1 Solution

Accepted Solutions
Observer pstootman
Observer
13,234 Views
Registered: ‎03-29-2015

Re: 2016.1 openamp - missing memory barrier ?

Jump to solution

Sorry; my mistake; I thought __GNUC__ is not defined based on viewing code in SDK editor... but it is defined automatically during the build by the compiler (which SDK editor doesn't know); so, the barriers are used, which is good.

0 Kudos
1 Reply
Observer pstootman
Observer
13,235 Views
Registered: ‎03-29-2015

Re: 2016.1 openamp - missing memory barrier ?

Jump to solution

Sorry; my mistake; I thought __GNUC__ is not defined based on viewing code in SDK editor... but it is defined automatically during the build by the compiler (which SDK editor doesn't know); so, the barriers are used, which is good.

0 Kudos