Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#14694: Stall unpacker till MMIO write to unpacker address completes #46

Merged
merged 1 commit into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions llk_lib/llk_unpack_A.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,6 @@ inline void _llk_unpack_A_(const std::uint32_t address, const bool transpose_of_
// Wait for free context
wait_for_next_context(2);

// Trisc::SEMPOST for context acquire
semaphore_post(semaphore::UNPACK_SYNC);

// Get tile address
if (0 == unp_cfg_context) {
if constexpr ((BType == BroadcastType::NONE) && (!acc_to_dest)) {
Expand Down Expand Up @@ -205,6 +202,12 @@ inline void _llk_unpack_A_(const std::uint32_t address, const bool transpose_of_
}
}

// Trisc::SEMPOST for context acquire
semaphore_post(semaphore::UNPACK_SYNC);

// Stall unpacker until pending CFG writes from Trisc have completed
TTI_STALLWAIT(p_stall::STALL_UNPACK, p_stall::TRISC_CFG);

// Run MOP
ckernel::ckernel_template::run(instrn_buffer);

Expand Down
3 changes: 3 additions & 0 deletions llk_lib/llk_unpack_AB.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ inline void _llk_unpack_AB_(
// Trisc::SEMPOST for context acquire
semaphore_post(semaphore::UNPACK_SYNC);

// Stall unpacker until pending CFG writes from Trisc have completed
TTI_STALLWAIT(p_stall::STALL_UNPACK, p_stall::TRISC_CFG);

// Run MOP
ckernel::ckernel_template::run(instrn_buffer);

Expand Down
9 changes: 6 additions & 3 deletions llk_lib/llk_unpack_reduce.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,19 @@ inline void _llk_unpack_reduce_(const std::uint32_t address) {
// Wait for free context
wait_for_next_context(2);

// Trisc::SEMPOST for context acquire
semaphore_post(semaphore::UNPACK_SYNC);

// Get tile address
if (0 == unp_cfg_context) {
cfg[THCON_SEC0_REG3_Base_address_ADDR32] = address;
} else {
cfg[THCON_SEC0_REG3_Base_cntx1_address_ADDR32] = address;
}

// Trisc::SEMPOST for context acquire
semaphore_post(semaphore::UNPACK_SYNC);

// Stall unpacker until pending CFG writes from Trisc have completed
TTI_STALLWAIT(p_stall::STALL_UNPACK, p_stall::TRISC_CFG);

// Run MOP
ckernel::ckernel_template::run(instrn_buffer);

Expand Down
9 changes: 6 additions & 3 deletions llk_lib/llk_unpack_tilize.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,19 @@ inline void _llk_unpack_tilize_(const std::uint32_t base_address, const std::uin
// Wait for free context
wait_for_next_context(2);

// Trisc::SEMPOST for context acquire
semaphore_post(semaphore::UNPACK_SYNC);

// Get tile address
if (0 == unp_cfg_context) {
cfg[THCON_SEC0_REG3_Base_address_ADDR32] = address;
} else {
cfg[THCON_SEC0_REG3_Base_cntx1_address_ADDR32] = address;
}

// Trisc::SEMPOST for context acquire
semaphore_post(semaphore::UNPACK_SYNC);

// Stall unpacker until pending CFG writes from Trisc have completed
TTI_STALLWAIT(p_stall::STALL_UNPACK, p_stall::TRISC_CFG);

// Run MOP
ckernel::ckernel_template::run(instrn_buffer);

Expand Down
9 changes: 6 additions & 3 deletions llk_lib/llk_unpack_untilize.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,16 +105,19 @@ inline void _llk_unpack_untilize_pass_(const std::uint32_t base_address, const s
// Wait for free context
wait_for_next_context(2);

// Trisc::SEMPOST for context acquire
semaphore_post(semaphore::UNPACK_SYNC);

// Get tile address
if (0 == unp_cfg_context) {
cfg[THCON_SEC0_REG3_Base_address_ADDR32] = base_address;
} else {
cfg[THCON_SEC0_REG3_Base_cntx1_address_ADDR32] = base_address;
}

// Trisc::SEMPOST for context acquire
semaphore_post(semaphore::UNPACK_SYNC);

// Stall unpacker until pending CFG writes from Trisc have completed
TTI_STALLWAIT(p_stall::STALL_UNPACK, p_stall::TRISC_CFG);

std::uint32_t face_2xr_cnt = 0;
for (std::uint32_t r = 0; r < FACE_HEIGHT; r++) {
rem_blocks_in_row = block_tile_cols; // reset remaining blocks in row
Expand Down
Loading