sdk/linux_kernel_drivers/xocl/xocl_exec.c
/**
 * configure_cu() - transfer command register map to specified CU and start the CU.
 *
 * @xcmd: command with register map to transfer to CU
 * @cu_idx: index of CU to configure
 *
 * This function is called in kernel software scheduler mode only.
 */
transfer command register map to specified CU and start the CU.
@xcmd: command with register map to transfer to CU
@cu_idx: index of CU to configure

This function is called in kernel software scheduler mode only.
transfer command register map to specified CU and start the CU . @xcmd : command with register map to transfer to CU @cu_idx : index of CU to configure This function is called in kernel software scheduler mode only .
static void
configure_cu(struct xocl_cmd *xcmd, int cu_idx)
{
	u32 i;
	void* user_bar = xcmd->xdev->user_bar;
	u32 cu_addr = cu_idx_to_addr(xcmd->xdev,cu_idx);
	u32 size = regmap_size(xcmd);
	struct ert_start_kernel_cmd *ecmd = (struct ert_start_kernel_cmd *)xcmd->packet;
	SCHED_DEBUGF("-> configure_cu cu_idx=%d, cu_addr=0x%x, regmap_size=%d\n"
		     ,cu_idx,cu_addr,size);
	for (i=1; i<size; ++i)
		iowrite32(*(ecmd->data + ecmd->extra_cu_masks + i),user_bar + cu_addr + (i<<2));
	iowrite32(0x1,user_bar + cu_addr);
	SCHED_DEBUG("<- configure_cu\n");
}
static void configure_cu ( struct xocl_cmd * xcmd , int cu_idx ) { u32 i ; void * user_bar = xcmd -> xdev -> user_bar ; u32 cu_addr = cu_idx_to_addr ( xcmd -> xdev , cu_idx ) ; u32 size = regmap_size ( xcmd ) ; struct ert_start_kernel_cmd * ecmd = ( struct ert_start_kernel_cmd * ) xcmd -> packet ; SCHED_DEBUGF ( " \n " , cu_idx , cu_addr , size ) ; for ( i = 1 ; i < size ; ++ i ) iowrite32 ( * ( ecmd -> data + ecmd -> extra_cu_masks + i ) , user_bar + cu_addr + ( i << 2 ) ) ; iowrite32 ( 0x1 , user_bar + cu_addr ) ; SCHED_DEBUG ( " \n " ) ; }
configure_cu() - transfer command register map to specified CU and start the CU.
configure_cu () - transfer command register map to specified CU and start the CU .
/* write register map, but skip first word (AP_START) */ /* can't get memcpy_toio to work */ /* memcpy_toio(user_bar + cu_addr + 4,ecmd->data + ecmd->extra_cu_masks + 1,(size-1)*4); */ /* start CU at base + 0x0 */