-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* #13637: Adding L-shape multicast - low level API, test. Still WIP * #13637: Added L-shape multicast API and tests * #13637: update docs and not limit tests to slow dispatch * #13637: fix pre-commit failures * #13637: clean up debug code * #13637: fix noc 1 core calculations, wrap BH only code with #ifdef * #13637: internally handle noc1 exclusion direction, update API method name * #0: fix typo
- Loading branch information
Showing
4 changed files
with
296 additions
and
14 deletions.
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
tests/tt_metal/tt_metal/test_kernels/dataflow/dram_to_l1_multicast_exclude_region.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// SPDX-FileCopyrightText: © 2023 Tenstorrent Inc. | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
#include "dataflow_api.h" | ||
|
||
void kernel_main() { | ||
uint32_t src_addr = get_arg_val<uint32_t>(0); | ||
uint32_t src_noc_x = get_arg_val<uint32_t>(1); | ||
uint32_t src_noc_y = get_arg_val<uint32_t>(2); | ||
uint32_t src_buffer_size = get_arg_val<uint32_t>(3); | ||
|
||
uint32_t local_addr = get_arg_val<uint32_t>(4); | ||
|
||
uint32_t dst_addr = get_arg_val<uint32_t>(5); | ||
uint32_t dst_noc_x_start = get_arg_val<uint32_t>(6); | ||
uint32_t dst_noc_y_start = get_arg_val<uint32_t>(7); | ||
uint32_t dst_noc_x_end = get_arg_val<uint32_t>(8); | ||
uint32_t dst_noc_y_end = get_arg_val<uint32_t>(9); | ||
uint32_t num_dests = get_arg_val<uint32_t>(10); | ||
uint32_t exclude_start_x = get_arg_val<uint32_t>(11); | ||
uint32_t exclude_start_y = get_arg_val<uint32_t>(12); | ||
uint32_t exclude_dir_x = get_arg_val<uint32_t>(13); | ||
uint32_t exclude_dir_y = get_arg_val<uint32_t>(14); | ||
|
||
|
||
// Read src buffer into local L1 buffer | ||
uint64_t src_buffer_noc_addr = get_noc_addr(src_noc_x, src_noc_y, src_addr); | ||
noc_async_read(src_buffer_noc_addr, local_addr, src_buffer_size); | ||
noc_async_read_barrier(); | ||
|
||
// multicast local L1 buffer to all destination cores | ||
uint64_t dst_noc_multicast_addr = get_noc_multicast_addr( | ||
dst_noc_x_start, | ||
dst_noc_y_start, | ||
dst_noc_x_end, | ||
dst_noc_y_end, | ||
dst_addr); | ||
uint32_t noc_exclude_region = get_noc_exclude_region( | ||
exclude_start_x, | ||
exclude_start_y, | ||
exclude_dir_x, | ||
exclude_dir_y); | ||
noc_async_write_multicast_exclude_region(local_addr, dst_noc_multicast_addr, src_buffer_size, num_dests, noc_exclude_region); | ||
noc_async_write_barrier(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.