diff --git a/include/acl_pll.h b/include/acl_pll.h index 4314d146..da00aad4 100644 --- a/include/acl_pll.h +++ b/include/acl_pll.h @@ -8,16 +8,19 @@ #include "acl_bsp_io.h" +// Settings for the Phase-Locked-Loop +// note that we use double frequency of the kernel clock for some double-pumped +// memories typedef struct { - unsigned int freq_khz; - unsigned int m; - unsigned int n; - unsigned int k; - unsigned int c0; - unsigned int c1; - unsigned int r; - unsigned int cp; - unsigned int div; + unsigned int freq_khz; /* output frequency in kHZ */ + unsigned int m; /* multiplier factor */ + unsigned int n; /* 1st divider factor */ + unsigned int k; /* 2nd divider factor */ + unsigned int c0; /* output divider for kernal clock */ + unsigned int c1; /* output divider for double kernal clock */ + unsigned int r; /* lowpass filter setting */ + unsigned int cp; /* charge pump gain setting */ + unsigned int div; /* PLL mode */ } pll_setting_t; typedef struct { diff --git a/src/acl_device.cpp b/src/acl_device.cpp index 71f11a51..210ef231 100644 --- a/src/acl_device.cpp +++ b/src/acl_device.cpp @@ -708,6 +708,8 @@ clReleaseDevice(cl_device_id device) { ACL_EXPORT CL_API_ENTRY cl_int clReconfigurePLLIntelFPGA(cl_device_id device, const char *pll_settings_str) { + // To get the format of the second string argument please refer to the code + // comments specified for struct pll_setting_t in include/acl_pll.h const acl_hal_t *hal; cl_int configure_status; acl_lock(); diff --git a/src/acl_kernel_if.cpp b/src/acl_kernel_if.cpp index 9501716a..5ebdf439 100644 --- a/src/acl_kernel_if.cpp +++ b/src/acl_kernel_if.cpp @@ -1211,9 +1211,8 @@ void acl_kernel_if_launch_kernel_on_custom_sof( } else { offset = (unsigned int)KERNEL_OFFSET_INVOCATION_IMAGE; image_p = (uintptr_t) & (image->work_dim); - image_size_static = - (size_t)((uintptr_t) & (image->arg_value) - (uintptr_t) & - (image->work_dim)); + image_size_static = (size_t)( + (uintptr_t) & (image->arg_value) - (uintptr_t) & (image->work_dim)); } if ((kern->io.debug_verbosity) >= 2) { diff --git a/src/acl_mem.cpp b/src/acl_mem.cpp index af10328d..afae7ba2 100644 --- a/src/acl_mem.cpp +++ b/src/acl_mem.cpp @@ -5604,8 +5604,8 @@ void acl_mem_migrate_buffer(void *user_data, acl_device_op_t *op) { #ifdef MEM_DEBUG_MSG printf("release block %zx (%u:%u) ", - (size_t)(src_mem->reserved_allocations[src_device] - [src_mem_id]), + (size_t)( + src_mem->reserved_allocations[src_device][src_mem_id]), src_device, src_mem_id); #endif remove_mem_block_linked_list( @@ -5991,9 +5991,8 @@ static void l_mem_transfer_buffer_explicitly(cl_context context, dst_unmap_cmd.info.mem_xfer.map_flags = CL_MAP_WRITE; } dst_unmap_cmd.info.mem_xfer.src_mem = context->unwrapped_host_mem; - dst_unmap_cmd.info.mem_xfer.src_offset[0] = - (size_t)((char *)dst_mem->host_mem.aligned_ptr - - (char *)ACL_MEM_ALIGN); + dst_unmap_cmd.info.mem_xfer.src_offset[0] = (size_t)( + (char *)dst_mem->host_mem.aligned_ptr - (char *)ACL_MEM_ALIGN); dst_unmap_cmd.info.mem_xfer.src_offset[1] = 0; dst_unmap_cmd.info.mem_xfer.src_offset[2] = 0; dst_unmap_cmd.info.mem_xfer.dst_mem = dst_mem; @@ -6340,9 +6339,8 @@ void acl_copy_device_buffers_to_host_before_programming( cmd.info.mem_xfer.src_offset[2] = 0; cmd.info.mem_xfer.dst_mem = context2->unwrapped_host_mem; if (mem->flags & CL_MEM_USE_HOST_PTR) { - cmd.info.mem_xfer.dst_offset[0] = - (size_t)((char *)mem->fields.buffer_objs.host_ptr - - (char *)ACL_MEM_ALIGN); + cmd.info.mem_xfer.dst_offset[0] = (size_t)( + (char *)mem->fields.buffer_objs.host_ptr - (char *)ACL_MEM_ALIGN); } else { cmd.info.mem_xfer.dst_offset[0] = (size_t)((char *)mem->host_mem.aligned_ptr - (char *)ACL_MEM_ALIGN); @@ -6486,9 +6484,8 @@ void acl_copy_device_buffers_from_host_after_programming( cmd.type = CL_COMMAND_WRITE_BUFFER; cmd.info.mem_xfer.src_mem = context2->unwrapped_host_mem; if (mem->flags & CL_MEM_USE_HOST_PTR) { - cmd.info.mem_xfer.src_offset[0] = - (size_t)((char *)mem->fields.buffer_objs.host_ptr - - (char *)ACL_MEM_ALIGN); + cmd.info.mem_xfer.src_offset[0] = (size_t)( + (char *)mem->fields.buffer_objs.host_ptr - (char *)ACL_MEM_ALIGN); } else { cmd.info.mem_xfer.src_offset[0] = (size_t)((char *)mem->host_mem.aligned_ptr - (char *)ACL_MEM_ALIGN);