diff --git a/device/api/umd/device/architecture_implementation.h b/device/api/umd/device/architecture_implementation.h index e5cfb5f8..3544e921 100644 --- a/device/api/umd/device/architecture_implementation.h +++ b/device/api/umd/device/architecture_implementation.h @@ -26,7 +26,7 @@ class architecture_implementation { public: virtual ~architecture_implementation() = default; - virtual tt::Arch get_architecture() const = 0; + virtual tt::ARCH get_architecture() const = 0; virtual uint32_t get_arc_message_arc_get_harvesting() const = 0; virtual uint32_t get_arc_message_arc_go_busy() const = 0; virtual uint32_t get_arc_message_arc_go_long_idle() const = 0; @@ -73,7 +73,7 @@ class architecture_implementation { virtual tt_driver_eth_interface_params get_eth_interface_params() const = 0; virtual tt_driver_noc_params get_noc_params() const = 0; - static std::unique_ptr create(tt::Arch architecture); + static std::unique_ptr create(tt::ARCH architecture); }; } // namespace tt::umd diff --git a/device/api/umd/device/blackhole_implementation.h b/device/api/umd/device/blackhole_implementation.h index f27b70f1..1e0884b8 100644 --- a/device/api/umd/device/blackhole_implementation.h +++ b/device/api/umd/device/blackhole_implementation.h @@ -187,7 +187,7 @@ static const size_t dram_translated_coordinate_start_y = 12; class blackhole_implementation : public architecture_implementation { public: - tt::Arch get_architecture() const override { return tt::Arch::BLACKHOLE; } + tt::ARCH get_architecture() const override { return tt::ARCH::BLACKHOLE; } uint32_t get_arc_message_arc_get_harvesting() const override { return static_cast(blackhole::arc_message_type::ARC_GET_HARVESTING); diff --git a/device/api/umd/device/cluster.h b/device/api/umd/device/cluster.h index 297313db..9c4b0ba8 100644 --- a/device/api/umd/device/cluster.h +++ b/device/api/umd/device/cluster.h @@ -622,12 +622,12 @@ class Cluster : public tt_device { virtual void* host_dma_address(std::uint64_t offset, chip_id_t src_device_id, uint16_t channel) const; virtual std::uint64_t get_pcie_base_addr_from_device(const chip_id_t chip_id) const; static std::vector extract_rows_to_remove( - const tt::Arch& arch, const int worker_grid_rows, const int harvested_rows); + const tt::ARCH& arch, const int worker_grid_rows, const int harvested_rows); static void remove_worker_row_from_descriptor( tt_SocDescriptor& full_soc_descriptor, const std::vector& row_coordinates_to_remove); - static void harvest_rows_in_soc_descriptor(tt::Arch arch, tt_SocDescriptor& sdesc, uint32_t harvested_rows); + static void harvest_rows_in_soc_descriptor(tt::ARCH arch, tt_SocDescriptor& sdesc, uint32_t harvested_rows); static std::unordered_map create_harvested_coord_translation( - const tt::Arch arch, bool identity_map); + const tt::ARCH arch, bool identity_map); std::unordered_map get_harvested_coord_translation_map(chip_id_t logical_device_id); virtual std::uint32_t get_num_dram_channels(std::uint32_t device_id); virtual std::uint64_t get_dram_channel_size(std::uint32_t device_id, std::uint32_t channel); @@ -786,10 +786,10 @@ class Cluster : public tt_device { tt_driver_host_address_params host_address_params; tt_driver_noc_params noc_params; tt_driver_eth_interface_params eth_interface_params; - std::vector archs_in_cluster = {}; + std::vector archs_in_cluster = {}; std::set target_devices_in_cluster = {}; std::set target_remote_chips = {}; - tt::Arch arch_name; + tt::ARCH arch_name; std::unordered_map> 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 cluster_desc; diff --git a/device/api/umd/device/coordinate_manager.h b/device/api/umd/device/coordinate_manager.h index e111b8c3..81916939 100644 --- a/device/api/umd/device/coordinate_manager.h +++ b/device/api/umd/device/coordinate_manager.h @@ -31,7 +31,7 @@ class CoordinateManager { const std::vector& pcie_cores); static std::shared_ptr create_coordinate_manager( - tt::Arch arch, + tt::ARCH arch, const tt_xy_pair& tensix_grid_size, const std::vector& tensix_cores, const size_t tensix_harvesting_mask, @@ -46,7 +46,7 @@ class CoordinateManager { const std::vector& pcie_cores); static std::shared_ptr create_coordinate_manager( - tt::Arch arch, const size_t tensix_harvesting_mask = 0, const size_t dram_harvesting_mask = 0); + tt::ARCH arch, const size_t tensix_harvesting_mask = 0, const size_t dram_harvesting_mask = 0); static size_t get_num_harvested(const size_t harvesting_mask); @@ -65,7 +65,7 @@ class CoordinateManager { tt::umd::CoreCoord to_translated(const tt::umd::CoreCoord core_coord); static void assert_create_coordinate_manager( - const tt::Arch arch, const size_t tensix_harvesting_mask, const size_t dram_harvesting_mask); + const tt::ARCH arch, const size_t tensix_harvesting_mask, const size_t dram_harvesting_mask); protected: virtual void translate_tensix_coords(); diff --git a/device/api/umd/device/grayskull_implementation.h b/device/api/umd/device/grayskull_implementation.h index f17fc305..f1cb4ba2 100644 --- a/device/api/umd/device/grayskull_implementation.h +++ b/device/api/umd/device/grayskull_implementation.h @@ -201,7 +201,7 @@ static constexpr uint32_t TENSIX_SOFT_RESET_ADDR = 0xFFB121B0; class grayskull_implementation : public architecture_implementation { public: - tt::Arch get_architecture() const override { return tt::Arch::GRAYSKULL; } + tt::ARCH get_architecture() const override { return tt::ARCH::GRAYSKULL; } uint32_t get_arc_message_arc_get_harvesting() const override { return static_cast(grayskull::arc_message_type::ARC_GET_HARVESTING); diff --git a/device/api/umd/device/pci_device.hpp b/device/api/umd/device/pci_device.hpp index 5eb88d3b..7877ab84 100644 --- a/device/api/umd/device/pci_device.hpp +++ b/device/api/umd/device/pci_device.hpp @@ -55,7 +55,7 @@ struct PciDeviceInfo { uint16_t pci_device; uint16_t pci_function; - tt::Arch get_arch() const; + tt::ARCH get_arch() const; // TODO: does it make sense to move attributes that we can read from sysfs // onto this struct as methods? e.g. current_link_width etc. }; @@ -70,7 +70,7 @@ class PCIDevice { const PciDeviceInfo info; // PCI device info const int numa_node; // -1 if non-NUMA const int revision; // PCI revision value from sysfs - const tt::Arch arch; // e.g. Grayskull, Wormhole, Blackhole + const tt::ARCH arch; // e.g. Grayskull, Wormhole, Blackhole const semver_t kmd_version; // KMD version const bool iommu_enabled; // Whether the system is protected from this device by an IOMMU std::unique_ptr architecture_implementation; @@ -142,7 +142,7 @@ class PCIDevice { /** * @return what architecture this device is (e.g. Wormhole, Blackhole, etc.) */ - tt::Arch get_arch() const { return arch; } + tt::ARCH get_arch() const { return arch; } /** * @return whether the system is protected from this device by an IOMMU diff --git a/device/api/umd/device/tt_cluster_descriptor.h b/device/api/umd/device/tt_cluster_descriptor.h index 616704d1..b7de3fdd 100644 --- a/device/api/umd/device/tt_cluster_descriptor.h +++ b/device/api/umd/device/tt_cluster_descriptor.h @@ -53,7 +53,7 @@ class tt_ClusterDescriptor { std::unordered_map closest_mmio_chip_cache = {}; std::unordered_map chip_board_type = {}; std::unordered_map> chips_grouped_by_closest_mmio; - std::unordered_map chip_arch = {}; + std::unordered_map chip_arch = {}; // one-to-many chip connections struct Chip2ChipConnection { @@ -97,11 +97,11 @@ class tt_ClusterDescriptor { static std::string get_cluster_descriptor_file_path(); static std::unique_ptr create_from_yaml(const std::string &cluster_descriptor_file_path); static std::unique_ptr create(); - static tt::Arch detect_arch(const chip_id_t chip_id); + static tt::ARCH detect_arch(const chip_id_t chip_id); // This function is used to create mock cluster descriptor yaml files, for example for simulation. static std::unique_ptr create_mock_cluster( - const std::vector &logical_device_ids, tt::Arch arch); + const std::vector &logical_device_ids, tt::ARCH arch); const std::unordered_map &get_harvesting_info() const; const std::unordered_map &get_noc_translation_table_en() const; @@ -117,7 +117,7 @@ class tt_ClusterDescriptor { int get_ethernet_link_distance(chip_id_t chip_a, chip_id_t chip_b) const; BoardType get_board_type(chip_id_t chip_id) const; - tt::Arch get_arch(chip_id_t chip_id) const; + tt::ARCH get_arch(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 get_chip_and_channel_of_remote_ethernet_core( diff --git a/device/api/umd/device/tt_simulation_device.h b/device/api/umd/device/tt_simulation_device.h index 931d7ae9..3f1bd1f4 100644 --- a/device/api/umd/device/tt_simulation_device.h +++ b/device/api/umd/device/tt_simulation_device.h @@ -70,9 +70,9 @@ class tt_SimulationDevice : public tt_device { tt_driver_host_address_params host_address_params; tt_driver_noc_params noc_params; tt_driver_eth_interface_params eth_interface_params; - std::vector archs_in_cluster = {}; + std::vector archs_in_cluster = {}; std::set target_devices_in_cluster = {}; std::set target_remote_chips = {}; - tt::Arch arch_name; + tt::ARCH arch_name; std::shared_ptr cluster_descriptor; }; diff --git a/device/api/umd/device/tt_soc_descriptor.h b/device/api/umd/device/tt_soc_descriptor.h index dde870e2..ad338ea4 100644 --- a/device/api/umd/device/tt_soc_descriptor.h +++ b/device/api/umd/device/tt_soc_descriptor.h @@ -46,7 +46,7 @@ struct CoreDescriptor { */ class tt_SocDescriptor { public: - tt::Arch arch; + tt::ARCH arch; tt_xy_pair grid_size; tt_xy_pair physical_grid_size; tt_xy_pair worker_grid_size; @@ -124,7 +124,7 @@ class tt_SocDescriptor { // CoreCoord conversions. tt::umd::CoreCoord to(const tt::umd::CoreCoord core_coord, const CoordSystem coord_system); - static std::string get_soc_descriptor_path(tt::Arch arch); + static std::string get_soc_descriptor_path(tt::ARCH arch); private: void create_coordinate_manager(const std::size_t tensix_harvesting_mask, const std::size_t dram_harvesting_mask); diff --git a/device/api/umd/device/types/arch.h b/device/api/umd/device/types/arch.h index 5fb79a62..489101ef 100644 --- a/device/api/umd/device/types/arch.h +++ b/device/api/umd/device/types/arch.h @@ -22,36 +22,36 @@ static inline std::string to_lower(const std::string &str) { /** * Enums for different architectures. */ -enum class Arch { +enum class ARCH { GRAYSKULL = 1, WORMHOLE_B0 = 2, BLACKHOLE = 3, Invalid = 0xFF, }; -static inline tt::Arch arch_from_str(const std::string &arch_str) { +static inline tt::ARCH arch_from_str(const std::string &arch_str) { std::string arch_str_lower = to_lower(arch_str); if (arch_str_lower == "grayskull") { - return tt::Arch::GRAYSKULL; + return tt::ARCH::GRAYSKULL; } else if ((arch_str_lower == "wormhole") || (arch_str_lower == "wormhole_b0")) { - return tt::Arch::WORMHOLE_B0; + return tt::ARCH::WORMHOLE_B0; } else if (arch_str_lower == "blackhole") { - return tt::Arch::BLACKHOLE; + return tt::ARCH::BLACKHOLE; } else { - return tt::Arch::Invalid; + return tt::ARCH::Invalid; } } -static inline std::string arch_to_str(const tt::Arch arch) { +static inline std::string arch_to_str(const tt::ARCH arch) { switch (arch) { - case tt::Arch::GRAYSKULL: + case tt::ARCH::GRAYSKULL: return "grayskull"; - case tt::Arch::WORMHOLE_B0: + case tt::ARCH::WORMHOLE_B0: return "wormhole_b0"; - case tt::Arch::BLACKHOLE: + case tt::ARCH::BLACKHOLE: return "blackhole"; - case tt::Arch::Invalid: + case tt::ARCH::Invalid: default: return "Invalid"; } @@ -59,4 +59,4 @@ static inline std::string arch_to_str(const tt::Arch arch) { } // namespace tt -static inline std::ostream &operator<<(std::ostream &out, const tt::Arch &arch) { return out << arch_to_str(arch); } +static inline std::ostream &operator<<(std::ostream &out, const tt::ARCH &arch) { return out << arch_to_str(arch); } diff --git a/device/api/umd/device/wormhole_implementation.h b/device/api/umd/device/wormhole_implementation.h index 2ef479c6..ebe2a929 100644 --- a/device/api/umd/device/wormhole_implementation.h +++ b/device/api/umd/device/wormhole_implementation.h @@ -240,7 +240,7 @@ static const size_t eth_translated_coordinate_start_y = 16; class wormhole_implementation : public architecture_implementation { public: - tt::Arch get_architecture() const override { return tt::Arch::WORMHOLE_B0; } + tt::ARCH get_architecture() const override { return tt::ARCH::WORMHOLE_B0; } uint32_t get_arc_message_arc_get_harvesting() const override { return static_cast(wormhole::arc_message_type::ARC_GET_HARVESTING); diff --git a/device/architecture_implementation.cpp b/device/architecture_implementation.cpp index 137f419d..dc0c0b00 100644 --- a/device/architecture_implementation.cpp +++ b/device/architecture_implementation.cpp @@ -10,13 +10,13 @@ namespace tt::umd { -std::unique_ptr architecture_implementation::create(tt::Arch architecture) { +std::unique_ptr architecture_implementation::create(tt::ARCH architecture) { switch (architecture) { - case tt::Arch::BLACKHOLE: + case tt::ARCH::BLACKHOLE: return std::make_unique(); - case tt::Arch::GRAYSKULL: + case tt::ARCH::GRAYSKULL: return std::make_unique(); - case tt::Arch::WORMHOLE_B0: + case tt::ARCH::WORMHOLE_B0: return std::make_unique(); default: return nullptr; diff --git a/device/cluster.cpp b/device/cluster.cpp index 5f2cdf57..7efba351 100644 --- a/device/cluster.cpp +++ b/device/cluster.cpp @@ -182,7 +182,7 @@ void Cluster::initialize_interprocess_mutexes(int pci_interface_id, bool cleanup hardware_resource_mutex_map[mutex_name] = std::make_shared(open_or_create, mutex_name.c_str(), unrestricted_permissions); - if (arch_name == tt::Arch::WORMHOLE_B0) { + if (arch_name == tt::ARCH::WORMHOLE_B0) { mutex_name = NON_MMIO_MUTEX_NAME + std::to_string(pci_interface_id); // Initialize non-MMIO mutexes for WH devices regardless of number of chips, since these may be used for // ethernet broadcast @@ -244,7 +244,7 @@ void Cluster::create_device( // TODO: get rid of this, it doesn't make any sense. int num_host_mem_channels = get_available_num_host_mem_channels(num_host_mem_ch_per_mmio_device, pcie_device_id, pcie_revision); - if (dev->get_arch() == tt::Arch::BLACKHOLE && num_host_mem_channels > 1) { + if (dev->get_arch() == tt::ARCH::BLACKHOLE && num_host_mem_channels > 1) { // TODO: Implement support for multiple host channels on BLACKHOLE. log_warning( LogSiliconDriver, @@ -269,7 +269,7 @@ void Cluster::create_device( if (!skip_driver_allocs) { // TODO: Implement support for multiple host channels on BLACKHOLE. log_assert( - !(arch_name == tt::Arch::BLACKHOLE && num_host_mem_channels > 1), + !(arch_name == tt::ARCH::BLACKHOLE && num_host_mem_channels > 1), "More channels are not yet supported for Blackhole"); // Same number of host channels per device for now bool hugepages_initialized = m_pci_device_map.at(logical_device_id)->init_hugepage(num_host_mem_channels); @@ -350,13 +350,13 @@ void Cluster::construct_cluster( create_device(target_mmio_device_ids, num_host_mem_ch_per_mmio_device, skip_driver_allocs, clean_system_resources); // MT: Initial BH - Disable dependency to ethernet firmware - if (arch_name == tt::Arch::BLACKHOLE) { + if (arch_name == tt::ARCH::BLACKHOLE) { use_ethernet_ordered_writes = false; use_ethernet_broadcast = false; use_virtual_coords_for_eth_broadcast = false; } - if (arch_name == tt::Arch::WORMHOLE_B0) { + if (arch_name == tt::ARCH::WORMHOLE_B0) { const auto& harvesting_masks = cluster_desc->get_harvesting_info(); const auto& noc_translation_enabled = cluster_desc->get_noc_translation_table_en(); @@ -395,7 +395,7 @@ void Cluster::construct_cluster( log_assert( performed_harvesting ? translation_tables_en : true, "Using a harvested WH cluster with NOC translation disabled."); - } else if (arch_name == tt::Arch::BLACKHOLE) { + } else if (arch_name == tt::ARCH::BLACKHOLE) { // Default harvesting info for Blackhole, describing no harvesting for (auto chip_id = target_devices_in_cluster.begin(); chip_id != target_devices_in_cluster.end(); chip_id++) { harvested_rows_per_target[*chip_id] = 0; // get_harvested_noc_rows_for_chip(*chip_id); @@ -405,7 +405,7 @@ void Cluster::construct_cluster( performed_harvesting = true; } } - } else if (arch_name == tt::Arch::GRAYSKULL) { + } else if (arch_name == tt::ARCH::GRAYSKULL) { // Multichip harvesting is supported for GS. for (auto chip_id = target_devices_in_cluster.begin(); chip_id != target_devices_in_cluster.end(); chip_id++) { harvested_rows_per_target[*chip_id] = get_harvested_noc_rows_for_chip(*chip_id); @@ -425,7 +425,7 @@ void Cluster::construct_cluster( simulated_harvesting_masks.find(*device_id) != simulated_harvesting_masks.end(), "Could not find harvesting mask for device_id {}", *device_id); - if (arch_name == tt::Arch::GRAYSKULL) { + if (arch_name == tt::ARCH::GRAYSKULL) { if ((simulated_harvesting_masks.at(*device_id) & harvested_rows_per_target[*device_id]) != harvested_rows_per_target[*device_id]) { log_warning( @@ -438,7 +438,7 @@ void Cluster::construct_cluster( simulated_harvesting_masks.at(*device_id)); } simulated_harvesting_masks.at(*device_id) |= harvested_rows_per_target[*device_id]; - } else if (arch_name == tt::Arch::WORMHOLE_B0) { + } else if (arch_name == tt::ARCH::WORMHOLE_B0) { log_assert( std::bitset<32>(simulated_harvesting_masks.at(*device_id)).count() >= std::bitset<32>(harvested_rows_per_target[*device_id]).count(), @@ -459,7 +459,7 @@ void Cluster::construct_cluster( populate_cores(); // MT: Initial BH - skip this for BH - if (arch_name == tt::Arch::WORMHOLE_B0) { + if (arch_name == tt::ARCH::WORMHOLE_B0) { remote_transfer_ethernet_cores.resize(target_mmio_device_ids.size()); for (const auto& logical_mmio_chip_id : target_mmio_device_ids) { const tt_SocDescriptor& soc_desc = get_soc_descriptor(logical_mmio_chip_id); @@ -500,7 +500,7 @@ Cluster::Cluster( int physical_device_id = available_device_ids[0]; PCIDevice pci_device(physical_device_id); - tt::Arch device_arch = pci_device.get_arch(); + tt::ARCH device_arch = pci_device.get_arch(); std::string sdesc_path = tt_SocDescriptor::get_soc_descriptor_path(device_arch); @@ -548,7 +548,7 @@ Cluster::Cluster( int physical_device_id = available_device_ids[0]; PCIDevice pci_device(physical_device_id); - tt::Arch device_arch = pci_device.get_arch(); + tt::ARCH device_arch = pci_device.get_arch(); std::string sdesc_path = tt_SocDescriptor::get_soc_descriptor_path(device_arch); @@ -621,7 +621,7 @@ void Cluster::configure_active_ethernet_cores_for_mmio_device( // This overrides the default ethernet cores tagged for host to cluster routing in the constructor and must be // called for all MMIO devices, if default behaviour is not desired. log_assert( - get_soc_descriptor(mmio_chip).arch == tt::Arch::WORMHOLE_B0, + get_soc_descriptor(mmio_chip).arch == tt::ARCH::WORMHOLE_B0, "{} can only be called for Wormhole arch", __FUNCTION__); auto& eth_cores = get_soc_descriptor(mmio_chip).ethernet_cores; @@ -659,7 +659,7 @@ void Cluster::populate_cores() { } std::vector Cluster::extract_rows_to_remove( - const tt::Arch& arch, const int worker_grid_rows, const int harvested_rows) { + const tt::ARCH& arch, const int worker_grid_rows, const int harvested_rows) { // Check if harvesting config is legal for GS and WH log_assert( !((harvested_rows & 1) || (harvested_rows & 64) || (harvested_rows & 0xFFFFF000)), @@ -675,7 +675,7 @@ std::vector Cluster::extract_rows_to_remove( tmp = tmp >> 1; row_coordinate++; } - if (arch == tt::Arch::WORMHOLE_B0) { + if (arch == tt::ARCH::WORMHOLE_B0) { // For Wormhole, we always remove the last few rows in the SOC descriptor in case of harvesting for (int i = 0; i < row_coordinates_to_remove.size(); i++) { row_coordinates_to_remove[i] = worker_grid_rows - i; @@ -714,7 +714,7 @@ void Cluster::remove_worker_row_from_descriptor( } } -void Cluster::harvest_rows_in_soc_descriptor(tt::Arch arch, tt_SocDescriptor& sdesc, uint32_t harvested_rows) { +void Cluster::harvest_rows_in_soc_descriptor(tt::ARCH arch, tt_SocDescriptor& sdesc, uint32_t harvested_rows) { std::uint32_t max_row_to_remove = (*std::max_element((sdesc.workers).begin(), (sdesc.workers).end(), [](const auto& a, const auto& b) { return a.y < b.y; @@ -737,19 +737,19 @@ void Cluster::perform_harvesting_and_populate_soc_descriptors( void Cluster::check_pcie_device_initialized(int device_id) { PCIDevice* pci_device = get_pci_device(device_id); - tt::Arch device_arch = pci_device->get_arch(); - if (arch_name == tt::Arch::GRAYSKULL) { - if (device_arch != tt::Arch::GRAYSKULL) { + tt::ARCH device_arch = pci_device->get_arch(); + if (arch_name == tt::ARCH::GRAYSKULL) { + if (device_arch != tt::ARCH::GRAYSKULL) { throw std::runtime_error( fmt::format("Attempted to run grayskull configured tt_device on {}", arch_to_str(device_arch))); } - } else if (arch_name == tt::Arch::WORMHOLE_B0) { - if (device_arch != tt::Arch::WORMHOLE_B0) { + } else if (arch_name == tt::ARCH::WORMHOLE_B0) { + if (device_arch != tt::ARCH::WORMHOLE_B0) { throw std::runtime_error( fmt::format("Attempted to run wormhole configured tt_device on {}", arch_to_str(device_arch))); } - } else if (arch_name == tt::Arch::BLACKHOLE) { - if (device_arch != tt::Arch::BLACKHOLE) { + } else if (arch_name == tt::ARCH::BLACKHOLE) { + if (device_arch != tt::ARCH::BLACKHOLE) { throw std::runtime_error( fmt::format("Attempted to run blackhole configured tt_device on {}", arch_to_str(device_arch))); } @@ -759,7 +759,7 @@ void Cluster::check_pcie_device_initialized(int device_id) { auto architecture_implementation = pci_device->get_architecture_implementation(); // MT Initial BH - Add check for blackhole once access to ARC registers is setup through TLBs - if (arch_name != tt::Arch::BLACKHOLE) { + if (arch_name != tt::ARCH::BLACKHOLE) { log_debug(LogSiliconDriver, "== Check if device_id: {} is initialized", device_id); uint32_t bar_read_initial = bar_read32(device_id, architecture_implementation->get_arc_reset_scratch_offset() + 3 * 4); @@ -788,9 +788,9 @@ void Cluster::check_pcie_device_initialized(int device_id) { } std::unordered_map Cluster::create_harvested_coord_translation( - const tt::Arch arch, bool identity_map) { + const tt::ARCH arch, bool identity_map) { log_assert( - identity_map ? true : (arch != tt::Arch::GRAYSKULL), "NOC Translation can only be performed for WH devices"); + identity_map ? true : (arch != tt::ARCH::GRAYSKULL), "NOC Translation can only be performed for WH devices"); std::unordered_map translation_table = {}; tt_xy_pair grid_size; @@ -798,11 +798,11 @@ std::unordered_map Cluster::create_harvested_coord_trans std::vector T6_y = {}; std::vector ethernet = {}; // Store device specific data for GS and WH depending on arch - if (arch == tt::Arch::GRAYSKULL) { + if (arch == tt::ARCH::GRAYSKULL) { grid_size = tt_xy_pair(13, 12); T6_x = {12, 1, 11, 2, 10, 3, 9, 4, 8, 5, 7, 6}; T6_y = {11, 1, 10, 2, 9, 3, 8, 4, 7, 5}; - } else if (arch == tt::Arch::BLACKHOLE) { + } else if (arch == tt::ARCH::BLACKHOLE) { grid_size = tt_xy_pair(17, 12); T6_x = {16, 1, 15, 2, 14, 3, 13, 4, 12, 5, 11, 6, 10, 7}; T6_y = {11, 2, 10, 3, 9, 4, 8, 5, 7, 6}; @@ -965,7 +965,7 @@ void Cluster::deassert_risc_reset_at_core(tt_cxy_pair core, const TensixSoftRese "Could not find MMIO mapped device in devices connected over PCIe"); send_tensix_risc_reset_to_core(core, soft_resets); } else { - log_assert(arch_name != tt::Arch::BLACKHOLE, "Can't issue access to remote core in BH"); + log_assert(arch_name != tt::ARCH::BLACKHOLE, "Can't issue access to remote core in BH"); send_remote_tensix_risc_reset_to_core(core, soft_resets); } } @@ -1275,7 +1275,7 @@ void Cluster::set_pcie_power_state(tt_DevicePowerState state) { int Cluster::get_clock(int logical_device_id) { // TODO: remove this once ARC messages work. // This is currently used only for testing and bringing up Blackhole on Buda. - if (arch_name == tt::Arch::BLACKHOLE) { + if (arch_name == tt::ARCH::BLACKHOLE) { char* clk_env_var = getenv("TT_SILICON_DRIVER_AICLK"); if (clk_env_var != nullptr) { log_warning( @@ -1411,7 +1411,7 @@ int Cluster::test_setup_interface() { int ret_val = 0; int logical_device_id = m_pci_device_map.begin()->first; PCIDevice* dev = m_pci_device_map.at(logical_device_id).get(); - if (arch_name == tt::Arch::GRAYSKULL) { + if (arch_name == tt::ARCH::GRAYSKULL) { uint32_t mapped_reg = dev->set_dynamic_tlb( dev->get_architecture_implementation()->get_reg_tlb(), tt_xy_pair(0, 0), @@ -1423,7 +1423,7 @@ int Cluster::test_setup_interface() { dev->read_regs(mapped_reg, 1, ®val); ret_val = (regval != 0xffffffff && ((regval & 0x1) == 1)) ? 0 : 1; return ret_val; - } else if (arch_name == tt::Arch::WORMHOLE_B0) { + } else if (arch_name == tt::ARCH::WORMHOLE_B0) { uint32_t mapped_reg = dev->set_dynamic_tlb( dev->get_architecture_implementation()->get_reg_tlb(), tt_xy_pair(1, 0), @@ -1435,7 +1435,7 @@ int Cluster::test_setup_interface() { dev->read_regs(mapped_reg, 1, ®val); ret_val = (regval != 0xffffffff && (regval == 33)) ? 0 : 1; return ret_val; - } else if (arch_name == tt::Arch::BLACKHOLE) { + } else if (arch_name == tt::ARCH::BLACKHOLE) { // MT Inital BH - Try to enable this, but double check "regval == 33" // int ret_val = 0; // PCIDevice *dev = m_pci_device_map.begin()->second->hdev; @@ -1568,7 +1568,7 @@ int Cluster::iatu_configure_peer_region( // BR: ARC doesn't work yet on Blackhole, so programming ATU directly. Should be removed when arc starts working. // TODO: Remove when ARC is implemented on BH. - if (arch_name == tt::Arch::BLACKHOLE) { + if (arch_name == tt::ARCH::BLACKHOLE) { uint64_t base_addr = region_id_to_use * region_size; uint64_t base_size = (region_id_to_use + 1) * region_size; uint64_t limit_address = base_addr + base_size - 1; @@ -2312,7 +2312,7 @@ void Cluster::read_from_non_mmio_device(void* mem_ptr, tt_cxy_pair core, uint64_ void Cluster::wait_for_connected_non_mmio_flush(const chip_id_t chip_id) { if (flush_non_mmio_per_chip[chip_id]) { - log_assert(arch_name != tt::Arch::BLACKHOLE, "Non-MMIO flush not supported in Blackhole"); + log_assert(arch_name != tt::ARCH::BLACKHOLE, "Non-MMIO flush not supported in Blackhole"); std::string read_tlb = "LARGE_READ_TLB"; auto chips_with_mmio = this->get_target_mmio_device_ids(); @@ -2322,7 +2322,7 @@ void Cluster::wait_for_connected_non_mmio_flush(const chip_id_t chip_id) { return; } - if (arch_name == tt::Arch::WORMHOLE_B0) { + if (arch_name == tt::ARCH::WORMHOLE_B0) { std::vector erisc_txn_counters = std::vector(2); std::vector erisc_q_ptrs = std::vector(eth_interface_params.remote_update_ptr_size_bytes * 2 / sizeof(uint32_t)); @@ -2351,7 +2351,7 @@ void Cluster::wait_for_connected_non_mmio_flush(const chip_id_t chip_id) { } void Cluster::wait_for_non_mmio_flush(const chip_id_t chip_id) { - log_assert(arch_name != tt::Arch::BLACKHOLE, "Non-MMIO flush not supported in Blackhole"); + log_assert(arch_name != tt::ARCH::BLACKHOLE, "Non-MMIO flush not supported in Blackhole"); std::string read_tlb = "LARGE_READ_TLB"; if (!this->cluster_desc->is_chip_remote(chip_id)) { @@ -2633,7 +2633,7 @@ void Cluster::broadcast_write_to_cluster( std::set& rows_to_exclude, std::set& cols_to_exclude, const std::string& fallback_tlb) { - if (arch_name == tt::Arch::GRAYSKULL) { + if (arch_name == tt::ARCH::GRAYSKULL) { // Device FW disables broadcasts to all non tensix cores. std::vector dram_cores_to_write = {}; std::vector dram_rows = {0, 6}; @@ -2661,7 +2661,7 @@ void Cluster::broadcast_write_to_cluster( pcie_broadcast_write(chip, mem_ptr, size_in_bytes, address, grid.first, grid.second, fallback_tlb); } } - } else if (arch_name == tt::Arch::BLACKHOLE) { + } else if (arch_name == tt::ARCH::BLACKHOLE) { auto architecture_implementation = tt::umd::architecture_implementation::create(arch_name); if (cols_to_exclude.find(0) == cols_to_exclude.end() or cols_to_exclude.find(9) == cols_to_exclude.end()) { log_assert( @@ -3001,7 +3001,7 @@ void Cluster::write_to_device( write_device_memory(mem_ptr, size, core, addr, fallback_tlb); } } else { - log_assert(arch_name != tt::Arch::BLACKHOLE, "Non-MMIO targets not supported in Blackhole"); + log_assert(arch_name != tt::ARCH::BLACKHOLE, "Non-MMIO targets not supported in Blackhole"); log_assert( (get_soc_descriptor(core.chip).ethernet_cores).size() > 0 && get_number_of_chips_in_cluster() > 1, "Cannot issue ethernet writes to a single chip cluster!"); @@ -3059,7 +3059,7 @@ void Cluster::read_from_device( } } else { log_assert( - arch_name != tt::Arch::BLACKHOLE, + arch_name != tt::ARCH::BLACKHOLE, "Non-MMIO targets not supported in Blackhole"); // MT: Use only dynamic TLBs and never program static log_assert( (get_soc_descriptor(core.chip).ethernet_cores).size() > 0 && get_number_of_chips_in_cluster() > 1, @@ -3077,7 +3077,7 @@ int Cluster::arc_msg( int timeout, uint32_t* return_3, uint32_t* return_4) { - log_assert(arch_name != tt::Arch::BLACKHOLE, "ARC messages not supported in Blackhole"); + log_assert(arch_name != tt::ARCH::BLACKHOLE, "ARC messages not supported in Blackhole"); if (cluster_desc->is_chip_mmio_capable(logical_device_id)) { return pcie_arc_msg(logical_device_id, msg_code, wait_for_done, arg0, arg1, timeout, return_3, return_4); } else { @@ -3123,7 +3123,7 @@ void Cluster::enable_remote_ethernet_queue(const chip_id_t& chip, int timeout) { } void Cluster::broadcast_tensix_risc_reset_to_cluster(const TensixSoftResetOptions& soft_resets) { - if (arch_name == tt::Arch::GRAYSKULL) { + if (arch_name == tt::ARCH::GRAYSKULL) { for (auto& device_it : m_pci_device_map) { broadcast_pcie_tensix_risc_reset(device_it.first, soft_resets); } @@ -3133,7 +3133,7 @@ void Cluster::broadcast_tensix_risc_reset_to_cluster(const TensixSoftResetOption std::set chips_to_exclude = {}; std::set rows_to_exclude; std::set columns_to_exclude; - if (arch_name == tt::Arch::BLACKHOLE) { + if (arch_name == tt::ARCH::BLACKHOLE) { rows_to_exclude = {0, 1}; columns_to_exclude = {0, 8, 9}; } else { @@ -3156,7 +3156,7 @@ void Cluster::broadcast_tensix_risc_reset_to_cluster(const TensixSoftResetOption void Cluster::set_power_state(tt_DevicePowerState device_state) { // MT Initial BH - ARC messages not supported in Blackhole - if (arch_name != tt::Arch::BLACKHOLE) { + if (arch_name != tt::ARCH::BLACKHOLE) { for (auto& chip : target_devices_in_cluster) { if (cluster_desc->is_chip_mmio_capable(chip)) { set_pcie_power_state(device_state); @@ -3174,7 +3174,7 @@ void Cluster::enable_ethernet_queue(int timeout) { auto arch = get_soc_descriptor(chip).arch; switch (arch) { - case tt::Arch::WORMHOLE_B0: { + case tt::ARCH::WORMHOLE_B0: { if (cluster_desc->is_chip_mmio_capable(chip)) { enable_local_ethernet_queue(chip, timeout); } else { @@ -3182,7 +3182,7 @@ void Cluster::enable_ethernet_queue(int timeout) { } break; - case tt::Arch::BLACKHOLE: + case tt::ARCH::BLACKHOLE: log_assert(false, "Arch BLACKHOLE doesn't support ethernet queues yet"); } default: { @@ -3199,7 +3199,7 @@ void Cluster::deassert_resets_and_set_power_state() { broadcast_tensix_risc_reset_to_cluster(TENSIX_ASSERT_SOFT_RESET); // MT Initial BH - ARC messages not supported in Blackhole - if (arch_name != tt::Arch::BLACKHOLE) { + if (arch_name != tt::ARCH::BLACKHOLE) { // Send ARC Messages to deassert RISCV resets for (auto& device_it : m_pci_device_map) { arc_msg( @@ -3281,7 +3281,7 @@ void Cluster::start_device(const tt_device_params& device_params) { if (device_params.init_device) { initialize_pcie_devices(); // MT Initial BH - Ethernet firmware not present in Blackhole - if (arch_name == tt::Arch::WORMHOLE_B0) { + if (arch_name == tt::ARCH::WORMHOLE_B0) { verify_eth_fw(); } deassert_resets_and_set_power_state(); @@ -3348,10 +3348,10 @@ std::uint32_t Cluster::get_numa_node_for_pcie_device(std::uint32_t device_id) { std::uint64_t Cluster::get_pcie_base_addr_from_device(const chip_id_t chip_id) const { // TODO: Should probably be lowered to TTDevice. - tt::Arch arch = get_soc_descriptor(chip_id).arch; - if (arch == tt::Arch::WORMHOLE_B0) { + tt::ARCH arch = get_soc_descriptor(chip_id).arch; + if (arch == tt::ARCH::WORMHOLE_B0) { return 0x800000000; - } else if (arch == tt::Arch::BLACKHOLE) { + } else if (arch == tt::ARCH::BLACKHOLE) { // Enable 4th ATU window. return 1ULL << 60; } else { @@ -3360,7 +3360,7 @@ std::uint64_t Cluster::get_pcie_base_addr_from_device(const chip_id_t chip_id) c } tt_version Cluster::get_ethernet_fw_version() const { - log_assert(arch_name == tt::Arch::WORMHOLE_B0, "Can only get Ethernet FW version for Wormhole architectures."); + log_assert(arch_name == tt::ARCH::WORMHOLE_B0, "Can only get Ethernet FW version for Wormhole architectures."); log_assert( eth_fw_version.major != 0xffff and eth_fw_version.minor != 0xff and eth_fw_version.patch != 0xff, "Device must be started before querying Ethernet FW version."); diff --git a/device/coordinate_manager.cpp b/device/coordinate_manager.cpp index 32d8f2d6..01bba5c6 100644 --- a/device/coordinate_manager.cpp +++ b/device/coordinate_manager.cpp @@ -396,21 +396,21 @@ void CoordinateManager::fill_arc_logical_to_translated() { } void CoordinateManager::assert_create_coordinate_manager( - const tt::Arch arch, const size_t tensix_harvesting_mask, const size_t dram_harvesting_mask) { + const tt::ARCH arch, const size_t tensix_harvesting_mask, const size_t dram_harvesting_mask) { log_assert( - !(arch != tt::Arch::BLACKHOLE && dram_harvesting_mask != 0), "DRAM harvesting is supported only for Blackhole"); + !(arch != tt::ARCH::BLACKHOLE && dram_harvesting_mask != 0), "DRAM harvesting is supported only for Blackhole"); - if (arch == tt::Arch::BLACKHOLE) { + if (arch == tt::ARCH::BLACKHOLE) { log_assert(get_num_harvested(dram_harvesting_mask) <= 1, "Only one DRAM bank can be harvested on Blackhole"); } } std::shared_ptr CoordinateManager::create_coordinate_manager( - tt::Arch arch, const size_t tensix_harvesting_mask, const size_t dram_harvesting_mask) { + tt::ARCH arch, const size_t tensix_harvesting_mask, const size_t dram_harvesting_mask) { assert_create_coordinate_manager(arch, tensix_harvesting_mask, dram_harvesting_mask); switch (arch) { - case tt::Arch::GRAYSKULL: + case tt::ARCH::GRAYSKULL: return create_coordinate_manager( arch, tt::umd::grayskull::TENSIX_GRID_SIZE, @@ -425,7 +425,7 @@ std::shared_ptr CoordinateManager::create_coordinate_manager( tt::umd::grayskull::ARC_CORES, tt::umd::grayskull::PCIE_GRID_SIZE, tt::umd::grayskull::PCIE_CORES); - case tt::Arch::WORMHOLE_B0: + case tt::ARCH::WORMHOLE_B0: return create_coordinate_manager( arch, tt::umd::wormhole::TENSIX_GRID_SIZE, @@ -440,7 +440,7 @@ std::shared_ptr CoordinateManager::create_coordinate_manager( tt::umd::wormhole::ARC_CORES, tt::umd::wormhole::PCIE_GRID_SIZE, tt::umd::wormhole::PCIE_CORES); - case tt::Arch::BLACKHOLE: + case tt::ARCH::BLACKHOLE: return create_coordinate_manager( arch, tt::umd::blackhole::TENSIX_GRID_SIZE, @@ -459,7 +459,7 @@ std::shared_ptr CoordinateManager::create_coordinate_manager( } std::shared_ptr CoordinateManager::create_coordinate_manager( - tt::Arch arch, + tt::ARCH arch, const tt_xy_pair& tensix_grid_size, const std::vector& tensix_cores, const size_t tensix_harvesting_mask, @@ -475,7 +475,7 @@ std::shared_ptr CoordinateManager::create_coordinate_manager( assert_create_coordinate_manager(arch, tensix_harvesting_mask, dram_harvesting_mask); switch (arch) { - case tt::Arch::GRAYSKULL: + case tt::ARCH::GRAYSKULL: return std::make_shared( tensix_grid_size, tensix_cores, @@ -489,7 +489,7 @@ std::shared_ptr CoordinateManager::create_coordinate_manager( arc_cores, pcie_grid_size, pcie_cores); - case tt::Arch::WORMHOLE_B0: + case tt::ARCH::WORMHOLE_B0: return std::make_shared( tensix_grid_size, tensix_cores, @@ -503,7 +503,7 @@ std::shared_ptr CoordinateManager::create_coordinate_manager( arc_cores, pcie_grid_size, pcie_cores); - case tt::Arch::BLACKHOLE: + case tt::ARCH::BLACKHOLE: return std::make_shared( tensix_grid_size, tensix_cores, @@ -517,7 +517,7 @@ std::shared_ptr CoordinateManager::create_coordinate_manager( arc_cores, pcie_grid_size, pcie_cores); - case tt::Arch::Invalid: + case tt::ARCH::Invalid: throw std::runtime_error("Invalid architecture for creating coordinate manager"); } diff --git a/device/mockup/tt_mockup_device.hpp b/device/mockup/tt_mockup_device.hpp index 92db8560..e1023986 100644 --- a/device/mockup/tt_mockup_device.hpp +++ b/device/mockup/tt_mockup_device.hpp @@ -111,9 +111,9 @@ class tt_MockupDevice : public tt_device { std::uint32_t get_numa_node_for_pcie_device(std::uint32_t device_id) override { return 0; } private: - std::vector archs_in_cluster = {}; + std::vector archs_in_cluster = {}; std::set target_devices_in_cluster = {}; std::set target_remote_chips = {}; - tt::Arch arch_name; + tt::ARCH arch_name; std::shared_ptr cluster_descriptor; }; diff --git a/device/pcie/pci_device.cpp b/device/pcie/pci_device.cpp index e97c044a..9a6f6493 100644 --- a/device/pcie/pci_device.cpp +++ b/device/pcie/pci_device.cpp @@ -112,13 +112,13 @@ static PciDeviceInfo read_device_info(int fd) { return PciDeviceInfo{info.out.vendor_id, info.out.device_id, info.out.pci_domain, bus, dev, fn}; } -static tt::Arch detect_arch(uint32_t pcie_device_id, uint32_t pcie_revision_id) { +static tt::ARCH detect_arch(uint32_t pcie_device_id, uint32_t pcie_revision_id) { if (pcie_device_id == GS_PCIE_DEVICE_ID) { - return tt::Arch::GRAYSKULL; + return tt::ARCH::GRAYSKULL; } else if (pcie_device_id == WH_PCIE_DEVICE_ID && pcie_revision_id == 0x01) { - return tt::Arch::WORMHOLE_B0; + return tt::ARCH::WORMHOLE_B0; } else if (pcie_device_id == BH_PCIE_DEVICE_ID) { - return tt::Arch::BLACKHOLE; + return tt::ARCH::BLACKHOLE; } else { TT_THROW("Unknown pcie device id that does not match any known architecture: ", pcie_device_id); } @@ -217,15 +217,15 @@ inline void memcpy_from_device(void *dest, const void *src, std::size_t num_byte } } -tt::Arch PciDeviceInfo::get_arch() const { +tt::ARCH PciDeviceInfo::get_arch() const { if (this->device_id == GS_PCIE_DEVICE_ID) { - return tt::Arch::GRAYSKULL; + return tt::ARCH::GRAYSKULL; } else if (this->device_id == WH_PCIE_DEVICE_ID) { - return tt::Arch::WORMHOLE_B0; + return tt::ARCH::WORMHOLE_B0; } else if (this->device_id == BH_PCIE_DEVICE_ID) { - return tt::Arch::BLACKHOLE; + return tt::ARCH::BLACKHOLE; } - return tt::Arch::Invalid; + return tt::ARCH::Invalid; } /* static */ std::vector PCIDevice::enumerate_devices() { @@ -351,7 +351,7 @@ PCIDevice::PCIDevice(int pci_device_number) : throw std::runtime_error(fmt::format("Device {} has no BAR0 UC mapping.", pci_device_num)); } - auto wc_mapping_size = arch == tt::Arch::BLACKHOLE ? BH_BAR0_WC_MAPPING_SIZE : GS_BAR0_WC_MAPPING_SIZE; + auto wc_mapping_size = arch == tt::ARCH::BLACKHOLE ? BH_BAR0_WC_MAPPING_SIZE : GS_BAR0_WC_MAPPING_SIZE; // Attempt WC mapping first so we can fall back to all-UC if it fails. if (bar0_wc_mapping.mapping_id == TENSTORRENT_MAPPING_RESOURCE0_WC) { @@ -390,7 +390,7 @@ PCIDevice::PCIDevice(int pci_device_number) : bar0_wc = bar0_uc; } - if (arch == tt::Arch::WORMHOLE_B0) { + if (arch == tt::ARCH::WORMHOLE_B0) { if (bar4_uc_mapping.mapping_id != TENSTORRENT_MAPPING_RESOURCE2_UC) { throw std::runtime_error(fmt::format("Device {} has no BAR4 UC mapping.", pci_device_num)); } @@ -411,7 +411,7 @@ PCIDevice::PCIDevice(int pci_device_number) : system_reg_start_offset = (512 - 16) * 1024 * 1024; system_reg_offset_adjust = (512 - 32) * 1024 * 1024; - } else if (arch == tt::Arch::BLACKHOLE) { + } else if (arch == tt::ARCH::BLACKHOLE) { if (bar2_uc_mapping.mapping_id != TENSTORRENT_MAPPING_RESOURCE1_UC) { throw std::runtime_error(fmt::format("Device {} has no BAR2 UC mapping.", pci_device_num)); } @@ -451,7 +451,7 @@ PCIDevice::PCIDevice(int pci_device_number) : } // GS+WH: ARC_SCRATCH[6], BH: NOC NODE_ID - read_checking_offset = arch == tt::Arch::BLACKHOLE ? BH_NOC_NODE_ID_OFFSET : GS_WH_ARC_SCRATCH_6_OFFSET; + read_checking_offset = arch == tt::ARCH::BLACKHOLE ? BH_NOC_NODE_ID_OFFSET : GS_WH_ARC_SCRATCH_6_OFFSET; } PCIDevice::~PCIDevice() { @@ -461,7 +461,7 @@ PCIDevice::~PCIDevice() { } } - if (arch == tt::Arch::BLACKHOLE && bar2_uc != nullptr && bar2_uc != MAP_FAILED) { + if (arch == tt::ARCH::BLACKHOLE && bar2_uc != nullptr && bar2_uc != MAP_FAILED) { // Disable ATU index 0 // TODO: Implement disabling for all indexes, once more host channels are enabled. @@ -523,7 +523,7 @@ void PCIDevice::write_block(uint64_t byte_addr, uint64_t num_bytes, const uint8_ } const void *src = reinterpret_cast(buffer_addr); - if (arch == tt::Arch::WORMHOLE_B0) { + if (arch == tt::ARCH::WORMHOLE_B0) { memcpy_to_device(dest, src, num_bytes); } else { memcpy(dest, src, num_bytes); @@ -540,7 +540,7 @@ void PCIDevice::read_block(uint64_t byte_addr, uint64_t num_bytes, uint8_t *buff } void *dest = reinterpret_cast(buffer_addr); - if (arch == tt::Arch::WORMHOLE_B0) { + if (arch == tt::ARCH::WORMHOLE_B0) { memcpy_from_device(dest, src, num_bytes); } else { memcpy(dest, src, num_bytes); @@ -663,7 +663,7 @@ dynamic_tlb PCIDevice::set_dynamic_tlb( // TODO #2715: hack for Blackhole A0, will potentially be fixed in B0. // Using the same static vc for reads and writes through TLBs can hang the card. It doesn't even have to be // the same TLB. Dynamic vc should not have this issue. There might be a perf impact with using dynamic vc. - .static_vc = (get_arch() == tt::Arch::BLACKHOLE) ? false : true, + .static_vc = (get_arch() == tt::ARCH::BLACKHOLE) ? false : true, } .apply_offset(tlb_config.offset); diff --git a/device/simulation/tt_simulation_device.cpp b/device/simulation/tt_simulation_device.cpp index b08bb687..fc6cce4d 100644 --- a/device/simulation/tt_simulation_device.cpp +++ b/device/simulation/tt_simulation_device.cpp @@ -224,9 +224,9 @@ void* tt_SimulationDevice::host_dma_address(std::uint64_t offset, chip_id_t src_ } std::uint64_t tt_SimulationDevice::get_pcie_base_addr_from_device(const chip_id_t chip_id) const { - if (arch_name == tt::Arch::WORMHOLE_B0) { + if (arch_name == tt::ARCH::WORMHOLE_B0) { return 0x800000000; - } else if (arch_name == tt::Arch::BLACKHOLE) { + } else if (arch_name == tt::ARCH::BLACKHOLE) { // Enable 4th ATU window. return 1ULL << 60; } else { diff --git a/device/tt_cluster_descriptor.cpp b/device/tt_cluster_descriptor.cpp index feea9cfc..9a10ad82 100644 --- a/device/tt_cluster_descriptor.cpp +++ b/device/tt_cluster_descriptor.cpp @@ -442,15 +442,15 @@ std::unique_ptr tt_ClusterDescriptor::create() { } std::unique_ptr tt_ClusterDescriptor::create_mock_cluster( - const std::vector &logical_device_ids, tt::Arch arch) { + const std::vector &logical_device_ids, tt::ARCH arch) { std::unique_ptr desc = std::unique_ptr(new tt_ClusterDescriptor()); BoardType board_type; switch (arch) { - case tt::Arch::WORMHOLE_B0: + case tt::ARCH::WORMHOLE_B0: board_type = BoardType::N150; break; - case tt::Arch::BLACKHOLE: + case tt::ARCH::BLACKHOLE: board_type = BoardType::P150A; break; default: @@ -866,7 +866,7 @@ BoardType tt_ClusterDescriptor::get_board_type(chip_id_t chip_id) const { return chip_board_type.at(chip_id); } -tt::Arch tt_ClusterDescriptor::get_arch(chip_id_t chip_id) const { +tt::ARCH tt_ClusterDescriptor::get_arch(chip_id_t chip_id) const { log_assert( chip_arch.find(chip_id) != chip_arch.end(), "Chip {} does not have an architecture in the cluster descriptor", @@ -874,7 +874,7 @@ tt::Arch tt_ClusterDescriptor::get_arch(chip_id_t chip_id) const { return chip_arch.at(chip_id); } -/* static */ tt::Arch tt_ClusterDescriptor::detect_arch(chip_id_t chip_id) { +/* static */ tt::ARCH tt_ClusterDescriptor::detect_arch(chip_id_t chip_id) { return tt_ClusterDescriptor::create()->get_arch(chip_id); } diff --git a/device/tt_soc_descriptor.cpp b/device/tt_soc_descriptor.cpp index 52ba5b52..92092a1d 100644 --- a/device/tt_soc_descriptor.cpp +++ b/device/tt_soc_descriptor.cpp @@ -234,15 +234,15 @@ bool tt_SocDescriptor::is_ethernet_core(const tt_xy_pair &core) const { return this->ethernet_core_channel_map.find(core) != ethernet_core_channel_map.end(); } -std::string tt_SocDescriptor::get_soc_descriptor_path(tt::Arch arch) { +std::string tt_SocDescriptor::get_soc_descriptor_path(tt::ARCH arch) { switch (arch) { - case tt::Arch::GRAYSKULL: + case tt::ARCH::GRAYSKULL: // TODO: this path needs to be changed to point to soc descriptors outside of tests directory. return tt::umd::utils::get_abs_path("tests/soc_descs/grayskull_10x12.yaml"); - case tt::Arch::WORMHOLE_B0: + case tt::ARCH::WORMHOLE_B0: // TODO: this path needs to be changed to point to soc descriptors outside of tests directory. return tt::umd::utils::get_abs_path("tests/soc_descs/wormhole_b0_8x10.yaml"); - case tt::Arch::BLACKHOLE: + case tt::ARCH::BLACKHOLE: // TODO: this path needs to be changed to point to soc descriptors outside of tests directory. return tt::umd::utils::get_abs_path("tests/soc_descs/blackhole_140_arch_no_eth.yaml"); default: diff --git a/tests/api/test_cluster.cpp b/tests/api/test_cluster.cpp index f3332380..9b53494b 100644 --- a/tests/api/test_cluster.cpp +++ b/tests/api/test_cluster.cpp @@ -43,7 +43,7 @@ inline std::unique_ptr get_cluster() { void setup_wormhole_remote(Cluster* umd_cluster) { if (!umd_cluster->get_target_remote_device_ids().empty() && umd_cluster->get_soc_descriptor(*umd_cluster->get_all_chips_in_cluster().begin()).arch == - tt::Arch::WORMHOLE_B0) { + tt::ARCH::WORMHOLE_B0) { // Populate address map and NOC parameters that the driver needs for remote transactions umd_cluster->set_device_l1_address_params( @@ -82,7 +82,7 @@ TEST(ApiClusterTest, SimpleIOAllChips) { tt_xy_pair any_core = soc_desc.workers[0]; tt_cxy_pair any_core_global(chip_id, any_core); - if (cluster_desc->is_chip_remote(chip_id) && soc_desc.arch != tt::Arch::WORMHOLE_B0) { + if (cluster_desc->is_chip_remote(chip_id) && soc_desc.arch != tt::ARCH::WORMHOLE_B0) { std::cout << "Skipping remote chip " << chip_id << " because it is not a wormhole_b0 chip." << std::endl; continue; } @@ -100,7 +100,7 @@ TEST(ApiClusterTest, SimpleIOAllChips) { tt_xy_pair any_core = soc_desc.workers[0]; tt_cxy_pair any_core_global(chip_id, any_core); - if (cluster_desc->is_chip_remote(chip_id) && soc_desc.arch != tt::Arch::WORMHOLE_B0) { + if (cluster_desc->is_chip_remote(chip_id) && soc_desc.arch != tt::ARCH::WORMHOLE_B0) { std::cout << "Skipping remote chip " << chip_id << " because it is not a wormhole_b0 chip." << std::endl; continue; } @@ -141,7 +141,7 @@ TEST(ApiClusterTest, RemoteFlush) { continue; } - if (soc_desc.arch != tt::Arch::WORMHOLE_B0) { + if (soc_desc.arch != tt::ARCH::WORMHOLE_B0) { std::cout << "Skipping remote chip " << chip_id << " because it is not a wormhole_b0 chip." << std::endl; continue; } @@ -160,7 +160,7 @@ TEST(ApiClusterTest, RemoteFlush) { const tt_SocDescriptor& soc_desc = umd_cluster->get_soc_descriptor(any_remote_chip); tt_xy_pair any_core = soc_desc.workers[0]; tt_cxy_pair any_core_global(any_remote_chip, any_core); - if (soc_desc.arch != tt::Arch::WORMHOLE_B0) { + if (soc_desc.arch != tt::ARCH::WORMHOLE_B0) { std::cout << "Skipping whole cluster wait because it is not a wormhole_b0 chip." << std::endl; return; } @@ -202,7 +202,7 @@ TEST(ApiClusterTest, SimpleIOSpecificChips) { tt_xy_pair any_core = soc_desc.workers[0]; tt_cxy_pair any_core_global(chip_id, any_core); - if (cluster_desc->is_chip_remote(chip_id) && soc_desc.arch != tt::Arch::WORMHOLE_B0) { + if (cluster_desc->is_chip_remote(chip_id) && soc_desc.arch != tt::ARCH::WORMHOLE_B0) { std::cout << "Skipping remote chip " << chip_id << " because it is not a wormhole_b0 chip." << std::endl; continue; } @@ -220,7 +220,7 @@ TEST(ApiClusterTest, SimpleIOSpecificChips) { tt_xy_pair any_core = soc_desc.workers[0]; tt_cxy_pair any_core_global(chip_id, any_core); - if (cluster_desc->is_chip_remote(chip_id) && soc_desc.arch != tt::Arch::WORMHOLE_B0) { + if (cluster_desc->is_chip_remote(chip_id) && soc_desc.arch != tt::ARCH::WORMHOLE_B0) { std::cout << "Skipping remote chip " << chip_id << " because it is not a wormhole_b0 chip." << std::endl; continue; } diff --git a/tests/api/test_cluster_descriptor.cpp b/tests/api/test_cluster_descriptor.cpp index 3fa128ff..68a0a61e 100644 --- a/tests/api/test_cluster_descriptor.cpp +++ b/tests/api/test_cluster_descriptor.cpp @@ -20,8 +20,8 @@ TEST(ApiClusterDescriptorTest, DetectArch) { // Expect it to be invalid if no devices are found. EXPECT_THROW(tt_ClusterDescriptor::detect_arch(0), std::runtime_error); } else { - tt::Arch arch = tt_ClusterDescriptor::detect_arch(0); - EXPECT_NE(arch, tt::Arch::Invalid); + tt::ARCH arch = tt_ClusterDescriptor::detect_arch(0); + EXPECT_NE(arch, tt::ARCH::Invalid); // Test that cluster descriptor and PCIDevice::enumerate_devices_info() return the same set of chips. std::map pci_device_infos = PCIDevice::enumerate_devices_info(); diff --git a/tests/api/test_core_coord_translation_bh.cpp b/tests/api/test_core_coord_translation_bh.cpp index 56f2cae3..95cbe155 100644 --- a/tests/api/test_core_coord_translation_bh.cpp +++ b/tests/api/test_core_coord_translation_bh.cpp @@ -13,7 +13,7 @@ using namespace tt::umd; // when there is no harvesting. TEST(CoordinateManager, CoordinateManagerBlackholeNoHarvesting) { std::shared_ptr coordinate_manager = - CoordinateManager::create_coordinate_manager(tt::Arch::BLACKHOLE); + CoordinateManager::create_coordinate_manager(tt::ARCH::BLACKHOLE); // We expect full grid size since there is no harvesting. tt_xy_pair tensix_grid_size = tt::umd::blackhole::TENSIX_GRID_SIZE; @@ -35,7 +35,7 @@ TEST(CoordinateManager, CoordinateManagerBlackholeNoHarvesting) { // the logical coordinates if the first row is harvested. TEST(CoordinateManager, CoordinateManagerBlackholeTopLeftCore) { std::shared_ptr coordinate_manager = - CoordinateManager::create_coordinate_manager(tt::Arch::BLACKHOLE, 1); + CoordinateManager::create_coordinate_manager(tt::ARCH::BLACKHOLE, 1); tt_xy_pair tensix_grid_size = tt::umd::blackhole::TENSIX_GRID_SIZE; CoreCoord logical_coords = CoreCoord(0, 0, CoreType::TENSIX, CoordSystem::LOGICAL); @@ -58,7 +58,7 @@ TEST(CoordinateManager, CoordinateManagerBlackholeLogicalPhysicalMapping) { for (size_t harvesting_mask = 0; harvesting_mask < (1 << max_num_harvested_x); harvesting_mask++) { std::shared_ptr coordinate_manager = - CoordinateManager::create_coordinate_manager(tt::Arch::BLACKHOLE, harvesting_mask); + CoordinateManager::create_coordinate_manager(tt::ARCH::BLACKHOLE, harvesting_mask); std::map logical_to_physical; std::set physical_coords_set; @@ -100,7 +100,7 @@ TEST(CoordinateManager, CoordinateManagerBlackholeLogicalVirtualMapping) { for (size_t harvesting_mask = 0; harvesting_mask < (1 << max_num_harvested_x); harvesting_mask++) { std::shared_ptr coordinate_manager = - CoordinateManager::create_coordinate_manager(tt::Arch::BLACKHOLE, harvesting_mask); + CoordinateManager::create_coordinate_manager(tt::ARCH::BLACKHOLE, harvesting_mask); std::map logical_to_virtual; std::set virtual_coords_set; @@ -142,7 +142,7 @@ TEST(CoordinateManager, CoordinateManagerBlackholeLogicalTranslatedMapping) { for (size_t harvesting_mask = 0; harvesting_mask < (1 << max_num_harvested_x); harvesting_mask++) { std::shared_ptr coordinate_manager = - CoordinateManager::create_coordinate_manager(tt::Arch::BLACKHOLE, harvesting_mask); + CoordinateManager::create_coordinate_manager(tt::ARCH::BLACKHOLE, harvesting_mask); std::map logical_to_translated; std::set translated_coords_set; @@ -183,7 +183,7 @@ TEST(CoordinateManager, CoordinateManagerBlackholeVirtualEqualTranslated) { for (size_t harvesting_mask = 0; harvesting_mask < (1 << max_num_harvested_x); harvesting_mask++) { std::shared_ptr coordinate_manager = - CoordinateManager::create_coordinate_manager(tt::Arch::BLACKHOLE, harvesting_mask); + CoordinateManager::create_coordinate_manager(tt::ARCH::BLACKHOLE, harvesting_mask); size_t num_harvested_x = CoordinateManager::get_num_harvested(harvesting_mask); @@ -205,7 +205,7 @@ TEST(CoordinateManager, CoordinateManagerBlackholeVirtualEqualTranslated) { // coordinates should cover all physical coordinates. TEST(CoordinateManager, CoordinateManagerBlackholeDRAMNoHarvesting) { std::shared_ptr coordinate_manager = - CoordinateManager::create_coordinate_manager(tt::Arch::BLACKHOLE); + CoordinateManager::create_coordinate_manager(tt::ARCH::BLACKHOLE); const size_t num_dram_banks = tt::umd::blackhole::NUM_DRAM_BANKS; const size_t num_noc_ports_per_bank = tt::umd::blackhole::NUM_NOC_PORTS_PER_DRAM_BANK; @@ -231,7 +231,7 @@ TEST(CoordinateManager, CoordinateManagerBlackholeDRAMNoHarvesting) { // Test top left corner translation from logical to physical coordinates. TEST(CoordinateManager, CoordinateManagerBlackholeDRAMTopLeft) { std::shared_ptr coordinate_manager = - CoordinateManager::create_coordinate_manager(tt::Arch::BLACKHOLE, 0, 1); + CoordinateManager::create_coordinate_manager(tt::ARCH::BLACKHOLE, 0, 1); const CoreCoord top_left_dram_logical = CoreCoord(0, 0, CoreType::DRAM, CoordSystem::LOGICAL); const CoreCoord expected_top_left_physical = CoreCoord(0, 2, CoreType::DRAM, CoordSystem::PHYSICAL); @@ -257,7 +257,7 @@ TEST(CoordinateManager, CoordinateManagerBlackholeDRAMLogicalPhysicalMapping) { } std::shared_ptr coordinate_manager = - CoordinateManager::create_coordinate_manager(tt::Arch::BLACKHOLE, 0, harvesting_mask); + CoordinateManager::create_coordinate_manager(tt::ARCH::BLACKHOLE, 0, harvesting_mask); std::map logical_to_physical; std::set physical_coords_set; @@ -304,7 +304,7 @@ TEST(CoordinateManager, CoordinateManagerBlackholeDRAMLogicalVirtualMapping) { } std::shared_ptr coordinate_manager = - CoordinateManager::create_coordinate_manager(tt::Arch::BLACKHOLE, 0, harvesting_mask); + CoordinateManager::create_coordinate_manager(tt::ARCH::BLACKHOLE, 0, harvesting_mask); std::map logical_to_virtual; std::set virtual_coords_set; @@ -346,7 +346,7 @@ TEST(CoordinateManager, CoordinateManagerBlackholeDRAMTranslatedMapping) { } std::shared_ptr coordinate_manager = - CoordinateManager::create_coordinate_manager(tt::Arch::BLACKHOLE, 0, harvesting_mask); + CoordinateManager::create_coordinate_manager(tt::ARCH::BLACKHOLE, 0, harvesting_mask); std::map logical_to_translated; std::set translated_coord_set; @@ -393,14 +393,14 @@ TEST(CoordinateManager, CoordinateManagerBlackholeDRAMPMoreThanOneDRAMBankHarves } EXPECT_THROW( - CoordinateManager::create_coordinate_manager(tt::Arch::BLACKHOLE, 0, harvesting_mask), std::runtime_error); + CoordinateManager::create_coordinate_manager(tt::ARCH::BLACKHOLE, 0, harvesting_mask), std::runtime_error); } } // Test that virtual, physical and translated coordinates are the same for all logical PCIE coordinates. TEST(CoordinateManager, CoordinateManagerBlackholePCIETranslation) { std::shared_ptr coordinate_manager = - CoordinateManager::create_coordinate_manager(tt::Arch::BLACKHOLE); + CoordinateManager::create_coordinate_manager(tt::ARCH::BLACKHOLE); const tt_xy_pair pcie_grid_size = tt::umd::blackhole::PCIE_GRID_SIZE; for (size_t x = 0; x < pcie_grid_size.x; x++) { @@ -418,7 +418,7 @@ TEST(CoordinateManager, CoordinateManagerBlackholePCIETranslation) { // Test that virtual, physical and translated coordinates are the same for all logical ARC coordinates. TEST(CoordinateManager, CoordinateManagerBlackholeARCTranslation) { std::shared_ptr coordinate_manager = - CoordinateManager::create_coordinate_manager(tt::Arch::BLACKHOLE); + CoordinateManager::create_coordinate_manager(tt::ARCH::BLACKHOLE); const tt_xy_pair arc_grid_size = tt::umd::blackhole::ARC_GRID_SIZE; for (size_t x = 0; x < arc_grid_size.x; x++) { @@ -440,7 +440,7 @@ TEST(CoordinateManager, CoordinateManagerBlackholeARCTranslation) { // Test ethernet coordinate translation. TEST(CoordinateManager, CoordinateManagerBlackholeETHTranslation) { std::shared_ptr coordinate_manager = - CoordinateManager::create_coordinate_manager(tt::Arch::BLACKHOLE); + CoordinateManager::create_coordinate_manager(tt::ARCH::BLACKHOLE); const tt_xy_pair eth_grid_size = tt::umd::blackhole::ETH_GRID_SIZE; const size_t eth_translated_coordinate_start_x = 20; diff --git a/tests/api/test_core_coord_translation_gs.cpp b/tests/api/test_core_coord_translation_gs.cpp index 7b15ef2c..233cb9e3 100644 --- a/tests/api/test_core_coord_translation_gs.cpp +++ b/tests/api/test_core_coord_translation_gs.cpp @@ -13,7 +13,7 @@ using namespace tt::umd; // when there is no harvesting. TEST(CoordinateManager, CoordinateManagerGrayskullNoHarvesting) { std::shared_ptr coordinate_manager = - CoordinateManager::create_coordinate_manager(tt::Arch::GRAYSKULL); + CoordinateManager::create_coordinate_manager(tt::ARCH::GRAYSKULL); // We expect full grid size since there is no harvesting. tt_xy_pair tensix_grid_size = tt::umd::grayskull::TENSIX_GRID_SIZE; @@ -35,7 +35,7 @@ TEST(CoordinateManager, CoordinateManagerGrayskullNoHarvesting) { // the logical coordinates if the first row is harvested. TEST(CoordinateManager, CoordinateManagerGrayskullTopLeftCore) { std::shared_ptr coordinate_manager = - CoordinateManager::create_coordinate_manager(tt::Arch::GRAYSKULL); + CoordinateManager::create_coordinate_manager(tt::ARCH::GRAYSKULL); CoreCoord logical_coords = CoreCoord(0, 0, CoreType::TENSIX, CoordSystem::LOGICAL); @@ -53,7 +53,7 @@ TEST(CoordinateManager, CoordinateManagerGrayskullTopLeftCore) { // the logical coordinates if the first row is harvested. TEST(CoordinateManager, CoordinateManagerGrayskullTopLeftCoreHarvesting) { std::shared_ptr coordinate_manager = - CoordinateManager::create_coordinate_manager(tt::Arch::GRAYSKULL, 1); + CoordinateManager::create_coordinate_manager(tt::ARCH::GRAYSKULL, 1); CoreCoord logical_coords = CoreCoord(0, 0, CoreType::TENSIX, CoordSystem::LOGICAL); @@ -70,7 +70,7 @@ TEST(CoordinateManager, CoordinateManagerGrayskullTopLeftCoreHarvesting) { // We always expect that physical, virtual and translated coordinates are the same. TEST(CoordinateManager, CoordinateManagerGrayskullTranslatingCoords) { std::shared_ptr coordinate_manager = - CoordinateManager::create_coordinate_manager(tt::Arch::GRAYSKULL); + CoordinateManager::create_coordinate_manager(tt::ARCH::GRAYSKULL); tt_xy_pair tensix_grid_size = tt::umd::grayskull::TENSIX_GRID_SIZE; for (size_t x = 0; x < tensix_grid_size.x; x++) { @@ -100,7 +100,7 @@ TEST(CoordinateManager, CoordinateManagerGrayskullLogicalPhysicalMapping) { for (size_t harvesting_mask = 0; harvesting_mask < (1 << max_num_harvested_y); harvesting_mask++) { std::shared_ptr coordinate_manager = - CoordinateManager::create_coordinate_manager(tt::Arch::GRAYSKULL, harvesting_mask); + CoordinateManager::create_coordinate_manager(tt::ARCH::GRAYSKULL, harvesting_mask); std::map logical_to_physical; std::set physical_coords_set; @@ -144,7 +144,7 @@ TEST(CoordinateManager, CoordinateManagerGrayskullLogicalVirtualMapping) { for (size_t harvesting_mask = 0; harvesting_mask < (1 << max_num_harvested_y); harvesting_mask++) { std::shared_ptr coordinate_manager = - CoordinateManager::create_coordinate_manager(tt::Arch::GRAYSKULL, harvesting_mask); + CoordinateManager::create_coordinate_manager(tt::ARCH::GRAYSKULL, harvesting_mask); std::map logical_to_virtual; std::set virtual_coords_set; @@ -178,7 +178,7 @@ TEST(CoordinateManager, CoordinateManagerGrayskullLogicalVirtualMapping) { // so logical coordinates should cover all physical coordinates. TEST(CoordinateManager, CoordinateManagerGrayskullDRAMNoHarvesting) { std::shared_ptr coordinate_manager = - CoordinateManager::create_coordinate_manager(tt::Arch::GRAYSKULL); + CoordinateManager::create_coordinate_manager(tt::ARCH::GRAYSKULL); const size_t num_dram_banks = tt::umd::grayskull::NUM_DRAM_BANKS; const std::vector& dram_cores = tt::umd::grayskull::DRAM_CORES; @@ -197,7 +197,7 @@ TEST(CoordinateManager, CoordinateManagerGrayskullDRAMNoHarvesting) { // Test that virtual, physical and translated coordinates are the same for all logical PCIE coordinates. TEST(CoordinateManager, CoordinateManagerGrayskullPCIETranslation) { std::shared_ptr coordinate_manager = - CoordinateManager::create_coordinate_manager(tt::Arch::GRAYSKULL); + CoordinateManager::create_coordinate_manager(tt::ARCH::GRAYSKULL); const tt_xy_pair pcie_grid_size = tt::umd::grayskull::PCIE_GRID_SIZE; for (size_t x = 0; x < pcie_grid_size.x; x++) { @@ -219,7 +219,7 @@ TEST(CoordinateManager, CoordinateManagerGrayskullPCIETranslation) { // Test that virtual, physical and translated coordinates are the same for all logical ARC coordinates. TEST(CoordinateManager, CoordinateManagerGrayskullARCTranslation) { std::shared_ptr coordinate_manager = - CoordinateManager::create_coordinate_manager(tt::Arch::GRAYSKULL); + CoordinateManager::create_coordinate_manager(tt::ARCH::GRAYSKULL); const tt_xy_pair arc_grid_size = tt::umd::grayskull::ARC_GRID_SIZE; for (size_t x = 0; x < arc_grid_size.x; x++) { @@ -240,5 +240,5 @@ TEST(CoordinateManager, CoordinateManagerGrayskullARCTranslation) { // Test that we assert properly if DRAM harvesting mask is non-zero for Grayskull. TEST(CoordinateManager, CoordinateManagerGrayskullDRAMHarvestingAssert) { - EXPECT_THROW(CoordinateManager::create_coordinate_manager(tt::Arch::GRAYSKULL, 0, 1), std::runtime_error); + EXPECT_THROW(CoordinateManager::create_coordinate_manager(tt::ARCH::GRAYSKULL, 0, 1), std::runtime_error); } diff --git a/tests/api/test_core_coord_translation_wh.cpp b/tests/api/test_core_coord_translation_wh.cpp index e2252def..d19539a8 100644 --- a/tests/api/test_core_coord_translation_wh.cpp +++ b/tests/api/test_core_coord_translation_wh.cpp @@ -15,7 +15,7 @@ TEST(CoordinateManager, CoordinateManagerWormholeNoHarvesting) { const size_t harvesting_mask = 0; std::shared_ptr coordinate_manager = - CoordinateManager::create_coordinate_manager(tt::Arch::WORMHOLE_B0, 0, 0); + CoordinateManager::create_coordinate_manager(tt::ARCH::WORMHOLE_B0, 0, 0); // We expect full grid size since there is no harvesting. tt_xy_pair tensix_grid_size = tt::umd::wormhole::TENSIX_GRID_SIZE; @@ -39,7 +39,7 @@ TEST(CoordinateManager, CoordinateManagerWormholeTopLeftCore) { const size_t harvesting_mask = 1; std::shared_ptr coordinate_manager = - CoordinateManager::create_coordinate_manager(tt::Arch::WORMHOLE_B0, harvesting_mask); + CoordinateManager::create_coordinate_manager(tt::ARCH::WORMHOLE_B0, harvesting_mask); tt_xy_pair tensix_grid_size = tt::umd::wormhole::TENSIX_GRID_SIZE; CoreCoord logical_coords = CoreCoord(0, 0, CoreType::TENSIX, CoordSystem::LOGICAL); @@ -62,7 +62,7 @@ TEST(CoordinateManager, CoordinateManagerWormholeLogicalPhysicalMapping) { for (size_t harvesting_mask = 0; harvesting_mask < (1 << max_num_harvested_y); harvesting_mask++) { std::shared_ptr coordinate_manager = - CoordinateManager::create_coordinate_manager(tt::Arch::WORMHOLE_B0, harvesting_mask); + CoordinateManager::create_coordinate_manager(tt::ARCH::WORMHOLE_B0, harvesting_mask); std::map logical_to_physical; std::set physical_coords_set; @@ -106,7 +106,7 @@ TEST(CoordinateManager, CoordinateManagerWormholeLogicalVirtualMapping) { for (size_t harvesting_mask = 0; harvesting_mask < (1 << max_num_harvested_y); harvesting_mask++) { std::shared_ptr coordinate_manager = - CoordinateManager::create_coordinate_manager(tt::Arch::WORMHOLE_B0, harvesting_mask); + CoordinateManager::create_coordinate_manager(tt::ARCH::WORMHOLE_B0, harvesting_mask); std::map logical_to_virtual; std::set virtual_coords_set; @@ -150,7 +150,7 @@ TEST(CoordinateManager, CoordinateManagerWormholeLogicalTranslatedTopLeft) { // everything is harvested. for (size_t harvesting_mask = 0; harvesting_mask < (1 << max_num_harvested_y) - 1; harvesting_mask++) { std::shared_ptr coordinate_manager = - CoordinateManager::create_coordinate_manager(tt::Arch::WORMHOLE_B0, harvesting_mask); + CoordinateManager::create_coordinate_manager(tt::ARCH::WORMHOLE_B0, harvesting_mask); tt_xy_pair tensix_grid_size = tt::umd::wormhole::TENSIX_GRID_SIZE; @@ -174,7 +174,7 @@ TEST(CoordinateManager, CoordinateManagerWormholeLogicalTranslatedTopLeft) { // so logical coordinates should cover all physical coordinates. TEST(CoordinateManager, CoordinateManagerWormholeDRAMNoHarvesting) { std::shared_ptr coordinate_manager = - CoordinateManager::create_coordinate_manager(tt::Arch::WORMHOLE_B0); + CoordinateManager::create_coordinate_manager(tt::ARCH::WORMHOLE_B0); const size_t num_dram_banks = tt::umd::wormhole::NUM_DRAM_BANKS; const size_t num_noc_ports_per_bank = tt::umd::wormhole::NUM_NOC_PORTS_PER_DRAM_BANK; @@ -201,7 +201,7 @@ TEST(CoordinateManager, CoordinateManagerWormholeDRAMNoHarvesting) { // harvesting. TEST(CoordinateManager, CoordinateManagerWormholeETHPhysicalEqualVirtual) { std::shared_ptr coordinate_manager = - CoordinateManager::create_coordinate_manager(tt::Arch::WORMHOLE_B0); + CoordinateManager::create_coordinate_manager(tt::ARCH::WORMHOLE_B0); const tt_xy_pair eth_grid_size = tt::umd::wormhole::ETH_GRID_SIZE; for (size_t x = 0; x < eth_grid_size.x; x++) { @@ -219,7 +219,7 @@ TEST(CoordinateManager, CoordinateManagerWormholeETHPhysicalEqualVirtual) { // Test translation of logical to translated ethernet coordinates. TEST(CoordinateManager, CoordinateManagerWormholeETHLogicalToTranslated) { std::shared_ptr coordinate_manager = - CoordinateManager::create_coordinate_manager(tt::Arch::WORMHOLE_B0); + CoordinateManager::create_coordinate_manager(tt::ARCH::WORMHOLE_B0); const tt_xy_pair eth_grid_size = tt::umd::wormhole::ETH_GRID_SIZE; for (size_t x = 0; x < eth_grid_size.x; x++) { @@ -236,7 +236,7 @@ TEST(CoordinateManager, CoordinateManagerWormholeETHLogicalToTranslated) { // Test that virtual, physical and translated coordinates are the same for all logical coordinates. TEST(CoordinateManager, CoordinateManagerWormholeARCTranslation) { std::shared_ptr coordinate_manager = - CoordinateManager::create_coordinate_manager(tt::Arch::WORMHOLE_B0); + CoordinateManager::create_coordinate_manager(tt::ARCH::WORMHOLE_B0); const tt_xy_pair arc_grid_size = tt::umd::wormhole::ARC_GRID_SIZE; for (size_t x = 0; x < arc_grid_size.x; x++) { @@ -258,7 +258,7 @@ TEST(CoordinateManager, CoordinateManagerWormholeARCTranslation) { // Test that virtual, physical and translated coordinates are the same for all logical PCIE coordinates. TEST(CoordinateManager, CoordinateManagerWormholePCIETranslation) { std::shared_ptr coordinate_manager = - CoordinateManager::create_coordinate_manager(tt::Arch::WORMHOLE_B0); + CoordinateManager::create_coordinate_manager(tt::ARCH::WORMHOLE_B0); const tt_xy_pair pcie_grid_size = tt::umd::wormhole::PCIE_GRID_SIZE; for (size_t x = 0; x < pcie_grid_size.x; x++) { @@ -279,5 +279,5 @@ TEST(CoordinateManager, CoordinateManagerWormholePCIETranslation) { // Test that we assert properly if DRAM harvesting mask is non-zero for Wormhole. TEST(CoordinateManager, CoordinateManagerWormholeDRAMHarvestingAssert) { - EXPECT_THROW(CoordinateManager::create_coordinate_manager(tt::Arch::WORMHOLE_B0, 0, 1), std::runtime_error); + EXPECT_THROW(CoordinateManager::create_coordinate_manager(tt::ARCH::WORMHOLE_B0, 0, 1), std::runtime_error); } diff --git a/tests/api/test_mockup_device.cpp b/tests/api/test_mockup_device.cpp index 15350b57..f82e86b7 100644 --- a/tests/api/test_mockup_device.cpp +++ b/tests/api/test_mockup_device.cpp @@ -24,17 +24,17 @@ std::string get_env_arch_name() { throw std::runtime_error("Environment variable ARCH_NAME is not set."); } -std::string get_soc_descriptor_file(tt::Arch arch) { +std::string get_soc_descriptor_file(tt::ARCH arch) { // const std::string umd_root = get_umd_root(); switch (arch) { - case tt::Arch::GRAYSKULL: + case tt::ARCH::GRAYSKULL: return test_utils::GetAbsPath("tests/soc_descs/grayskull_10x12.yaml"); - case tt::Arch::WORMHOLE_B0: + case tt::ARCH::WORMHOLE_B0: return test_utils::GetAbsPath("tests/soc_descs/wormhole_b0_8x10.yaml"); - case tt::Arch::BLACKHOLE: + case tt::ARCH::BLACKHOLE: return test_utils::GetAbsPath("tests/soc_descs/blackhole_140_arch.yaml"); - case tt::Arch::Invalid: + case tt::ARCH::Invalid: throw std::runtime_error("Invalid arch not supported"); default: throw std::runtime_error("Unsupported device architecture");