Skip to content

Commit

Permalink
#18064: Guard CSRRS by disabling branch prediction (#26)
Browse files Browse the repository at this point in the history
Due to a HW bug in CSR writes, we need to guard them by first disabling
branch prediction, and then re-enabling it. This is a workaround for
tenstorrent/tt-metal#18064 (comment)
and is proposed as a fix by the HW team.
  • Loading branch information
ncvetkovicTT authored Feb 27, 2025
1 parent d72939c commit 027bff1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tt_llk_blackhole/common/inc/ckernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -589,9 +589,15 @@ inline void disable_gathering() {
// Disable gathering: set bit 18
asm(R"ASM(
.option push
li t1, 0x2
csrrs zero, 0x7c0, t1
li t1, 0x1
slli t1, t1, 18
fence
csrrs zero, 0x7c0, t1
li t1, 0x2
csrrc zero, 0x7c0, t1
fence
.option pop
)ASM"
:::"t1");
Expand Down

0 comments on commit 027bff1

Please sign in to comment.