Skip to content

Commit

Permalink
#10671: API to get chip location (#10674)
Browse files Browse the repository at this point in the history
  • Loading branch information
jnie-TT authored and ttmchiou committed Jul 30, 2024
1 parent c8abf33 commit 15173cb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tt_metal/impl/device/device.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ class Device {
std::vector<CoreCoord> get_ethernet_sockets(chip_id_t connected_chip_id) const {
return tt::Cluster::instance().get_ethernet_sockets(this->id_, connected_chip_id);
}

bool is_mmio_capable() const {
return tt::Cluster::instance().get_associated_mmio_device(this->id_) == this->id_;
}
Expand Down
6 changes: 6 additions & 0 deletions tt_metal/llrt/tt_cluster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,12 @@ uint32_t Cluster::get_harvested_rows(chip_id_t chip) const {
}
}

eth_coord_t Cluster::get_chip_location(chip_id_t chip) const {
const std::unordered_map<chip_id_t, eth_coord_t> &chip_locations = this->cluster_desc_->get_chip_locations();
TT_FATAL(chip_locations.find(chip) != chip_locations.end(), "Cannot get chip location for chip {} that does not exist", chip);
return chip_locations.at(chip);
}

void Cluster::verify_eth_fw() const {
for (const auto &[chip, mmio_device_id] : this->device_to_mmio_device_) {
std::vector<uint32_t> fw_versions;
Expand Down
3 changes: 2 additions & 1 deletion tt_metal/llrt/tt_cluster.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ class Cluster {
uint32_t get_harvesting_mask(chip_id_t chip) const {
return this->get_driver(chip).get_harvesting_masks_for_soc_descriptors().at(chip);
}

eth_coord_t get_chip_location(chip_id_t chip) const;

//! device driver and misc apis
void verify_eth_fw() const;
void verify_sw_fw_versions(int device_id, std::uint32_t sw_version, std::vector<std::uint32_t> &fw_versions) const;
Expand Down

0 comments on commit 15173cb

Please sign in to comment.