// SPDX-FileCopyrightText: © 2026 Tenstorrent Inc. // SPDX-License-Identifier: Apache-2.0 // Round 8: cross-op weight prefetch by the cores a cmm program leaves idle. Each helper copies its chunks of a LATER // cmm's packed weight blocks from DRAM into the persistent L1 prefetch buffer of their owner (a top-row sender, // tt_kernels.CmmPrefetch): DRAM -> local scratch CB 22 -> remote L1. No semaphores: the consumer is a later program. // runtime: w_addr, n, then n x (bank, bank offset, dst x, dst y, dst addr, bytes) (fixed length). #include #include "api/dataflow/dataflow_api.h" void kernel_main() { const uint32_t w_addr = get_arg_val(0); const uint32_t n = get_arg_val(1); const uint32_t buf = get_write_ptr(22); for (uint32_t i = 0; i < n; ++i) { const uint32_t a = 2 + 6 * i; const uint32_t bank = get_arg_val(a), off = get_arg_val(a + 1); const uint32_t dx = get_arg_val(a + 2), dy = get_arg_val(a + 3); const uint32_t dst = get_arg_val(a + 4), bytes = get_arg_val(a + 5); noc_async_read(get_noc_addr_from_bank_id(bank, w_addr + off), buf, bytes); noc_async_read_barrier(); noc_async_write(buf, get_noc_addr(dx, dy, dst), bytes); noc_async_write_barrier(); } }