Skip to content

Commit

Permalink
Move sdesc path to function arg
Browse files Browse the repository at this point in the history
  • Loading branch information
pjanevskiTT committed Nov 12, 2024
1 parent 00d94ed commit 8e368c8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
3 changes: 1 addition & 2 deletions device/tt_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,7 @@ class tt_SiliconDevice: public tt_device
// This functions has to be called for local chip, and then it will wait for all connected remote chips to flush.
void wait_for_connected_non_mmio_flush(chip_id_t chip_id);

void construct_tt_silicon_device(const uint32_t &num_host_mem_ch_per_mmio_device, const bool skip_driver_allocs,
void construct_tt_silicon_device(const std::string& sdesc_path, const uint32_t &num_host_mem_ch_per_mmio_device, const bool skip_driver_allocs,
const bool clean_system_resources, bool perform_harvesting, std::unordered_map<chip_id_t, uint32_t> simulated_harvesting_masks);

// State variables
Expand All @@ -797,7 +797,6 @@ class tt_SiliconDevice: public tt_device
std::unordered_map<chip_id_t, std::unique_ptr<PCIDevice>> m_pci_device_map; // Map of enabled pci devices
int m_num_pci_devices; // Number of pci devices in system (enabled or disabled)
std::shared_ptr<tt_ClusterDescriptor> ndesc;
std::string sdesc_path;

// remote eth transfer setup
static constexpr std::uint32_t NUM_ETH_CORES_FOR_NON_MMIO_TRANSFERS = 6;
Expand Down
9 changes: 4 additions & 5 deletions device/tt_silicon_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ std::unordered_map<chip_id_t, uint32_t> tt_SiliconDevice::get_harvesting_masks_f
return default_harvesting_masks;
}

void tt_SiliconDevice::construct_tt_silicon_device(const uint32_t &num_host_mem_ch_per_mmio_device, const bool skip_driver_allocs,
void tt_SiliconDevice::construct_tt_silicon_device(const std::string& sdesc_path, const uint32_t &num_host_mem_ch_per_mmio_device, const bool skip_driver_allocs,
const bool clean_system_resources, bool perform_harvesting, std::unordered_map<chip_id_t, uint32_t> simulated_harvesting_masks) {

std::unordered_set<chip_id_t> target_mmio_device_ids;
Expand Down Expand Up @@ -438,7 +438,7 @@ tt_SiliconDevice::tt_SiliconDevice(const uint32_t &num_host_mem_ch_per_mmio_devi
PCIDevice pci_device (physical_device_id, 0);
tt::ARCH device_arch = pci_device.get_arch();

sdesc_path = tt_SocDescriptor::get_soc_descriptor_path(device_arch);
std::string sdesc_path = tt_SocDescriptor::get_soc_descriptor_path(device_arch);

arch_name = tt_SocDescriptor(sdesc_path).arch;
perform_harvesting_on_sdesc = perform_harvesting;
Expand All @@ -457,7 +457,7 @@ tt_SiliconDevice::tt_SiliconDevice(const uint32_t &num_host_mem_ch_per_mmio_devi
}
target_devices_in_cluster = target_devices;

construct_tt_silicon_device(num_host_mem_ch_per_mmio_device, skip_driver_allocs, clean_system_resources, perform_harvesting, simulated_harvesting_masks);
construct_tt_silicon_device(sdesc_path, num_host_mem_ch_per_mmio_device, skip_driver_allocs, clean_system_resources, perform_harvesting, simulated_harvesting_masks);
}

tt_SiliconDevice::tt_SiliconDevice(const std::string &sdesc_path, const std::string &ndesc_path, const std::set<chip_id_t> &target_devices,
Expand All @@ -470,7 +470,6 @@ tt_SiliconDevice::tt_SiliconDevice(const std::string &sdesc_path, const std::str
target_devices_in_cluster = target_devices;
arch_name = tt_SocDescriptor(sdesc_path).arch;
perform_harvesting_on_sdesc = perform_harvesting;
this->sdesc_path = sdesc_path;

if (!skip_driver_allocs) {
log_info(LogSiliconDriver, "Detected {} PCI device{} : {}", m_num_pci_devices, (m_num_pci_devices > 1) ? "s":"", available_device_ids);
Expand All @@ -484,7 +483,7 @@ tt_SiliconDevice::tt_SiliconDevice(const std::string &sdesc_path, const std::str

ndesc = tt_ClusterDescriptor::create_from_yaml(cluster_descriptor_path);

construct_tt_silicon_device(num_host_mem_ch_per_mmio_device, skip_driver_allocs, clean_system_resources, perform_harvesting, simulated_harvesting_masks);
construct_tt_silicon_device(sdesc_path, num_host_mem_ch_per_mmio_device, skip_driver_allocs, clean_system_resources, perform_harvesting, simulated_harvesting_masks);
}

void tt_SiliconDevice::configure_active_ethernet_cores_for_mmio_device(chip_id_t mmio_chip, const std::unordered_set<tt_xy_pair>& active_eth_cores_per_chip) {
Expand Down

0 comments on commit 8e368c8

Please sign in to comment.