diff --git a/tt_metal/common/metal_soc_descriptor.cpp b/tt_metal/common/metal_soc_descriptor.cpp index 7b41d62c8cf..3b879d43421 100644 --- a/tt_metal/common/metal_soc_descriptor.cpp +++ b/tt_metal/common/metal_soc_descriptor.cpp @@ -134,18 +134,18 @@ void metal_SocDescriptor::load_dram_metadata_from_device_descriptor() { int worker_endpoint = dram_view["worker_endpoint"].as(); size_t address_offset = dram_view["address_offset"].as(); - if (channel >= dram_cores.size()) { + if (channel >= get_grid_size(CoreType::DRAM).x) { TT_THROW( "DRAM channel {} does not exist in the device descriptor, but is specified in dram_view.channel", channel); } - if (eth_endpoint >= dram_cores[channel].size()) { + if (eth_endpoint >= get_grid_size(CoreType::DRAM).y) { TT_THROW( "DRAM subchannel {} does not exist in the device descriptor, but is specified in " "dram_view.eth_endpoint", eth_endpoint); } - if (worker_endpoint >= dram_cores[channel].size()) { + if (worker_endpoint >= get_grid_size(CoreType::DRAM).y) { TT_THROW( "DRAM subchannel {} does not exist in the device descriptor, but is specified in " "dram_view.worker_endpoint", @@ -153,8 +153,12 @@ void metal_SocDescriptor::load_dram_metadata_from_device_descriptor() { } this->dram_view_channels.push_back(channel); - this->dram_view_eth_cores.push_back(dram_cores[channel][eth_endpoint]); - this->dram_view_worker_cores.push_back(dram_cores[channel][worker_endpoint]); + tt::umd::CoreCoord eth_dram_endpoint_coord = + get_dram_core_for_channel(channel, eth_endpoint, CoordSystem::VIRTUAL); + this->dram_view_eth_cores.push_back({eth_dram_endpoint_coord.x, eth_dram_endpoint_coord.y}); + tt::umd::CoreCoord worker_endpoint_coord = + get_dram_core_for_channel(channel, worker_endpoint, CoordSystem::VIRTUAL); + this->dram_view_worker_cores.push_back({worker_endpoint_coord.x, worker_endpoint_coord.y}); this->dram_view_address_offsets.push_back(address_offset); } } diff --git a/tt_metal/llrt/tlb_config.cpp b/tt_metal/llrt/tlb_config.cpp index e5459ca4c3d..1113be07843 100644 --- a/tt_metal/llrt/tlb_config.cpp +++ b/tt_metal/llrt/tlb_config.cpp @@ -172,14 +172,10 @@ void configure_static_tlbs( default: TT_THROW("Configuring static TLBs is not supported for {}", tt::get_string(arch)); } - auto statically_mapped_cores = sdesc.workers; - statically_mapped_cores.insert( - statically_mapped_cores.end(), sdesc.ethernet_cores.begin(), sdesc.ethernet_cores.end()); std::int32_t address = 0; - // Setup static TLBs for all worker cores - for (auto& core : statically_mapped_cores) { - auto tlb_index = get_static_tlb_index(core); + for (const CoreCoord& core : sdesc.get_cores(CoreType::TENSIX, sdesc.get_umd_coord_system())) { + auto tlb_index = get_static_tlb_index({core.x, core.y}); // TODO // Note: see issue #10107 // Strict is less performant than Posted, however, metal doesn't presently @@ -188,6 +184,11 @@ void configure_static_tlbs( // Revisit this when we have a more flexible UMD api device_driver.configure_tlb(mmio_device_id, core, tlb_index, address, TLB_DATA::Strict); } + // Setup static TLBs for all eth cores + for (const CoreCoord& core : sdesc.get_cores(CoreType::ETH, sdesc.get_umd_coord_system())) { + auto tlb_index = get_static_tlb_index({core.x, core.y}); + device_driver.configure_tlb(mmio_device_id, core, tlb_index, address, TLB_DATA::Strict); + } // TODO (#9932): Remove workaround for BH if (arch != tt::ARCH::BLACKHOLE) {