Skip to content

Commit

Permalink
#3764: ETH support
Browse files Browse the repository at this point in the history
  • Loading branch information
mo-tenstorrent committed Jul 5, 2024
1 parent 6667d80 commit 60b867f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions tt_metal/hw/firmware/src/erisc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down
1 change: 1 addition & 0 deletions tt_metal/hw/firmware/src/idle_erisc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ int main() {

{
DeviceZoneScopedMainN("ERISC-IDLE-FW");
DeviceZoneSetCounter(mailboxes->launch.host_assigned_op_id);

noc_index = mailboxes->launch.brisc_noc_id;

Expand Down
10 changes: 9 additions & 1 deletion tt_metal/tools/profiler/kernel_profiler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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<volatile tt_l1_ptr uint32_t*>(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<volatile tt_l1_ptr uint32_t*>(PROFILER_L1_BUFFER_BR);
volatile tt_l1_ptr uint32_t *ncriscBuffer = reinterpret_cast<volatile tt_l1_ptr uint32_t*>(PROFILER_L1_BUFFER_NC);
volatile tt_l1_ptr uint32_t *trisc0Buffer = reinterpret_cast<volatile tt_l1_ptr uint32_t*>(PROFILER_L1_BUFFER_T0);
Expand All @@ -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()
Expand Down

0 comments on commit 60b867f

Please sign in to comment.