Skip to content

Commit

Permalink
#12855: Fix unpacker race condition by putting stall after MMIO
Browse files Browse the repository at this point in the history
  • Loading branch information
Anil Mahmud authored and Anil Mahmud committed Nov 5, 2024
1 parent 45dc5cc commit 5375c5e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions llk_lib/llk_unpack_AB_matmul.h
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,6 @@ inline void _llk_unpack_AB_matmul_(
// Wait for free context
wait_for_next_context(2);

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

// Program unpacker 1 base address
if (0 == unp_cfg_context) {
cfg[THCON_SEC0_REG3_Base_address_ADDR32] = address_b;
Expand All @@ -247,6 +245,11 @@ inline void _llk_unpack_AB_matmul_(
cfg[THCON_SEC1_REG3_Base_cntx1_address_ADDR32] = address_a;
}

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

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

if (reuse_a) {
#if SKIP_UNP == 1
TTI_NOP;
Expand Down

0 comments on commit 5375c5e

Please sign in to comment.