diff --git a/tt_metal/hw/firmware/src/erisc.cc b/tt_metal/hw/firmware/src/erisc.cc index 85dc7d4eb13..6fc472baba7 100644 --- a/tt_metal/hw/firmware/src/erisc.cc +++ b/tt_metal/hw/firmware/src/erisc.cc @@ -78,6 +78,7 @@ void __attribute__((section("erisc_l1_code.1"), noinline)) Application(void) { // FD: assume that no more host -> remote writes are pending if (mailboxes->launch.run == RUN_MSG_GO) { DeviceZoneScopedMainN("ERISC-FW"); + DeviceZoneSetCounter(mailboxes->launch.host_assigned_op_id); DEBUG_STATUS("R"); uint32_t kernel_config_base = mailboxes->launch.kernel_config_base; l1_arg_base = (uint32_t tt_l1_ptr *)(kernel_config_base + mailboxes->launch.rta_offsets[DISPATCH_CLASS_ETH_DM0]); diff --git a/tt_metal/hw/firmware/src/idle_erisc.cc b/tt_metal/hw/firmware/src/idle_erisc.cc index a5bacb80d1f..ee7f2217363 100644 --- a/tt_metal/hw/firmware/src/idle_erisc.cc +++ b/tt_metal/hw/firmware/src/idle_erisc.cc @@ -107,6 +107,7 @@ int main() { { DeviceZoneScopedMainN("ERISC-IDLE-FW"); + DeviceZoneSetCounter(mailboxes->launch.host_assigned_op_id); noc_index = mailboxes->launch.brisc_noc_id; diff --git a/tt_metal/tools/profiler/kernel_profiler.hpp b/tt_metal/tools/profiler/kernel_profiler.hpp index 3ff3d9b5a83..b307be780eb 100644 --- a/tt_metal/tools/profiler/kernel_profiler.hpp +++ b/tt_metal/tools/profiler/kernel_profiler.hpp @@ -129,7 +129,7 @@ namespace kernel_profiler{ eriscBuffer[i] = 0x80000000; } - eriscBuffer [ID_LL] = runCounter; + eriscBuffer [ID_LL] = (runCounter & 0xFFFF) | (eriscBuffer [ID_LL] & 0xFFFF0000); #endif //ERISC_INIT #if defined(COMPILE_FOR_BRISC) @@ -222,6 +222,13 @@ namespace kernel_profiler{ inline __attribute__((always_inline)) void set_host_counter(uint32_t counterValue) { +#if defined(COMPILE_FOR_ERISC) + volatile tt_l1_ptr uint32_t *eriscBuffer = reinterpret_cast(eth_l1_mem::address_map::PROFILER_L1_BUFFER_ER); + + eriscBuffer[ID_LL] = (counterValue << 16) | (eriscBuffer[ID_LL] & 0xFFFF); +#endif //ERISC_INIT + +#if defined(COMPILE_FOR_BRISC) volatile tt_l1_ptr uint32_t *briscBuffer = reinterpret_cast(PROFILER_L1_BUFFER_BR); volatile tt_l1_ptr uint32_t *ncriscBuffer = reinterpret_cast(PROFILER_L1_BUFFER_NC); volatile tt_l1_ptr uint32_t *trisc0Buffer = reinterpret_cast(PROFILER_L1_BUFFER_T0); @@ -233,6 +240,7 @@ namespace kernel_profiler{ trisc0Buffer[ID_LL] = (counterValue << 16) | (trisc0Buffer[ID_LL] & 0xFFFF); trisc1Buffer[ID_LL] = (counterValue << 16) | (trisc1Buffer[ID_LL] & 0xFFFF); trisc2Buffer[ID_LL] = (counterValue << 16) | (trisc2Buffer[ID_LL] & 0xFFFF); +#endif //ERISC_INIT } inline __attribute__((always_inline)) void risc_finished_profiling()