From 38baa95e8c81ce741796944fdaf0d69bf12cfbef Mon Sep 17 00:00:00 2001 From: Almeet Bhullar Date: Wed, 25 Oct 2023 15:48:42 +0000 Subject: [PATCH] #0: Adding accessors to get num host channels, their size, and base address to Cluster --- tt_metal/llrt/tt_cluster.cpp | 12 ++++++++++++ tt_metal/llrt/tt_cluster.hpp | 5 +++++ 2 files changed, 17 insertions(+) diff --git a/tt_metal/llrt/tt_cluster.cpp b/tt_metal/llrt/tt_cluster.cpp index 4992a410bc8..ed4a54a614c 100644 --- a/tt_metal/llrt/tt_cluster.cpp +++ b/tt_metal/llrt/tt_cluster.cpp @@ -545,6 +545,18 @@ void Cluster::l1_barrier(chip_id_t chip_id) const { this->device_->l1_membar(chip_id, "LARGE_WRITE_TLB"); } +uint32_t Cluster::get_num_host_channels(chip_id_t device_id) const { + return this->device_->get_num_host_channels(device_id); +} + +uint32_t Cluster::get_host_channel_size(chip_id_t device_id, uint32_t channel) const { + return this->device_->get_host_channel_size(device_id, channel); +} + +void *Cluster::host_dma_address(uint64_t offset, chip_id_t src_device_id, uint16_t channel) const { + return this->device_->host_dma_address(offset, src_device_id, channel); +} + } // namespace tt std::ostream &operator<<(std::ostream &os, tt_target_dram const &dram) { diff --git a/tt_metal/llrt/tt_cluster.hpp b/tt_metal/llrt/tt_cluster.hpp index 2e87e540ef6..2e17aea1cec 100644 --- a/tt_metal/llrt/tt_cluster.hpp +++ b/tt_metal/llrt/tt_cluster.hpp @@ -92,6 +92,11 @@ class Cluster { void dram_barrier(chip_id_t chip_id) const; void l1_barrier(chip_id_t chip_id) const; + uint32_t get_num_host_channels(chip_id_t device_id) const; + uint32_t get_host_channel_size(chip_id_t device_id, uint32_t channel) const; + // Returns address in host space + void *host_dma_address(uint64_t offset, chip_id_t src_device_id, uint16_t channel) const; + private: Cluster(); ~Cluster();