Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Adding comments for pll_setting_t and pll_setting_str #130

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions include/acl_pll.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 2 additions & 0 deletions src/acl_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
5 changes: 2 additions & 3 deletions src/acl_kernel_if.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
19 changes: 8 additions & 11 deletions src/acl_mem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down