diff --git a/src/shim/hwctx.cpp b/src/shim/hwctx.cpp index 3f1602f6..5218de7e 100644 --- a/src/shim/hwctx.cpp +++ b/src/shim/hwctx.cpp @@ -176,6 +176,13 @@ get_slotidx() const return m_handle; } +size_t +hwctx:: +get_num_uc() const +{ + return m_col_cnt * 2; +} + xrt_core::cuidx_type hwctx:: open_cu_context(const std::string& cu_name) diff --git a/src/shim/hwctx.h b/src/shim/hwctx.h index d75b5ab4..e56bc7e0 100644 --- a/src/shim/hwctx.h +++ b/src/shim/hwctx.h @@ -64,6 +64,9 @@ class hwctx : public xrt_core::hwctx_handle slot_id get_slotidx() const override; + size_t + get_num_uc() const override; + xrt_core::hwqueue_handle* get_hw_queue() override; diff --git a/src/shim/umq/hwctx.cpp b/src/shim/umq/hwctx.cpp index 8c583d80..6f0f9016 100644 --- a/src/shim/umq/hwctx.cpp +++ b/src/shim/umq/hwctx.cpp @@ -16,7 +16,6 @@ hwctx_umq(const device& device, const xrt::xclbin& xclbin, const qos_type& qos) m_col_cnt = xp.get_column_cnt(); init_tcp_server(device); - init_log_buf(); } hwctx_umq:: @@ -27,8 +26,6 @@ hwctx_umq(const device& device, uint32_t partition_size) m_col_cnt = partition_size; init_tcp_server(device); - init_log_buf(); - // TODO: configure log BO on the hwctx shim_debug("Created UMQ HW context (%d)", get_slotidx()); } @@ -37,51 +34,6 @@ hwctx_umq:: { shim_debug("Destroying UMQ HW context (%d)...", get_slotidx()); fini_tcp_server(); - // TODO: unconfigure log BO on the hwctx - fini_log_buf(); -} - -void -hwctx_umq:: -init_log_buf() -{ - size_t column_size = 4096; - auto log_buf_size = m_col_cnt * column_size; - m_log_bo = std::make_unique - (m_pdev, log_buf_size, AMDXDNA_BO_CMD); - auto log_buf = m_log_bo->vaddr(); - std::memset(log_buf, 0, log_buf_size); - - auto f = xcl_bo_flags{0}; - f.use = XRT_BO_USE_LOG; - f.flags = XRT_BO_FLAGS_CACHEABLE; - f.access = XRT_BO_ACCESS_LOCAL; - f.dir = XRT_BO_ACCESS_READ_WRITE; - - m_log_bo->set_flags(f.all); - - std::map buf_sizes; - set_metadata(buf_sizes, m_col_cnt, column_size); - - // TODO: configure log BO on the hwctx once driver and fw support it - // we may use xrt.ini to control the config - m_log_bo->config(this, buf_sizes); -} - -void -hwctx_umq:: -fini_log_buf(void) -{ - // Nothing to do. -} - -void -hwctx_umq:: -set_metadata(std::map& buf_sizes, int num_ucs, size_t size) -{ - for (int i = 0; i < num_ucs; i++) { - buf_sizes[i] = size; - } } void diff --git a/src/shim/umq/hwctx.h b/src/shim/umq/hwctx.h index 75a59384..f04bcd79 100644 --- a/src/shim/umq/hwctx.h +++ b/src/shim/umq/hwctx.h @@ -23,20 +23,13 @@ class hwctx_umq : public hwctx { private: const pdev& m_pdev; - std::unique_ptr m_log_bo; uint32_t m_col_cnt = 0; - void *m_log_buf = nullptr; - std::unique_ptr m_tcp_server; std::thread m_thread_; void init_tcp_server(const device& dev); void fini_tcp_server(); - - void init_log_buf(); - void fini_log_buf(); - void set_metadata(std::map& buf_size, int num_cols, size_t size); }; }