Skip to content

Commit

Permalink
fix no_eth yaml and fix no asic location for old
Browse files Browse the repository at this point in the history
  • Loading branch information
broskoTT committed Feb 26, 2025
1 parent a2c8cc0 commit 6ae3f2c
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 12 deletions.
4 changes: 2 additions & 2 deletions device/api/umd/device/tt_cluster_descriptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ class tt_ClusterDescriptor {
tt::ARCH get_arch(chip_id_t chip_id) const;

void add_chip_uid(const chip_id_t chip_id, const ChipUID &chip_uid);
chip_id_t get_chip_id(const ChipUID &chip_uid) const;
const ChipUID &get_chip_uid(chip_id_t chip_id) const;
std::optional<chip_id_t> get_chip_id(const ChipUID &chip_uid) const;
std::optional<ChipUID> get_chip_uid(chip_id_t chip_id) const;

bool ethernet_core_has_active_ethernet_link(chip_id_t local_chip, ethernet_channel_t local_ethernet_channel) const;
std::tuple<chip_id_t, ethernet_channel_t> get_chip_and_channel_of_remote_ethernet_core(
Expand Down
13 changes: 7 additions & 6 deletions device/cluster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,8 @@ std::unique_ptr<Chip> Cluster::construct_chip_from_cluster(
HarvestingMasks harvesting_masks =
get_harvesting_masks(chip_id, cluster_desc, perform_harvesting, simulated_harvesting_masks);
const BoardType chip_board_type = cluster_desc->get_board_type(chip_id);
auto asic_location = cluster_desc->get_chip_uid(chip_id).asic_location;
std::optional<ChipUID> chip_uid = cluster_desc->get_chip_uid(chip_id);
uint8_t asic_location = chip_uid.has_value() ? chip_uid.value().asic_location : 0;
tt_SocDescriptor soc_desc = tt_SocDescriptor(
soc_desc_path,
cluster_desc->get_noc_translation_table_en().at(chip_id),
Expand Down Expand Up @@ -3508,8 +3509,9 @@ std::unique_ptr<tt_ClusterDescriptor> Cluster::create_cluster_descriptor(
const chip_info_t& local_info = boot_results.local_info;
const chip_info_t& remote_info = boot_results.remote_info;

chip_id_t local_chip_id = desc->get_chip_id(local_info.get_chip_uid());
if (desc->chip_uid_to_chip_id.find(remote_info.get_chip_uid()) == desc->chip_uid_to_chip_id.end()) {
chip_id_t local_chip_id = desc->get_chip_id(local_info.get_chip_uid()).value();
std::optional<chip_id_t> remote_chip_id = desc->get_chip_id(remote_info.get_chip_uid());
if (!remote_chip_id.has_value()) {
log_debug(
LogSiliconDriver,
"Eth core ({}, {}) on chip {} is connected to an chip with board_id {} not present in the "
Expand All @@ -3519,10 +3521,9 @@ std::unique_ptr<tt_ClusterDescriptor> Cluster::create_cluster_descriptor(
chip_id,
remote_info.get_chip_uid().board_id);
} else {
chip_id_t remote_chip_id = desc->get_chip_id(remote_info.get_chip_uid());

// Adding a connection only one way, the other chip should add it another way.
desc->ethernet_connections[local_chip_id][local_info.eth_id] = {remote_chip_id, remote_info.eth_id};
desc->ethernet_connections[local_chip_id][local_info.eth_id] = {
remote_chip_id.value(), remote_info.eth_id};
}

} else if (boot_results.eth_status.port_status == port_status_e::PORT_DOWN) {
Expand Down
14 changes: 12 additions & 2 deletions device/tt_cluster_descriptor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -907,9 +907,19 @@ void tt_ClusterDescriptor::add_chip_uid(const chip_id_t chip_id, const ChipUID &
chip_uid_to_chip_id[chip_uid] = chip_id;
}

chip_id_t tt_ClusterDescriptor::get_chip_id(const ChipUID &chip_uid) const { return chip_uid_to_chip_id.at(chip_uid); }
std::optional<chip_id_t> tt_ClusterDescriptor::get_chip_id(const ChipUID &chip_uid) const {
if (chip_uid_to_chip_id.find(chip_uid) == chip_uid_to_chip_id.end()) {
return std::nullopt;
}
return chip_uid_to_chip_id.at(chip_uid);
}

const ChipUID &tt_ClusterDescriptor::get_chip_uid(chip_id_t chip_id) const { return chip_id_to_chip_uid.at(chip_id); }
std::optional<ChipUID> tt_ClusterDescriptor::get_chip_uid(chip_id_t chip_id) const {
if (chip_id_to_chip_uid.find(chip_id) == chip_id_to_chip_uid.end()) {
return std::nullopt;
}
return chip_id_to_chip_uid.at(chip_id);
}

std::string tt_ClusterDescriptor::serialize() const {
YAML::Emitter out;
Expand Down
4 changes: 2 additions & 2 deletions tests/soc_descs/blackhole_140_arch_no_eth.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ arc:
[ 8-0 ]

pcie:
[ 11-0 ]
[ 2-0, 11-0 ]

dram:
[
Expand Down Expand Up @@ -43,7 +43,7 @@ harvested_workers:

router_only:
[
1-0, 2-0, 3-0, 4-0, 5-0, 6-0, 7-0, 10-0, 12-0, 13-0, 14-0, 15-0, 16-0,
1-0, 3-0, 4-0, 5-0, 6-0, 7-0, 10-0, 12-0, 13-0, 14-0, 15-0, 16-0,
1-1, 2-1, 3-1, 4-1, 5-1, 6-1, 7-1, 10-1, 11-1, 12-1, 13-1, 14-1, 15-1, 16-1,
8-1, 8-2, 8-3, 8-4, 8-5, 8-6, 8-7, 8-8, 8-9, 8-10, 8-11
]
Expand Down

0 comments on commit 6ae3f2c

Please sign in to comment.