Skip to content

Commit

Permalink
Merge branch 'main' into brosko/enable_bh
Browse files Browse the repository at this point in the history
  • Loading branch information
broskoTT authored Feb 24, 2025
2 parents eab64fe + c59c9d0 commit 3a6f43f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
3 changes: 3 additions & 0 deletions device/api/umd/device/tt_device/tt_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ class TLBManager;

class TTDevice {
public:
// TODO #526: This is a hack to allow UMD to use the NOC1 TLB. Don't use this function.
static void use_noc1(bool use_noc1);

/**
* Creates a proper TTDevice object for the given PCI device number.
*/
Expand Down
5 changes: 4 additions & 1 deletion device/cluster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ using namespace boost::interprocess;
using namespace tt;
using namespace tt::umd;

extern bool umd_use_noc1;

static const uint32_t MSG_ERROR_REPLY = 0xFFFFFFFF;

// TLB size for DRAM on blackhole - 4GB
Expand Down Expand Up @@ -3440,7 +3442,8 @@ tt_xy_pair Cluster::translate_to_api_coords(const chip_id_t chip, const tt::umd:

tt_xy_pair Cluster::translate_chip_coord_virtual_to_translated(const chip_id_t chip_id, const tt_xy_pair core) const {
CoreCoord core_coord = get_soc_descriptor(chip_id).get_coord_at(core, get_coord_system_used());
auto translated_coord = get_soc_descriptor(chip_id).translate_coord_to(core_coord, CoordSystem::TRANSLATED);
auto translated_coord = get_soc_descriptor(chip_id).translate_coord_to(
core_coord, umd_use_noc1 ? CoordSystem::PHYSICAL : CoordSystem::TRANSLATED);
return translated_coord;
}

Expand Down
6 changes: 6 additions & 0 deletions device/tt_device/tt_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,13 @@
#include "umd/device/tt_device/grayskull_tt_device.h"
#include "umd/device/tt_device/wormhole_tt_device.h"

// TODO #526: This is a hack to allow UMD to use the NOC1 TLB.
bool umd_use_noc1 = false;

namespace tt::umd {

void TTDevice::use_noc1(bool use_noc1) { umd_use_noc1 = use_noc1; }

TTDevice::TTDevice(
std::unique_ptr<PCIDevice> pci_device, std::unique_ptr<architecture_implementation> architecture_impl) :
pci_device_(std::move(pci_device)),
Expand Down Expand Up @@ -298,6 +303,7 @@ dynamic_tlb TTDevice::set_dynamic_tlb(
.y_end = static_cast<uint64_t>(end.y),
.x_start = static_cast<uint64_t>(start.x),
.y_start = static_cast<uint64_t>(start.y),
.noc_sel = umd_use_noc1 ? 1U : 0,
.mcast = multicast,
.ordering = ordering,
// TODO #2715: hack for Blackhole A0, will potentially be fixed in B0.
Expand Down

0 comments on commit 3a6f43f

Please sign in to comment.