Skip to content

Commit

Permalink
Modified to use logical coords over virtual coords.
Browse files Browse the repository at this point in the history
  • Loading branch information
sagarwalTT committed Dec 12, 2024
1 parent 1603162 commit be3a236
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
2 changes: 1 addition & 1 deletion docs/source/tt-metalium/tools/kernel_print.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Note that the core coordinates are logical coordinates, so worker cores and ethe
export TT_METAL_DPRINT_CHIPS=0 # optional, comma separated list of chips
export TT_METAL_DPRINT_RISCVS=BR # optional, default is all RISCs. Use a subset of BR,NC,TR0,TR1,TR2
export TT_METAL_DPRINT_FILE=log.txt # optional, default is to print to the screen
export TT_METAL_DPRINT_PREPEND_DEVICE_CORE_RISC=0 # optional, enabled by default. Prepends prints with <device id>:(physical core x, physical core y):<RISC>:.
export TT_METAL_DPRINT_PREPEND_DEVICE_CORE_RISC=0 # optional, enabled by default. Prepends prints with <device id>:(<core x>, <core y>):<RISC>:.
export TT_METAL_DPRINT_ONE_FILE_PER_RISC=1 # optional, splits DPRINT data on a per-RISC basis into files under $TT_METAL_HOME/generated/dprint/. Overrides TT_METAL_DPRINT_FILE and disables TT_METAL_DPRINT_PREPEND_DEVICE_CORE_RISC.
To generate kernel debug prints on the device, include the ``debug/dprint.h`` header and use the APIs defined there.
Expand Down
10 changes: 2 additions & 8 deletions tt_metal/impl/debug/dprint_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
#include <set>
#include <filesystem>
#include <tuple>
#include "common/core_descriptor.hpp"
#include "device/device_handle.hpp"
#include "llrt/llrt.hpp"
#include "tt_metal/common/logger.hpp"

Expand All @@ -28,7 +26,6 @@

#include "hostdevcommon/dprint_common.h"
#include "tt_metal/impl/device/device.hpp"
#include "tt_metal/impl/device/device_pool.hpp"

using std::cout;
using std::endl;
Expand Down Expand Up @@ -1220,13 +1217,10 @@ string DebugPrintServerContext::GetDataToOutput(const HartKey& hart_key, const o
const CoreDescriptor& core_desc = get<1>(hart_key);
const uint32_t risc_id = get<2>(hart_key);

Device* device = tt::DevicePool::instance().get_active_device(device_id);
const CoreCoord& phys_core_coord = device->virtual_core_from_logical_core(core_desc.coord, core_desc.type);

const string& device_id_str = to_string(device_id);
const string& phys_core_coord_str = phys_core_coord.str();
const string& core_coord_str = core_desc.coord.str();
const string& risc_name = GetRiscName(core_desc.type, risc_id, true);
output += fmt::format("{}:{}:{}: ", device_id_str, phys_core_coord_str, risc_name);
output += fmt::format("{}:{}:{}: ", device_id_str, core_coord_str, risc_name);
}

if (stream->str().empty()) {
Expand Down

0 comments on commit be3a236

Please sign in to comment.